Special and Normal Rank Images

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
xalexlx
Registered User
Posts: 20
Joined: Tue Jun 02, 2009 8:17 pm

Re: Special and Normal Rank Images

Post by xalexlx »

will this work in phpbb 3.0.5
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

IBBoard wrote:I can't guarantee that this mod will be compatible with other mods, but I've just had a quick look at the other mod for you.

The other mod doesn't alter the members list, so it sounds like your mod hasn't been applied properly. Either that or there is something else that is affecting the mod and stopping it working properly because it changes the same areas. I don't know what other mods you may have installed, though.

As for the progress bars not showing up, you'll need to make sure that you merge the two sets of template changes correctly. The most obvious cause of what you describe is that the additions from the other mod have been caught within a section of template from this mod that only shows up when someone has an extra rank.
Thank you for taking the time to look into this IBBoard and responding. I will try reinstalling the mod and see if I may have messed something up. I had to deviate slightly from your instructions to accomodate the progress bar mod. Perhaps you’re right and I had inadvertantly nested your changes where I shouldn’t have.
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

IBBoard, I tried running the installation again and I believe the issue I am running into is the way the variables are being treated.

An interesting observation is when I set SHOW_SPECIAL_AS_EXTRA as false, the progress bar appears for regular users without special ranks and the memberlist shows regular ranks and special ranks only, however the progress bar does not show for members with special ranks (although their special rank and normal rank are shown). When I set SHOW_SPECIAL_AS_EXTRA as true, the progress bar appears for members with special ranks but not for regular members - also, the memberlist only shows the regular ranks for members with special ranks while regular members show no ranks at all.

I suspect this has something to do with how the progress bar mod is defining the length of the progress bar in viewtopic.php:

Code: Select all

// Rank progress bar mod [+]
$rank_level = rank_level($user_cache[$poster_id]['posts'], $user_cache[$poster_id]['rank_title']);
	if ( ($rank_level[0] != 0) )
	{
		$rank_level = round(($user_cache[$poster_id]['posts'] - $rank_level[1]) / ($rank_level[0] - $rank_level[1]) * 100);
	}
  else
  {
		$rank_level = 0;
  }
// Rank progress bar mod [-]

// Rank progress bar mod [+]
	'RANK_LEVEL' => $rank_level,
	'RANK_LEVEL_SIZE' => $rank_level * 2,
	'RANK_SHOW_LEVEL' => ($rank_level > 0) ? true : false,
// Rank progress bar mod [-]
... and how your mod is defining additional ranks also in viewtopic.php:

Code: Select all

			if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
			{
				$user_cache[$poster_id]['extra_rank_title'] = $user_cache[$poster_id]['rank_title'];
				$user_cache[$poster_id]['extra_rank_image'] = $user_cache[$poster_id]['rank_image'];
				$user_cache[$poster_id]['extra_rank_image_src'] = $user_cache[$poster_id]['rank_image_src'];
				$user_cache[$poster_id]['rank_title'] = $user_cache[$poster_id]['rank_image'] = $user_cache[$poster_id]['rank_image_src'] = '';
				
				get_user_additional_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
			}
			else
			{
				get_user_additional_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['extra_rank_title'], $user_cache[$poster_id]['extra_rank_image'], $user_cache[$poster_id]['extra_rank_image_src']);
			}
For what it's worth, the code in my viewtopic_body.html is as follows:

Code: Select all

		<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd><br />{postrow.RANK_IMG}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.EXTRA_RANK_TITLE or postrow.EXTRA_RANK_IMG --><dd>{postrow.EXTRA_RANK_IMG}</dd>
		<!-- ENDIF -->
		<!-- IF postrow.RANK_SHOW_LEVEL --><dd style="padding-left:5px; padding-top:2px;"><div style="text-align:left; display:block; height:3px; width:80px; border:1px solid #DACDA5;"><div style="font-size:0; height:3px; width:{postrow.RANK_LEVEL_SIZE}px; background: url('images/progress.jpg') no-repeat;"></div></div></dd><!-- ENDIF -->
Any insight you might have would be greatly appreciated. Thanks!
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

xalexlx: It should do, but I've not tested it yet. The mod has survived several previous versions without needing any obvious changes. Until I get a chance to check it out then the easiest solution is to take a copy of your forum code, start making the changes (since it is only a small mod) and then if you can't find one or more of the lines you're supposed to find just delete your copy and don't install it yet.

