Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 29th November 2018, 09:10
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
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; 29th November 2018 at 10:16.
Reply With Quote
  #2  
Old 29th November 2018, 09:15
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Just a quick glance, you are doubling the '#' sign.
Reply With Quote
  #3  
Old 29th November 2018, 09:31
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
where you see, its only one
Reply With Quote
  #4  
Old 29th November 2018, 09:38
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
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.
Reply With Quote
  #5  
Old 29th November 2018, 09:46
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
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 29th November 2018, 09:53
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
You're going to have to be more specific, what doesn't work? What is the exact error, etc?
Reply With Quote
  #7  
Old 29th November 2018, 09:58
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
on browse got same color users not different
Reply With Quote
  #8  
Old 29th November 2018, 10:05
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
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?
Reply With Quote
  #9  
Old 29th November 2018, 10:14
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
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 29th November 2018, 11:39
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
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.
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 18:36. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.