Page 15 of 15

Re: Profile friend list

Posted: Sun Apr 25, 2010 6:49 pm
by phreakwars
I said 141-161

20 LINES WORTH.

I saw this entered twice:

Code: Select all

    <ul class="linklist">
            <li class="rightside pagination">{TOTAL_FRIENDS} &bull; <!-- IF FRINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER_F}</a> &bull; <span>{FRINATION}</span><!-- ELSE -->{PAGE_NUMBER_F}<!-- ENDIF --></li>
        </ul>

        <span class="corners-bottom"><span></span></span></div>
           </div>
           <div class="panel bg1">
              <div class="inner"><span class="corners-top"><span></span></span>
                 <h3>{L_FRIEND_LIST}&nbsp;(<a href="{U_VIEW_ALL}">{L_VIEW_ALL}</a>)</h3>
                 <!-- BEGIN fri -->
                 <a class="thumbnail" href="{fri.AV_LINK}" style="text-decoration:none">
              <span>
           
                 <!-- IF fri.USER_COLOR --><b style="color:#{fri.USER_COLOR}"> <!-- ELSE --><b style="color:#000;"><!-- ENDIF -->{fri.USERNAME}</b>                  <!-- IF fri.ONLINE_USER -->(<strong>{L_ONLINE}</strong>)<!-- ENDIF -->
           <br /><!-- IF fri.FRI_AV -->{fri.FRI_AV}</span>{fri.FRI_AV_THUMB} <!-- ELSE --> <img src="{ROOT_PATH}images/no_avatar.gif" alt="noavatar" />
           
                 </span><img src="images/no_avatar.gif" alt="noavatar"  width="{fri.WIDTH}" /><!-- ENDIF -->
           
                 </a>
                 <!-- END fri -->
.
.

Re: Profile friend list

Posted: Sun Apr 25, 2010 6:54 pm
by phreakwars
Still confused?

Your memberlist_view.html should look like this:

