[RC] Special and Normal Rank Images 1.1.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
User avatar
MasterZ
Registered User
Posts: 712
Joined: Wed Sep 24, 2003 5:33 am

Re: [RC] Special and Normal Rank Images 1.1.0

Post by MasterZ »

JC4912 wrote:At the moment i've got it so the post rank is displayed, i've looked for quite a while to turn the special rank on also but only 1 is displaying not both.
Assign a Special Rank to a group (the administrators group).
Make the user a member of that group
Set that group as the default group for that user
Done :)
JC4912
Registered User
Posts: 43
Joined: Wed Feb 03, 2010 10:45 pm

Re: [RC] Special and Normal Rank Images 1.1.0

Post by JC4912 »

I've done exactly that but nothing happened, so i'll try to to re-install the modification :)
User avatar
MasterZ
Registered User
Posts: 712
Joined: Wed Sep 24, 2003 5:33 am

Re: [RC] Special and Normal Rank Images 1.1.0

Post by MasterZ »

Use AutoMOD to install it. Also, did you install it on whatever themes you are using if not the default?
JC4912
Registered User
Posts: 43
Joined: Wed Feb 03, 2010 10:45 pm

Re: [RC] Special and Normal Rank Images 1.1.0

Post by JC4912 »

MasterZ wrote:Use AutoMOD to install it. Also, did you install it on whatever themes you are using if not the default?
I'm using AutoMOD, I go under Special and Normal Rank Images click 'Details' go to the bottom

Apply these changes subsilver2 to this template 1Game

And it says successfull, I go to styles and refresh template & imageset I then go to general and purge cache.

Users / Groups -> Manage Ranks -> Administrator with image & set to special rank, go to Manage Groups Administrator -> Settings, Group Rank -> Administrator

Go back, click Members, 'Mark All' -> Make group default for all member.

That's what i've done but nothing at all happens just the Administrator rank shows up, no post rank.
User avatar
MasterZ
Registered User
Posts: 712
Joined: Wed Sep 24, 2003 5:33 am

Re: [RC] Special and Normal Rank Images 1.1.0

Post by MasterZ »

Switch your template to Prosilver and subsilver2 to see if the MOD is working. If you see both images there, then you just need to make sure all of the template edits are in the style you are using, if they are then it's a caching issue.

If you want me to help you out I can do that. Just let me know. I'll be AFK for the next 20 minutes or so but after that I will be available to help out. Just send me a PM if you want.
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: [RC] Special and Normal Rank Images 1.1.0

Post by IBBoard »

MasterZ: Thanks for helping out. The MOD you linked to is actually a different but related MOD. v1.0 of this MOD is already released, but not v1.2.

JC: Have you refreshed the template cache? The default behaviour (IIRC) is for the special rank to show up as the "extra" rank (i.e. the one that the new template code is added for). That would explain the behaviour you're seeing.

I think the MOD is ready for release (Anyasha has installed it and not said anything, but has found bugs and missing instructions in the Multi-Race Rank Themes MOD), but if people can confirm then I'll get it in the validation queue.
User avatar
_RocknRoll
Registered User
Posts: 237
Joined: Sat Aug 01, 2009 5:50 am

Re: [RC] Special and Normal Rank Images 1.1.0

Post by _RocknRoll »

With [RC] v1.1.0 installed, I'm getting this when a PM is submitted.

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/ucp/ucp_pm_viewmessage.php  on line 322: Undefined index: rank_img_src
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4199: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4201: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4202: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4203: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
If I remove the related edit for "line 322" in the "ucp_pm_viewmessage.php" all is good.

Code: Select all

	$user_row['extra_rank_title'] = $user_row['extra_rank_img'] = $user_row['extra_rank_img_src'] = '';

	if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
	{
		$user_row['extra_rank_title'] = $user_row['rank_title'];
		$user_row['extra_rank_img'] = $user_row['rank_image'];
		$user_row['extra_rank_img_src'] = $user_row['rank_img_src'];
		$user_row['rank_title'] = $user_row['rank_img'] = $user_row['rank_img_src'] = '';

		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
	}
	else
	{
		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['extra_rank_title'], $user_row['extra_rank_img'], $user_row['extra_rank_img_src']);
	}
phpBB: 3.0.6
Style: ClanzDarkness3 ( Subsilver based )
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: [RC] Special and Normal Rank Images 1.1.0

Post by IBBoard »

What are your lines just before that? The index that it is complaining about is part of the standard phpBB code, so it should exist.

Around line 285 I have:

Code: Select all

	// Some standard values
	$user_row['online'] = false;
	$user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = $user_row['email'] = '';
and then the modified part (including the bit that errors for you) and a bit before it is:

Code: Select all

	$user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';

	get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src'], $user_row['percentage_progress'], $user_row['user_rank_theme']);
	$user_row['extra_rank_title'] = $user_row['extra_rank_img'] = $user_row['extra_rank_img_src'] = '';

	if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
	{
		$user_row['extra_rank_title'] = $user_row['rank_title'];
		$user_row['extra_rank_img'] = $user_row['rank_image'];
		$user_row['extra_rank_img_src'] = $user_row['rank_image_src'];
		$user_row['rank_title'] = $user_row['rank_img'] = $user_row['rank_img_src'] = '';

		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src'], $user_row['percentage_progress'], $user_row['user_rank_theme']);
	}
	else
	{
		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['extra_rank_title'], $user_row['extra_rank_img'], $user_row['extra_rank_img_src'], $user_row['percentage_progress'], $user_row['user_rank_theme']);
	}