youngjediknight: That first behaviour sounds like what I'd expect - my mod shows both and the other mod hits the check for special ranks and says "they have a special rank so assume they can't progress to a next rank".

I'll take a look at the code in a while, but that could well be what breaks it. It may be that you just need to move that other code in to the middle of my code, or it may need tweaks to make the two compatible so that you can see a regular rank and a progress bar for special rank users. The easiest way I can think of to solve that would be to remove the other mod's "do they have a special rank?" check in the "get percentage" button, but I'd have to look at it properly

With regards the members list, I think it was intentional that it only ever showed on rank there, but for people with special ranks the "show special as extra" set to true should show their normal rank.
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

Thanks for looking into this, IBBoard. I think I follow what you are saying. To clarify though, although the progress bar is not registering for members with special ranks (i.e., $rank_level = 0;), the normal rank itself is correct. Put another way, the normal rank shows up correctly, it’s just got an empty progress bar.

I look forward to seeing if we can sort this out. Thanks again.
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

Being a techy/programmer, I'm working on an easier solution for this: Make a new, cleaner, more efficient and more feature-filled version of the "progress bar" mod myself :) I'm hoping to get an initial copy out tonight and it'll have a set of instructions to integrate the two mods.
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

IBBoard wrote:Being a techy/programmer, I'm working on an easier solution for this: Make a new, cleaner, more efficient and more feature-filled version of the "progress bar" mod myself :) I'm hoping to get an initial copy out tonight and it'll have a set of instructions to integrate the two mods.
Hey I know who can beta test it!!!

You’re the man, IBBoard. :D
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

It's now available, is running on my forums and comes with instructions on how to integrate it with this MOD :) It only shows on the viewtopic.php page, but I'm planning to add more. Please drop me a message in the other thread to tell me how it goes.
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

I will be trying it as soon as I get home! Very quick work, IBBoard!
v_lizzy
Registered User
Posts: 57
Joined: Tue May 26, 2009 1:14 pm

Re: Special and Normal Rank Images

Post by v_lizzy »

whoisit wrote: Would like to ask how I can remove the text above the rank?
Hiya,

This is working for me too, except I have this same problem. I am using Subsilver2 though - could you please tell me what I need to change to remove the text above the rank?

Thank you! :D
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

To remove the rank titles in Subsilver2, open viewtopic_body.html in your styles template folder and delete:

Code: Select all

			<!-- IF postrow.RANK_TITLE -->
				<tr>
					<td class="postdetails">{postrow.RANK_TITLE}</td>
				</tr>
			<!-- ENDIF -->
There may be other areas like the member list and private messages where the rank title shows up. The general concept here should follow.

I’ve never actually used Subsilver based themes though but in general, it never hurts to dabble around inside the files – you might find accomplishing certain things are more straightforward than you think.

Although the opposite can be true too haha.
v_lizzy
Registered User
Posts: 57
Joined: Tue May 26, 2009 1:14 pm

Re: Special and Normal Rank Images

Post by v_lizzy »

youngjediknight wrote: I’ve never actually used Subsilver based themes though but in general, it never hurts to dabble around inside the files – you might find accomplishing certain things are more straightforward than you think.

Although the opposite can be true too haha.
Too true for me anyway!! :lol:

Thank you so much for that, I really appreciate it. It looks great now! :D
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

Thanks for supplying that template change, youngjediknight. The code I supply is just an example that people can change however they want. Most of the variables are fairly obviously named, so in general you just need to open the correct template and edit it :)
User avatar
[o0]
Registered User
Posts: 23
Joined: Sat Apr 25, 2009 10:04 am
Location: Germany
Contact:

Re: Special and Normal Rank Images

Post by [o0] »

Hello,

I want something like this mod for my forum, but I'm not sure if it does work like I want. Is something like that (top down besides the post) possible with it?

For normal users:
avatar => Status Mod (already installed) => rank image (this ones, without a rank text)

For users with special rank:
avatar => special rank => Status Mod => rank image (also without a rank text)

Sorry for my bad english, the grammar looks a bit strange, but I hope you understand what I mean =P
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

That sounds like exactly what this MOD does - lets users with "special" ranks have both their normal rank (like the one you linked to) and their "special" rank. The default template changes won't lay it out exactly how you showed, but that's just a case of personalisation of the templates.

There's currently a bug with the members list if you set the "show special as extra" option to true, which I'll try to fix soon in a dev build. Nothing catastrophic, it just ends up only showing ranks for users with special ranks and blanks for other users.
Locked

Return to “[3.0.x] MOD Database Releases”