Code: Select all

    <!-- INCLUDE overall_header.html -->

    <h2>{PAGE_TITLE}</h2>

    <form method="post" action="{S_PROFILE_ACTION}" id="viewprofile">
    <div class="panel bg1<!-- IF S_ONLINE --> online<!-- ENDIF -->">
       <div class="inner"><span class="corners-top"><span></span></span>

       <!-- IF AVATAR_IMG -->
          <dl class="left-box">
             <dt>{AVATAR_IMG}</dt>
             <!-- IF RANK_TITLE --><dd style="text-align: center;">{RANK_TITLE}</dd><!-- ENDIF -->
             <!-- IF RANK_IMG --><dd style="text-align: center;">{RANK_IMG}</dd><!-- ENDIF -->
          </dl>
       <!-- ENDIF -->

       <dl class="left-box details" style="width: 80%;">
          <dt>{L_USERNAME}:</dt>
          <dd>
             <!-- IF USER_COLOR --><span style="color: {USER_COLOR}; font-weight: bold;"><!-- ELSE --><span><!-- ENDIF -->{USERNAME}</span>
             <!-- IF U_USER_ADMIN --> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF -->
             <!-- IF U_USER_BAN --> [ <a href="{U_USER_BAN}">{L_USER_BAN}</a> ]<!-- ENDIF -->
             <!-- IF U_SWITCH_PERMISSIONS --> [ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<!-- ENDIF -->
             <br />
                      <!-- IF ENABLE_STATUS_MEMBERLIST and ENABLE_STATUS -->
                         <!-- BEGIN stat -->
                         <b>{stat.STATUS}</b>
                         <!-- END stat -->
                         <!-- ENDIF -->
          </dd>
          <!-- IF not AVATAR_IMG -->
             <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt> <dd>{RANK_TITLE}</dd><!-- ENDIF -->
             <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF -->
          <!-- ENDIF -->
          <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}:</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF -->
          <!-- IF LOCATION --><dt>{L_LOCATION}:</dt> <dd>{LOCATION}</dd><!-- ENDIF -->
          <!-- IF AGE --><dt>{L_AGE}:</dt> <dd>{AGE}</dd><!-- ENDIF -->
          <!-- IF OCCUPATION --><dt>{L_OCCUPATION}:</dt> <dd>{OCCUPATION}</dd><!-- ENDIF -->
          <!-- IF INTERESTS --><dt>{L_INTERESTS}:</dt> <dd>{INTERESTS}</dd><!-- ENDIF -->
          <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
          <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
          <!-- IF USER_MOOD --><dt>{L_MOOD}:</dt> <dd>{USER_MOOD}</dd><!-- ENDIF -->
          <!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
             <!-- IF U_REMOVE_FRIEND -->
                <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
             <!-- ELSEIF U_REMOVE_FOE -->
                <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
             <!-- ELSE -->
                <!-- IF U_ADD_FRIEND -->
                   <dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
                <!-- ENDIF -->
                <!-- IF U_ADD_FOE -->
                   <dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
                <!-- ENDIF -->
             <!-- ENDIF -->
          <!-- ENDIF -->
       </dl>

       <span class="corners-bottom"><span></span></span></div>
    </div>

    <div class="panel bg2">
       <div class="inner"><span class="corners-top"><span></span></span>
       <div class="column1">

          <h3>{L_CONTACT_USER} {USERNAME}</h3>

          <dl class="details">
          <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}:</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF -->
          <!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}">{U_WWW}</a></dd><!-- ENDIF -->
          <!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF -->
          <!-- IF U_MSN or USER_MSN --><dt>{L_MSNM}:</dt> <dd><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_MSNM_MESSAGE}</a><!-- ELSE -->{USER_MSN}<!-- ENDIF --></dd><!-- ENDIF -->
          <!-- IF U_YIM or USER_YIM --><dt>{L_YIM}:</dt> <dd><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;">{L_SEND_YIM_MESSAGE}</a><!-- ELSE -->{USER_YIM}<!-- ENDIF --></dd><!-- ENDIF -->
          <!-- IF U_AIM or USER_AIM --><dt>{L_AIM}:</dt> <dd><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_AIM_MESSAGE}</a><!-- ELSE -->{USER_AIM}<!-- ENDIF --></dd><!-- ENDIF -->
          <!-- IF U_ICQ or USER_ICQ --><dt>{L_ICQ}:</dt> <dd><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_ICQ_MESSAGE}</a><!-- ELSE -->{USER_ICQ}<!-- ENDIF --></dd><!-- ENDIF -->
          <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
          <!-- IF S_PROFILE_FIELD1 -->
             <!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
             <dt>{postrow.PROFILE_FIELD1_NAME}:</dt> <dd>{postrow.PROFILE_FIELD1_VALUE}</dd>
          <!-- ENDIF -->
          </dl>
       </div>

       <div class="column2">
          <h3>{L_USER_FORUM}</h3>
          <dl class="details">
             <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
             <dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
             <!-- IF POSTER_INVITE_INVITER and S_P_DISPLAY_INVITER --><dt>{L_DISPLAY_INVITER}:</dt> <dd>{POSTER_INVITE_INVITER}</dd><!-- ENDIF -->
             <!-- IF S_WARNINGS -->
             <dt>{L_WARNINGS}: </dt>
             <dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd>
             <!-- ENDIF -->
             <dt>{L_TOTAL_POSTS}:</dt>
                <dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF -->
                   <!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF -->
                   <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />(<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --><br />({L_POSTS_IN_QUEUE})<!-- ENDIF -->
                </dd>
             <!-- IF S_SHOW_ACTIVITY and POSTS -->
                <dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><!-- IF ACTIVE_FORUM --><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
                <dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><!-- IF ACTIVE_TOPIC --><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
             <!-- ENDIF -->
                      <!-- IF S_HAS_HIGHSCORES --><dt>{L_ARCADE_HIGHSCORES}:</dt> <dd>{TOTAL_HIGHSCORES} | <strong><a href="{U_ARCADE_STATS}">{L_ARCADE_VIEW_USERS_STATS}</a></strong></dd><!-- ENDIF -->
             <!-- IF S_PROFILE_VIEWS and PROFILE_VIEWS -->
             <dt>{L_PROFILE_VIEWS}:</dt><dd>{PROFILE_VIEWS}</dd>
             <dt><a href="{S_PROFILE_VIEW_ACTION}">{L_PROFILE_VIEWS_LIST}</a>:</dt><dd>
             
             <table><tr align="center">
             <!-- BEGIN profile_views -->
             <td><table><tr align="center" ><td>{profile_views.AVATAR}</td></tr><tr align="center" valign="bottom"><td><b>{profile_views.PROFILE_VIEWS_LIST}</b></td></tr></table></td>
             <!-- END profile_views -->
             </tr></table>
             </dd>
             <!-- ENDIF -->
             <!-- IF S_P_DISPLAY_INVITE -->
                <dt>{L_DISPLAY_INVITE}:</dt> <dd>{POSTER_INVITE_INVITE} <!-- IF U_USER_ADMIN --> [ <a href="{U_USER_ADMIN_INVITATIONS}">{L_USER_ADMIN_INVITATIONS}</a> ]<!-- ENDIF -->
                <!-- IF INVITATIONS_PCT --><br />({INVITATIONS_PCT} / {INVITATIONS_DAY})<!-- ENDIF --></dd>
             <!-- ENDIF -->
             <!-- IF S_P_DISPLAY_REGISTER -->
                <dt>{L_DISPLAY_REGISTER}:</dt> <dd>{POSTER_INVITE_REGISTER} <!-- IF S_DISPLAY_REGISTRATION_SEARCH -->| <strong><a href="{U_SEARCH_REGISTRATIONS}">{L_SEARCH_USER_REGISTRATIONS}</a></strong><!-- ENDIF -->
                <!-- IF U_USER_ADMIN --><!-- IF S_DISPLAY_REGISTRATION_SEARCH --><br /><!-- ENDIF -->[ <a href="{U_USER_ADMIN_REGISTRATIONS}">{L_USER_ADMIN_REGISTRATIONS}</a> ]<!-- ENDIF -->
                <!-- IF REGISTRATIONS_PCT --><br />({REGISTRATIONS_PCT} / {REGISTRATIONS_DAY} / {REGISTRATIONS_SUCCESS_RATE})<!-- ENDIF --></dd>
             <!-- ENDIF -->
          </dl>
       </div>
       <span class="corners-bottom"><span></span></span></div>
    </div>
    <div class="panel bg1">
       <div class="inner"><span class="corners-top"><span></span></span>
          <h3>{L_FRIEND_LIST}&nbsp;(<a href="{U_VIEW_ALL}">{L_VIEW_ALL}</a>)</h3>
          <!-- BEGIN fri -->
          <a class="thumbnail" href="{fri.AV_LINK}" style="text-decoration:none">
       <span>

          <!-- IF fri.USER_COLOR --><b style="color:#{fri.USER_COLOR}"> <!-- ELSE --><b style="color:#000;"><!-- ENDIF -->{fri.USERNAME}</b>                  <!-- IF fri.ONLINE_USER -->(<strong>{L_ONLINE}</strong>)<!-- ENDIF -->
    <br /><!-- IF fri.FRI_AV -->{fri.FRI_AV}</span>{fri.FRI_AV_THUMB} <!-- ELSE --> <img src="{ROOT_PATH}images/no_avatar.gif" alt="noavatar" />

          </span><img src="images/no_avatar.gif" alt="noavatar"  width="{fri.WIDTH}" /><!-- ENDIF -->

          </a>
          <!-- END fri -->
    <ul class="linklist">
           <li class="rightside pagination">{TOTAL_FRIENDS} &bull; <!-- IF FRINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER_F}</a> &bull; <span>{FRINATION}</span><!-- ELSE -->{PAGE_NUMBER_F}<!-- ENDIF --></li>
       </ul>
       
       <span class="corners-bottom"><span></span></span></div>
          </div>
    <!-- IF SIGNATURE -->
    <div class="panel bg1">
       <div class="inner"><span class="corners-top"><span></span></span>

          <h3>{L_SIGNATURE}</h3>

          <div class="postbody"><div class="signature" style="border-top:none; margin-top: 0;">{SIGNATURE}</div></div>

       <span class="corners-bottom"><span></span></span></div>
    </div>
    <!-- ENDIF -->
    <script type="text/JavaScript">
    function getElement(iElementId)
    {
       if (document.all)
       {
          return document.all[iElementId];
       }
       if (document.getElementById)
       {
          return document.getElementById(iElementId);
       }
    }

    function toggleElement(oElement)
    {
       if (oElement.style.display == "none")
       {
          oElement.style.display = "";
       }
       else
       {
          oElement.style.display = "none";
       }
    }
    </script>

    <div class="panel bg1">
       <div class="inner"><span class="corners-top"><span></span></span>
       <h3>{L_GRATITUDES}</h3>
          <dl>
             <dd><strong>{L_GIVEN}:</strong> {POSTER_GIVE_COUNT} {L_THANKS}</dd>
             <!-- IF POSTER_GIVE_COUNT and THANKS_PROFILELIST_VIEW -->
                <a href="javascript: toggleElement( getElement('show_thanks'));">{L_THANKS_LIST}</a>
                <div id="show_thanks" style="display: none;">{THANKS}</div>
             <!-- ENDIF -->
             <br />
             <dd><strong>{L_RECEIVED}:</strong> {POSTER_RECEIVE_COUNT} {L_THANKS}</dd>
             <!-- IF POSTER_RECEIVE_COUNT and THANKS_PROFILELIST_VIEW -->
                <a href="javascript: toggleElement( getElement('show_thanked'));">{L_THANKS_LIST}</a>
                <div id="show_thanked" style="display: none;">{THANKED}</div>
             <!-- ENDIF -->
          </dl>   
       <span class="corners-bottom"><span></span></span></div>
    </div>
    </form>

    <!-- INCLUDE jumpbox.html -->

    <!-- INCLUDE overall_footer.ht

