Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #11  
Old 29th November 2018, 12:29
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
al of this is done in my v2
Reply With Quote
  #12  
Old 29th November 2018, 12:43
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Quote:
Originally Posted by Napon View Post
al of this is done in my v2
How does this help?
Reply With Quote
  #13  
Old 29th November 2018, 14:28
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
where I must put class in browse like this one

PHP Code:
    "IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit $class";
    
"categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit  $class";
    
$res sql_query($query) or die(mysql_error()); 
Reply With Quote
  #14  
Old 29th November 2018, 15:39
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
Code:
"IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where$orderby$limit$class"; 
    "categories.name AS cat_name, categories.image AS cat_pic, users.username, users.class FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where$orderby$limit$class"; 
    $res = sql_query($query) or die(mysql_error());  
Reply With Quote
  #15  
Old 29th November 2018, 16:04
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
you cannot put get user class color in there that easily

you need to make a different query just for the "Uploader Name" and use format_username function on it
to get color, disable sign, donate sign, warning sign, and other sign that might be
and it doesn't have anything to do with browse.php
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #16  
Old 29th November 2018, 16:29
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Quote:
Originally Posted by Napon View Post
Code:
"IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where$orderby$limit$class"; 
    "categories.name AS cat_name, categories.image AS cat_pic, users.username, users.class FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where$orderby$limit$class"; 
    $res = sql_query($query) or die(mysql_error());  
This appears to be correct.

@DND you do not need to do a separate query just to get owner, that's the purpose of joins. Using format_username is possible but then you need more than just class and username.
Reply With Quote
  #17  
Old 29th November 2018, 16:43
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
you can also use this in torrenttable_functions in the include
Do not need format_username at all

in my v2 of mysqli this what ive done





Code:
if ($variant == "index")
if ($row['anonymous'] == 'yes') {
    $htmlout.= "<td align='center'>
    ".(isset($row["username"]) ? (($row["anonymous"] == "yes" && $CURUSER['class'] < UC_STAFF && $row['owner'] != $CURUSER['id']) ? "&nbsp;<i>".$lang['torrenttable_anon']."</i>" : "<b><font color='#" . get_user_class_color($row['class']) . "'> " . htmlspecialchars($row['username']) . "</b></a>") : "<i>(".$lang["torrenttable_unknown_uploader"].")</i>") . "
    </td>\n";
    }else{
    $htmlout .= "<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']) . "</b></a>") : "<i>(".$lang["torrenttable_unknown_uploader"].")</i>") . "
    </td>\n";
}
Reply With Quote
  #18  
Old 29th November 2018, 16:43
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
ive done it that way for me and it works.
if it does the job and doesnt put much load on the db..its ok for me
(im not talking about only of color class, but also of other things that are in format_username function)
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #19  
Old 29th November 2018, 16:48
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
My code simply requires the userid and format_username handles everything.
Reply With Quote
  #20  
Old 29th November 2018, 16:51
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
Cool so everyone as a option in this thread to do one of them
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 15:48. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.