Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev
Reply
  #1  
Old 29-11-18, 09:10
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 106
Default User Color in browse
Hi something not working so I need any idea

I put this in global.php

PHP Code:
  function get_user_class_color($class)
{
      switch (
$class)
  {
    case 
UC_USER: return "black";

    case 
UC_POWER_USER: return "#f9a200";

    case 
UC_VIP: return "#009F00";

    case 
UC_UPLOADER: return "#6464FF";

    case 
UC_MODERATOR: return "#ff5151";

    case 
UC_ADMINISTRATOR: return "#B000B0";

    case 
UC_SYSOP: return "#2587A7";
    
    case 
UC_STAFFLEADER: return "darkred";

    }
    return 
"";


and add in fuctions.php


PHP Code:
print("<td align=center>" . (isset($row["username"]) ? ("<a href=userdetails.php?id=" $row["owner"] . "><font color=\"#" get_user_class_color($row["class"]) . "\">" htmlspecialchars($row["username"]) . "</font></a>") : "<i>(unknown)</i>") . "</td>\n"); 

and still not work, what I missed, thanks for help

Last edited by elvira; 29-11-18 at 10:16.
Reply With Quote
  #2  
Old 29-11-18, 09:15
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 62
Default
Just a quick glance, you are doubling the '#' sign.
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.
Reply With Quote
  #3  
Old 29-11-18, 09:31
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 106
Default
where you see, its only one
Reply With Quote
  #4  
Old 29-11-18, 09:38
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 62
Default
<font color="#"
case UC_USER: return "#f9a950";

case UC_POWER_USER: return "#f9a200";

case UC_VIP: return "#009F00";

case UC_UPLOADER: return "#6464FF";

case UC_MODERATOR: return "#ff5151";

case UC_ADMINISTRATOR: return "#B000B0";

case UC_SYSOP: return "#2587A7";

case UC_STAFFLEADER: return "#0F6CEE";

Looks like 2 to me.
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.
Reply With Quote
  #5  
Old 29-11-18, 09:46
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 106
Default
ok I change this line and not work

PHP Code:
print("<td align=center>" . (isset($row["username"]) ? ("<a href=userdetails.php?id=" $row["owner"] . "><b><font color='" get_user_class_color($row["class"]) . "'> " htmlspecialchars($row['username']) . "</font></b></a>") : "<i>(unknown)</i>") . "</td>\n"); 
Reply With Quote
  #6  
Old 29-11-18, 09:53
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 62
Default
You're going to have to be more specific, what doesn't work? What is the exact error, etc?
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.
Reply With Quote
  #7  
Old 29-11-18, 09:58
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 106
Default
on browse got same color users not different
Reply With Quote
  #8  
Old 29-11-18, 10:05
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 62
Default
Where is row['class'] coming from? Is it from a join to users? Is the query correct? Are the results correct? What color is displayed? What class does that match?
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.
Reply With Quote
  #9  
Old 29-11-18, 10:14
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 106
Default
can we go step by step...

Test is User color black

SlaTkis is StaffLeader color black must be darkred

Click the image to open in full size.
Reply With Quote
  #10  
Old 29-11-18, 11:39
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 62
Default
I have to guess, because you have not answered the previous questions.

It appears that your query, more specifically your join is flawed. If you look at your error log, you may see that index 'class' does not exist. If you do, simple fix, add the proper join
Code:
LEFT JOIN users ON torrents.owner = users.id
and be sure that you select the class in the query.

But without more information, I am only guessing.
__________________
I do custom coding, source installs, mods, server setup and/or config, etc. Feel free to pitch me your needs and your offer.
Reply With Quote
Reply

Tags
browse , color , user

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 12:18. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.