Re: Profile friend list

Posted: Sun Apr 25, 2010 11:40 pm
by sleevedbiker
no my program found 2 copies of the code you posted, i am testing now.

Re: Profile friend list

Posted: Tue Apr 27, 2010 1:07 pm
by LexusAutosports
Has anyone got this mod to work with phpBB 3.0.7-PL1? I installed it but the friendslist shows up blank with just a black bullet point all the way to the right. There are no error when adding or deleting a friend. It would be great if we could get this to work for the newest version of phpBB. I had this working on my 3.0.6 version and it was a great mod. I appreciate any help I could get.

Thanks

Re: Profile friend list

Posted: Wed Apr 28, 2010 10:52 pm
by qTRUq
I also want to know if this will work for the latest version of phpBB 3.0.7-PL1

Re: Profile friend list

Posted: Thu Apr 29, 2010 12:30 am
by keith10456
qTRUq wrote:I also want to know if this will work for the latest version of phpBB 3.0.7-PL1
Yes... :)

Re: Profile friend list

Posted: Thu Apr 29, 2010 6:02 pm
by LexusAutosports
LexusAutosports wrote:Has anyone got this mod to work with phpBB 3.0.7-PL1? I installed it but the friendslist shows up blank with just a black bullet point all the way to the right. There are no error when adding or deleting a friend. It would be great if we could get this to work for the newest version of phpBB. I had this working on my 3.0.6 version and it was a great mod. I appreciate any help I could get.

