×
Kunena 5.1.13 Released (21 Jul 2019)

The Kunena team has announce the arrival of Kunena 5.1.13 [K 5.1.13] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1.

× Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Question Colored user by custom ranks. Add else if in kunena.link.class.php

More
8 years 6 months ago - 8 years 6 months ago #1 by kass_damed
Hi all,
I'm french so excuse my poor english :)

Hi know that colored group has been discussed before, but it's hard to find answer.

here is my problem: i'd like to add a css class to a special rank.

So i've add it in : /components/com_kunena/template/mon template/css/kunena.forum-min.css
#Kunena .kwho-admin{color:red!important}
#Kunena .kwho-azur{color:#2bd1ff!important}
#Kunena .kwho-globalmoderator{color:#6cff00!important}
#Kunena .kwho-moderator{color:#6cff00!important}
#Kunena .kwho-user{color:#efd600!important}                 
#Kunena .kwho-guest{color:#ccc!important}
#Kunena .kwho-banned{color:#A39D49!important}
#Kunena .kwho-blocked{color:#2F7D93!important}

Customise /components/com_kunena/template/default/plugin/who/whoisonline.php to show it

And the most diffucult part (i'm not develloper) add an else if in :
/components/com_kunena/lib/kunena.link.class.php
function GetProfileLink($userid,  $name = null, $title ='', $rel = 'nofollow', $class = '') {    
 
    if (!$name) {
			$profile = KunenaFactory::getUser($userid);
			$name = htmlspecialchars($profile->getName(), ENT_COMPAT, 'UTF-8');
		}
		if ($userid == 0) {
			$uclass = 'kwho-guest';
		} else if (CKunenaTools::isAdmin ( $userid )) {
			$uclass = 'kwho-admin';
		} else if (CKunenaTools::isModerator ( $userid, false )) {
			$uclass = 'kwho-globalmoderator';
		} else if (CKunenaTools::isModerator ( $userid )) {
			$uclass = 'kwho-moderator';
		} else if (METHOD TO CALL A RANK ID) {
                        $uclass = 'kwho-azur';
                } else {
			$uclass = 'kwho-user';
		}
		if ($userid > 0) {
			$link = CKunenaLink::GetProfileURL ( $userid );
			if (! empty ( $link ))
				return CKunenaLink::GetHrefLink ( $link, $name, $title, $rel, $uclass );
		}
		return "<span class=\"{$uclass}\">{$name}</span>";
	}

In a test i have already colored one user by calling his userid.

But can you teach me kow to call the rankid of a Kunena user ?

Topic in French support : www.kunena.org/forum/24-french/84060-col...s-kunenalinkclassphp

Kunena 1.6.2 Joomla 1.5.20
Last edit: 8 years 6 months ago by kass_damed.
The following user(s) said Thank You: C0n

Please Log in or Create an account to join the conversation.

More
8 years 6 months ago - 8 years 6 months ago #2 by ChaosHead
I did new colors for new groups. Not for ranks!
But the description of it can demand a lot of time.

For this purpose it is necessary to modify not only template files, but also a component.
Last edit: 8 years 6 months ago by ChaosHead.
The following user(s) said Thank You: kass_damed

Please Log in or Create an account to join the conversation.

More
8 years 6 months ago - 8 years 6 months ago #3 by johanfmp
I would like to have this feature also.
I created a new rank but how can I show this new rank in the section "who's online" below the forum? And how can I set a specific color for this new rank.

The new rank shows up fine for the corresponding user in the forum and the user profile. But as said above, it doesn't show in the part "who is online"
Last edit: 8 years 6 months ago by johanfmp.

Please Log in or Create an account to join the conversation.

  • C0n
  • C0n's Avatar
  • Offline
  • Premium Member
  • Only the strongest will survive
More
6 years 11 months ago - 6 years 11 months ago #4 by C0n
Does this method still work with the latest kunena :) ?

also looking at this it does not work with authors gid's
} else if ($user->get('gid') == 19 ) {
Last edit: 6 years 11 months ago by C0n.

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.101 seconds