Username link to profile mod/Extend rank color

I will no longer provide phpBB2 support due to phpBB2's EOL announcement. If you need help with phpBB2 you can try phpBB2 Refugees.
Locked
Coroner
Posts: 30
Joined: Wed Jan 31, 2007 9:20 pm

Username link to profile mod/Extend rank color

Post by Coroner »

Hey David, I'm back at it again and really need some help on this one.

I installed Username_link_to_profile1.0.0 which creates a link to the users profile from the the view topic page. It also adds color ranks for admins and moderators. What I've been trying to do it get it to hook with Extend_rank_color mod so each persons name show in color to match their ranks. I was only able to get all members colors to match admin while moderators remained green (default template color).

I have attached both mods for you to look at.

Please let me know.

Thank you once again for all your efforts and support.
Attachments
Username_link_to_profile1.0.0.zip
(1.48 KiB) Downloaded 742 times
Extend_rank_color.zip
(41.04 KiB) Downloaded 749 times
Image
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Username link to profile mod/Extend rank color

Post by DavidIQ »

Wow...hadn't seen this. I need to visit here more often :lol:

Still need any help with this?
Coroner
Posts: 30
Joined: Wed Jan 31, 2007 9:20 pm

Re: Username link to profile mod/Extend rank color

Post by Coroner »

I sure do. I keep fooling around with it but no success so far :(
Image
Coroner
Posts: 30
Joined: Wed Jan 31, 2007 9:20 pm

Re: Username link to profile mod/Extend rank color

Post by Coroner »

Hey David! Have you had a chance to look this one over?

Please let me know.

Thanks!
Image
Coroner
Posts: 30
Joined: Wed Jan 31, 2007 9:20 pm

Re: Username link to profile mod/Extend rank color

Post by Coroner »

DavidIQ wrote:Wow...hadn't seen this. I need to visit here more often :lol:

Still need any help with this?
Your help with this would be greatly appreciated....
Image
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Username link to profile mod/Extend rank color

Post by DavidIQ »

Ok...so where are you trying to get the usernames to show in color? Everywhere?
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Username link to profile mod/Extend rank color

Post by DavidIQ »

Nevermind...I think I know what you're trying to do. Try the following. Open up viewtopic.php and do the following:

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_level, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, u.user_level

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, u.user_whosonline_color

#
#-----[ FIND ]------------------------------------------------
#
    $template->assign_block_vars('postrow', array(

#
#-----[ BEFORE, ADD ]-----------------------------------------
#
	$ranks_sql= " SELECT * from " . WHOSONLINE_RANKS_TABLE . " ORDER BY whosonline_rank_order";

		if ( !($ranks_result = $db->sql_query($ranks_sql)) )
		{
			message_die(GENERAL_MESSAGE, 'Fatal Error into getting user color');
		}

		while( $rank_row = $db->sql_fetchrow($ranks_result) )
		{

			$id_color[ $rank_row['whosonline_rank_id'] ] = $rank_row['whosonline_rank_color'];
		}

	if ( $board_config['allow_group_index'] )
	{

		$group_user_sql= "SELECT ug.group_id, ug.user_id, g.group_color from " . USER_GROUP_TABLE . " ug," . GROUPS_TABLE . " g, " . WHOSONLINE_RANKS_TABLE . " wr
			WHERE  ug.group_id=g.group_id
				AND g.group_color <> '0' 
				AND ug.user_pending <> '1'
				AND wr.whosonline_rank_id = g.group_color
			ORDER BY wr.whosonline_rank_order DESC";
			if ( !($group_user_result = $db->sql_query($group_user_sql)) )
			{
				message_die(GENERAL_MESSAGE, 'Fatal Error into getting user in group');
			}

			while( $group_user_row = $db->sql_fetchrow($group_user_result) )
			{
				$user_group_color[ $group_user_row['user_id'] ] = $id_color[ $group_user_row['group_color'] ];
			}
	}

    if ( $postrow[$i]['user_whosonline_color'] )
    {
      $poster_color = ' style="color: #' . $id_color[$postrow[$i]['user_whosonline_color']] . '"';
    }
    else if ( $postrow[$i]['user_level'] == ADMIN )
    {
      $poster_color = ' style="color: #' . $theme['fontcolor3'] . '"';
    }
    else if ( $postrow[$i]['user_level'] == MOD )
    {
      $poster_color = ' style="color: #' . $theme['fontcolor2'] . '"';
    }
    else if ( $user_group_color[$postrow[$i]['user_id']])
    {
      $poster_color = ' style="color: #' . $user_group_color[ $postrow[$i]['user_id'] . '"';
    }
    else
    {
      $poster_color = '';
    }

#
#-----[ FIND ]------------------------------------------------
#
	'POSTER_NAME' => $poster,

#
#-----[ REPLACE WITH ]----------------------------------------
#
	'POSTER_NAME' => ( $postrow[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $poster_id) . '" class="name"' . $poster_color . '>' . $poster . '</a>' : $poster,

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
Coroner
Posts: 30
Joined: Wed Jan 31, 2007 9:20 pm

Re: Username link to profile mod/Extend rank color

Post by Coroner »

Didn't work. I get a blank page?
Image
Locked