Thanks
Any ideas why mine is not working? There was also another post or two on this thread of the same problem having to someone using phpBB 3.0.7-PL1

Thanks

Re: Profile friend list

Posted: Thu Apr 29, 2010 7:38 pm
by LexusAutosports
I narrowed it down to that it's my memberlist.php that is giving me the problem. When I search for the following code in phpBB 3.0.7-PL1 in the memberlist.php file it can't find it.

Code: Select all

	$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
		}
		$db->sql_freeresult($result);

So I found this instead which I thought was the same:

Code: Select all

	$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
		}
		$db->sql_freeresult($result);

So I put the code after the above code:

Code: Select all

// friend list mod by ian-taylor.ca


	$user_id = request_var('u', 0);
	$start   = request_var('start', 0);
	$limit = request_var('limit', intval($config['number_friends']));
	$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.user_avatar, u.username, u.user_colour, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, z.user_id, u.user_regdate, u.user_lastvisit, user_posts, z.zebra_id, z.friend',
	'FROM'		=> array(
		USERS_TABLE		=> 'u',
	),
	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'u.user_id=z.zebra_id'		
		)
	),
		'WHERE'		=> " u.user_id=z.zebra_id AND z.friend = 1 AND z.user_id = $user_id",
		'ORDER_BY'	=> 'z.zebra_id'
	));
	$result = $db->sql_query_limit($sql, $limit, $start);
         
	while($row_av = $db->sql_fetchrow( $result )) 
	{
		$avatar_friend = get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], $row_av['user_avatar_width'], 		$row_av['user_avatar_height']);
		$friend_id = $row_av['zebra_id'];
		$avatar_size_size = $config['friend_avatar_size'];

		$template->assign_block_vars('fri',array(

      		'FRI_ID'   			=> $row_av['zebra_id'],
      		'FRI_AV'   			=> $avatar_friend,
      		'USERNAME'   		=> $row_av['username'],
      		'WIDTH'				=> $config['friend_avatar_size'],
         	'USER_COLOR' 		=> $row_av['user_colour'],
      		'AV_LINK'   		=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$friend_id"),  
      		'FRI_AV_THUMB'   	=>   ($row_av['user_avatar']) ? get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], ($row_av['user_avatar_width'] > $row_av['user_avatar_height']) ? $avatar_size_size : ($avatar_size_size / $row_av['user_avatar_height']) * $row_av['user_avatar_width'], ($row_av['user_avatar_height'] > $row_av['user_avatar_width']) ? $avatar_size_size : ($avatar_size_size / $row_av['user_avatar_width']) * $row_av['user_avatar_height']) : '',
      		'ONLINE_USER'		=> is_user_online($row_av['zebra_id'])
));
}

    
// count some stuff up for the pagination
$profile = request_var('u', 0);
$sql = 'SELECT COUNT(zebra_id) AS number_friends FROM '. ZEBRA_TABLE ." WHERE user_id=$profile AND friend = 1";
$result = $db->sql_query($sql);
$pagination_friend = append_sid($phpbb_root_path . 'memberlist.' . $phpEx ,'mode=viewprofile&u='.$user_id);

	$total_friends = $db->sql_fetchfield('number_friends');
	$db->sql_freeresult($result);

	$template->assign_vars(array(
    	'FRINATION'        => generate_pagination($pagination_friend, $total_friends, $limit, $start),
    	'PAGE_NUMBER_F'       => on_page($total_friends, $limit, $start),
    	'TOTAL_FRIENDS'       => ($total_friends == 1) ? $user->lang['LIST_FRIEND'] : sprintf($user->lang['LIST_FRIENDS'], $total_friends),
    	'U_VIEW_ALL' 		=> append_sid("{$phpbb_root_path}friend_list.$phpEx", "u=$user_id"),


	));

