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.
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Special and Normal Rank Images

Post by Oyabun1 »

@AylaAsperger
You need to explain more what you are trying to do. What portal system are you using and why do you want to add ranks to the portal blocks?

The files you are looking to edit are to do with personal messages (PM) and not portals.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
AylaAsperger
Registered User
Posts: 67
Joined: Fri Dec 28, 2007 8:35 pm

Re: Special and Normal Rank Images

Post by AylaAsperger »

@Oyabun1: Right now the special and normal rank images works exactly as it should but is only visible in the profiles and topics. In my previous post I expressed the wish to have the special and normal rank images also visible in both PMs and the portal. I am using Board3 Portal 1.0.5 which has two blocks in which the rank image is shown, the user menu block and the random member block. I really hope someone can help me out getting this to work!

Thank you all very much for your time!
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: Special and Normal Rank Images

Post by IBBoard »

Sorry, I've never used any portal MODs and don't provide support for integration with any other MODs (I've not got enough time as it is). It should generally be quite easy, though.

The way the MOD works is to create a wrapper method for rank fetching that gets the "normal" rank for people with special ranks or no rank for people with only a normal rank. The two calls for ranks are normally quite close together, then you just need to assign them to template variables and add the variables to the template file as well. The changes in any one file (e.g. viewtopic.php) should give you an idea of what you need to do, but how you get the data is another matter.
User avatar
AylaAsperger
Registered User
Posts: 67
Joined: Fri Dec 28, 2007 8:35 pm

Re: Special and Normal Rank Images

Post by AylaAsperger »

I've tried to look at the instructions for viewtopic and find out how I can install it in other files, but I cant seem to find any of the matches in the other files and I don't know what to change. I started with the files for pm's because they arent changed by the mod currently. And the PM is a standard function for phpbb.
User avatar
IBBoard
Registered User
Posts: 543
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK

Re: Special and Normal Rank Images

Post by IBBoard »

Basically, anywhere that you find something that looks like:

Code: Select all

get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
then add something like:

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_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']);
	}
to pull in the extra ranks in either the "extra_..." indexes or pull them in to the standard indexes having swapped the standard indexes to the extra indexes.
(code copied and pasted from the PM code)

Then you just need to make sure that your variable names and indexes are correct (it might not be "rank_title" everywhere) and then add them as template variables:

Code: Select all

		'EXTRA_RANK_TITLE'	=> $extra_rank_title,
		'EXTRA_RANK_IMG'	=> $extra_rank_img,
		'EXTRA_RANK_IMG_SRC'=> $extra_rank_img_src,
and use the variables in the template.

Beyond that then I can't really comment as I can't hope to support every combination of addons that display ranks. Hopefully it helps, though.
User avatar
AylaAsperger
Registered User
Posts: 67
Joined: Fri Dec 28, 2007 8:35 pm

Re: Special and Normal Rank Images

Post by AylaAsperger »

Thank you very much! I am going to look at this after dinner and try it out! Your help is much appreciated!
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28942
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier

Re: Special and Normal Rank Images

Post by Paul »

MOD Updated to version 1.2
See first post for Download Link
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28942
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier

Re: Special and Normal Rank Images

Post by Paul »

MOD Updated to version 1.2.2
See first post for Download Link
User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 5724
Joined: Tue Oct 30, 2007 10:57 pm
Location: Munich, Germany
Name: Marc

Re: Special and Normal Rank Images

Post by Marc »

MOD Updated to version 1.2.3
See first post for Download Link

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