User avatar
_RocknRoll
Registered User
Posts: 237
Joined: Sat Aug 01, 2009 5:50 am

Re: [RC] Special and Normal Rank Images 1.1.0

Post by _RocknRoll »

Here is the area you asked for ( mod applied ) ...

Code: Select all

	// Some standard values
	$user_row['online'] = false;
	$user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = $user_row['email'] = '';

	// Generate online information for user
	if ($config['load_onlinetrack'])
	{
		$sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
			FROM ' . SESSIONS_TABLE . "
			WHERE session_user_id = $user_id
			GROUP BY session_user_id";
		$result = $db->sql_query_limit($sql, 1);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		$update_time = $config['load_online_time'] * 60;
		if ($row)
		{
			$user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? true : false;
		}
	}

	if (!function_exists('get_user_avatar'))
	{
		include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
	}

	$user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';

	get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);

	$user_row['extra_rank_title'] = $user_row['extra_rank_img'] = $user_row['extra_rank_img_src'] = '';

	if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
	{
		$user_row['extra_rank_title'] = $user_row['rank_title'];
		$user_row['extra_rank_img'] = $user_row['rank_image'];
		$user_row['extra_rank_img_src'] = $user_row['rank_img_src'];
		$user_row['rank_title'] = $user_row['rank_img'] = $user_row['rank_img_src'] = '';

		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
	}
	else
	{
		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['extra_rank_title'], $user_row['extra_rank_img'], $user_row['extra_rank_img_src']);
	}

	if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email'))
	{
		$user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']);
	}

	return $user_row;
}

?>
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: [RC] Special and Normal Rank Images 1.1.0

Post by IBBoard »

Ah, there is a difference - I'm using "img" and it uses "image". It looks like it always just worked because the index wasn't set anyway. I'll have a new version up in a minute.
User avatar
_RocknRoll
Registered User
Posts: 237
Joined: Sat Aug 01, 2009 5:50 am

Re: [RC] Special and Normal Rank Images 1.1.0

Post by _RocknRoll »

IBBoard wrote:Ah, there is a difference - I'm using "img" and it uses "image". It looks like it always just worked because the index wasn't set anyway. I'll have a new version up in a minute.
I was still getting the same error

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/ucp/ucp_pm_viewmessage.php  on line 322: Undefined index: rank_img_src
You missed one ;)

Code: Select all

	if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
	{
		$user_row['extra_rank_title'] = $user_row['rank_title'];
		$user_row['extra_rank_img'] = $user_row['rank_image'];
		$user_row['extra_rank_img_src'] = $user_row['rank_img_src'];
		$user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = '';
I changed

Code: Select all

$user_row['extra_rank_img_src'] = $user_row['rank_img_src'];
to

Code: Select all

$user_row['extra_rank_img_src'] = $user_row['rank_image_src'];
No more error. :mrgreen:

Thank you, sir.
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: [RC] Special and Normal Rank Images 1.1.0

Post by IBBoard »

*&(^*&^$£@! Stupid abbreviations - I'm sure phpBB uses "img" somewhere. Thanks for catching that - I'll make that one change and submit it to the queue as 1.2.0 at some point soon.
lukasz_m84
Registered User
Posts: 2
Joined: Mon Jun 21, 2010 2:12 pm

Re: [RC] Special and Normal Rank Images 1.1.0

Post by lukasz_m84 »

Hi,
I'm using two styles on my forum: Hestia Blue and prostylize_darkgrey. The second one works fine- I've applied instructions for prosilver styles. But i have a problem with applying this mod in Hestia Blue style. It's based on subsilver2 so i've tried to apply instructions for this style.The problem is that I can't finde these lines in styles/subsilver2/template/viewtopic_body.html:

Code: Select all

<!-- IF postrow.RANK_IMG -->
				<tr>
					<td>{postrow.RANK_IMG}</td>
				</tr>
			<!-- ENDIF -->
The only similar line is

Code: Select all

<!-- IF postrow.RANK_IMG --><div class="postrankimg">{postrow.RANK_IMG}</div><!-- ENDIF -->				
Could you help me with insterting code in proper place?
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: [RC] Special and Normal Rank Images 1.1.0

Post by IBBoard »

Sorry, I don't really support any templates other than the defaults entirely for this reason - each one is different and there are so many that I'd need to match with.

Based on the code that you've found then you appear to be in about the right area. The only difference appears to be that the subsilver template uses tables where as your template uses divs at that point. I'd suggest trying to put the extra rank image within the div, or in its own div with matching styling. If that doesn't work then you'll have to find out what the "postrankimg" class does in the CSS and see if you can create a matching class for the extra rank image.

Regards,

IBBoard
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK

Re: [RC] Special and Normal Rank Images 1.1.0

Post by alecrust »

Any idea when this will be submitted to the Mod Database? It's surely not that complex of a modification?

Return to “[3.0.x] MODs in Development”