// end friend list mod by ian-taylor.ca

That didn't work so I'm thinking I didn't put the above code in the right place.

Can anyone help?

Thanks

Re: Profile friend list

Posted: Thu Apr 29, 2010 7:50 pm
by LexusAutosports
I finally fixed the problem for display the friends list in phpBB 3.0.7-PL1

To make this mod work, instead of looking for the following line in the memberlist.php

Code: Select all

	$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
		}
		$db->sql_freeresult($result);

Look for the following line instead:

Code: Select all

$group_options = '';
		while ($row = $db->sql_fetchrow($result))
		{
			$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
		}
		$db->sql_freeresult($result);

Then place the following code right below the above lines of code found:

Code: Select all

// friend list mod by ian-taylor.ca


	$user_id = request_var('u', 0);
	$start   = request_var('start', 0);
	$limit = request_var('limit', intval($config['number_friends']));
	$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.user_avatar, u.username, u.user_colour, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, z.user_id, u.user_regdate, u.user_lastvisit, user_posts, z.zebra_id, z.friend',
	'FROM'		=> array(
		USERS_TABLE		=> 'u',
	),
	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'u.user_id=z.zebra_id'		
		)
	),
		'WHERE'		=> " u.user_id=z.zebra_id AND z.friend = 1 AND z.user_id = $user_id",
		'ORDER_BY'	=> 'z.zebra_id'
	));
	$result = $db->sql_query_limit($sql, $limit, $start);
         
	while($row_av = $db->sql_fetchrow( $result )) 
	{
		$avatar_friend = get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], $row_av['user_avatar_width'], 		$row_av['user_avatar_height']);
		$friend_id = $row_av['zebra_id'];
		$avatar_size_size = $config['friend_avatar_size'];

		$template->assign_block_vars('fri',array(

      		'FRI_ID'   			=> $row_av['zebra_id'],
      		'FRI_AV'   			=> $avatar_friend,
      		'USERNAME'   		=> $row_av['username'],
      		'WIDTH'				=> $config['friend_avatar_size'],
         	'USER_COLOR' 		=> $row_av['user_colour'],
      		'AV_LINK'   		=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$friend_id"),  
      		'FRI_AV_THUMB'   	=>   ($row_av['user_avatar']) ? get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], ($row_av['user_avatar_width'] > $row_av['user_avatar_height']) ? $avatar_size_size : ($avatar_size_size / $row_av['user_avatar_height']) * $row_av['user_avatar_width'], ($row_av['user_avatar_height'] > $row_av['user_avatar_width']) ? $avatar_size_size : ($avatar_size_size / $row_av['user_avatar_width']) * $row_av['user_avatar_height']) : '',
      		'ONLINE_USER'		=> is_user_online($row_av['zebra_id'])
));
}

    
// count some stuff up for the pagination
$profile = request_var('u', 0);
$sql = 'SELECT COUNT(zebra_id) AS number_friends FROM '. ZEBRA_TABLE ." WHERE user_id=$profile AND friend = 1";
$result = $db->sql_query($sql);
$pagination_friend = append_sid($phpbb_root_path . 'memberlist.' . $phpEx ,'mode=viewprofile&u='.$user_id);

	$total_friends = $db->sql_fetchfield('number_friends');
	$db->sql_freeresult($result);

	$template->assign_vars(array(
    	'FRINATION'        => generate_pagination($pagination_friend, $total_friends, $limit, $start),
    	'PAGE_NUMBER_F'       => on_page($total_friends, $limit, $start),
    	'TOTAL_FRIENDS'       => ($total_friends == 1) ? $user->lang['LIST_FRIEND'] : sprintf($user->lang['LIST_FRIENDS'], $total_friends),
    	'U_VIEW_ALL' 		=> append_sid("{$phpbb_root_path}friend_list.$phpEx", "u=$user_id"),


	));

// end friend list mod by ian-taylor.ca

This solves the problem of just the black dot (bullet) appearing all the way to the right no matter if you have friends or not.

Hope this helps.

Re: Profile friend list

Posted: Fri May 07, 2010 2:05 am
by Bash
Any screenshots?

Re: Profile friend list

Posted: Fri Jul 11, 2014 11:16 am
by Marc
MOD Updated to version 1.3.0
See first post for Download Link