Profile Friend List 2.0.1 (my Own Costumization)

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
djrikyx
Registered User
Posts: 17
Joined: Tue Dec 16, 2008 8:49 pm

Profile Friend List 2.0.1 (my Own Costumization)

Post by djrikyx »

This Mod not is a Official part of 'Profile Friend List' by platinum_2007
It's only a my Own Costumisation.

Profile Friend List Version 2.0.1

New Feature: Username Display, Age Display (if filled), Background Color Based on Gender.
Notes: This version NOT is compatible with Gender Mod. There is a Custom Profile Field for gender.
Tip: Install Birthday on Registration for make a Required Field the Birthday at registration :)
Preview: http://www.djrikyx.it/profile_friend_list_2.0.1.png

Download Update: Update from 1.0.3

Download Full Installation: Install 2.0.1

Please report bug or problem with this version of Mod


_______________________________________________________________________________________

Profile Friend List Version 2.0.1a

Notes: This version It's ONLY for users who have Gender Mod Installed.

Download Update: Update from 1.0.3

Download Full Installation: Install 2.0.1a

Please report bug or problem with this version of Mod

Backup ALL Files Before Install.
Sorry for my bad english, I'm Italian
superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: Profile Friend List 2.0.1 (my Own Costumization)

Post by superj707 »

the memberlist_view.html I think ws designed in IE 7 because it looks perfect in IE 7 but it doesn't look right in FF .. THIS IS A MOD TO djrikyx's MOD of IANS MOD..

