Page 1 of 1

Username link to profile mod/Extend rank color

Posted: Sun Sep 23, 2007 4:14 pm
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.

Re: Username link to profile mod/Extend rank color

Posted: Wed Oct 03, 2007 11:18 pm
by DavidIQ
Wow...hadn't seen this. I need to visit here more often :lol:

Still need any help with this?

Re: Username link to profile mod/Extend rank color

Posted: Thu Oct 04, 2007 1:49 am
by Coroner
I sure do. I keep fooling around with it but no success so far :(

Re: Username link to profile mod/Extend rank color

Posted: Fri Oct 26, 2007 1:14 am
by Coroner
Hey David! Have you had a chance to look this one over?

Please let me know.

Thanks!

Re: Username link to profile mod/Extend rank color

Posted: Wed Nov 21, 2007 10:17 pm
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....

Re: Username link to profile mod/Extend rank color

Posted: Mon Nov 26, 2007 9:43 pm
by DavidIQ
Ok...so where are you trying to get the usernames to show in color? Everywhere?

Re: Username link to profile mod/Extend rank color

Posted: Mon Nov 26, 2007 10:11 pm
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 ]--------------------------------
#

Re: Username link to profile mod/Extend rank color

Posted: Thu Dec 13, 2007 1:59 pm
by Coroner
Didn't work. I get a blank page?