×
Blue Eagle 5 v1.6.2 has been Released for Kunena 5.2 (20 Jan 2021)

The Kunena team has announce the arrival of Kunena template Blue Eagle 5 v1.6.2 which is now available for download. This version addresses most of the issues that were discovered in development.

REQUIREMENTS
Blue Eagle 1.6.x requires Kunena 5.2.x to work with

× 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
10 years 3 weeks ago - 10 years 3 weeks 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: 10 years 3 weeks ago by kass_damed.
The following user(s) said Thank You: C0n

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

More
10 years 3 weeks ago - 10 years 3 weeks 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: 10 years 3 weeks ago by ChaosHead.
The following user(s) said Thank You: kass_damed

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

More
10 years 3 weeks ago - 10 years 3 weeks 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: 10 years 3 weeks 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
8 years 6 months ago - 8 years 6 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: 8 years 6 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.112 seconds