Essentially this is a mod of a mod. (D'oh)


here are some small fixes to make it look GREAT

memberlist.php

find:

Code: Select all

if($fri_age == 0-0-0)
				{
replace with

Code: Select all

if (!ereg('^[[:digit:]]{2}$',$fri_age)) {
find:

Code: Select all

'USERNAME'   => $row_av['username'],
replace with

Code: Select all

'USERNAME'   => str_replace(' ','',$row_av['username']),



use this as your memberlist_view.html entry

Code: Select all

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

		<h3>{L_FRIEND_LIST}</h3>
		<!-- BEGIN fri -->
<div title="{fri.USERNAME} | {fri.FRI_GENDER} | {fri.FRI_AGE} {fri.FRI_YEARS}" onmouseover="this.style.cursor='pointer';" onclick="location.href='{fri.AV_LINK}';"  class="friend-box">
<div class="friend-bg" style="background:url({T_THEME_PATH}/images/friend_{fri.FRI_GENDER}.png) no-repeat;">
<div class="friend-avatar">{fri.FRI_AV_THUMB}</div>

<div class="friend-username"><b style="color:#000;">{fri.USERNAME}</b></div>
<div class="friend-age"><font color="#000">{fri.FRI_AGE}</font></div>
<div class="friend-clearer"></div>
</div>

</div>
<!-- END fri -->
<div class="friend-clearer"></div>
<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>

These changes fix a lot of potential problems that may or may not be causing problems in your case. It's a good idea to add these the above changes because it will prevent the mod from having it's layout broken.
that does it. Firefox and all other modern browser approved.
Last edited by superj707 on Sun Aug 02, 2009 12:33 am, edited 1 time in total.
superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: Profile Friend List 2.0.1 (my Own Costumization)

Post by superj707 »

thank you so much for taking this mod to the next level.
I really appreciate all you are doing for this wonderful mod.

I would really like to see this mod expanded to add the feature of allowing users to organize their friend list , or at the least their top list. AS is I have over 100 friends and the friend list has become useless for finding anyone because there is no tools for sorting or organization.

perhaps a link to a "view all" page with "sort by ..." options on the view all page would be helpful. And a user defined top list.

What do you think >?
superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: Profile Friend List 2.0.1 (my Own Costumization)

Post by superj707 »

ian's new friend list customizations are not compatible with your updates yet. a new version would be awesome.


I made the ian's new mod work with your version. I did the work, I hope it helps you. Here is the update to the memberlist.php for the version using the gender mod. Works for me.

Code: Select all

		 
// friend list mod by ian-taylor.ca
function is_user_online($id)
{
		global $db, $config;
		
        $session_sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline
            FROM ' . SESSIONS_TABLE . "
            WHERE session_user_id = $id";
        $session_result = $db->sql_query($session_sql);
        $session_row = $db->sql_fetchrow($session_result);

        $member['session_time'] = (isset($session_row['session_time'])) ? $session_row['session_time'] : 0;
        $member['session_viewonline'] = (isset($session_row['session_viewonline'])) ? $session_row['session_viewonline'] :    0;

        $update_time = $config['load_online_time'] * 60;
        $online = (time() - $update_time < $member['session_time'] && ((isset($member['session_viewonline']) && $member['session_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
        
        return $online;

}



	$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_regdate, u.user_lastvisit, user_posts, z.zebra_id,  u.user_avatar, u.user_birthday, u.username, u.user_colour, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_gender, z.user_id, 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_fri = get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], $row_av['user_avatar_width'], 		$row_av['user_avatar_height']);
		$fri_id = $row_av['zebra_id'];
		$av_size_size = $config['friend_avatar_size'];
		$fri_age = $row_av['user_birthday'];
		$fri_gender = $row_av['user_gender'];
			if ($fri_age)
			{
				list($bday_day1, $bday_month1, $bday_year1) = array_map('intval', explode('-', $fri_age));

				if ($bday_year1)
				{
					$now1 = getdate(time() + $user->timezone + $user->dst - date('Z'));

					$diff1 = $now1['mon'] - $bday_month1;
					if ($diff1 == 0)
					{
						$diff1 = ($now1['mday'] - $bday_day1 < 0) ? 1 : 0;
					}
					else
					{
						$diff1 = ($diff1 < 0) ? 1 : 0;
					}

					$fri_age = (int) ($now1['year'] - $bday_year1 - $diff1);
				}
				if (!ereg('^[[:digit:]]{2}$',$fri_age)) {
				$fri_age = '--';
				}
			}
				if($fri_gender == 1){
				$fri_cgender = 'Male';
				}else if($fri_gender == 2){
				$fri_cgender = 'Female';
				}else if($fri_gender == 0){
				$fri_cgender = 'Undefined';
				}
if(!$row_av['user_avatar'])
      {
      $avatar = '<img src="images/avatars/no_avatar.gif" width="'.$av_size_size.'" />';
      
      }
      else
      $avatar =  ($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']) ? $av_size_size : ($av_size_size / $row_av['user_avatar_height']) * $row_av['user_avatar_width'], ($row_av['user_avatar_height'] > $row_av['user_avatar_width']) ? $av_size_size : ($av_size_size / $row_av['user_avatar_width']) * $row_av['user_avatar_height']) : '';


		$template->assign_block_vars('fri',array(
			'FRI_GENDER'	=> $fri_cgender,
			'FRI_AGE'	=> $fri_age,
			'FRI_YEARS'	=> $user->lang['FRI_YEARS'],
      		'FRI_ID'   => $row_av['zebra_id'],
      		'FRI_AV'   => $avatar_fri,
			
      		'USERNAME'   => str_replace("-", "",str_replace(' ','',$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=$fri_id"),      
      		'FRI_AV_THUMB'   =>   $avatar,
			'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
vortexhlp
Registered User
Posts: 195
Joined: Fri Jan 09, 2009 7:51 pm

Re: Profile Friend List 2.0.1 (my Own Costumization)

Post by vortexhlp »

The url is long gone, could somebody please upload the file to megaupload or something please? I'm pulling my hair in frustration trying to get the friends mod to display on the index.php page (well on all pages that is). gah! ;__;
Locked

Return to “[3.0.x] MOD Writers Discussion”