Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev
Reply
  #11  
Old 29-11-18, 12:29
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 363
Default
al of this is done in my v2
Reply With Quote
  #12  
Old 29-11-18, 12:43
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 80
Default
Quote:
Originally Posted by Napon View Post
al of this is done in my v2
How does this help?
__________________
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
  #13  
Old 29-11-18, 14:28
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 108
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 29-11-18, 15:39
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 363
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 29-11-18, 16:04
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 1,058
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. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support
Reply With Quote
  #16  
Old 29-11-18, 16:29
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 80
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.
__________________
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
  #17  
Old 29-11-18, 16:43
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 363
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 29-11-18, 16:43
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 1,058
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. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support
Reply With Quote
  #19  
Old 29-11-18, 16:48
darkalchemy's Avatar
darkalchemy darkalchemy is offline
VIP
 
Join Date: Dec 2017
United States
Posts: 80
Default
My code simply requires the userid and format_username handles everything.
__________________
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
  #20  
Old 29-11-18, 16:51
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 363
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 04:25. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.