Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   User Color in browse (http://www.bvlist.com/showthread.php?t=11870)

Napon 29th November 2018 12:29

al of this is done in my v2

darkalchemy 29th November 2018 12:43

Quote:

Originally Posted by Napon (Post 52892)
al of this is done in my v2

How does this help?

elvira 29th November 2018 14:28

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()); 


Napon 29th November 2018 15:39

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()); 


DND 29th November 2018 16:04

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

darkalchemy 29th November 2018 16:29

Quote:

Originally Posted by Napon (Post 52895)
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.

\n";
    }else{
    $htmlout .= "\n";
}
Napon 29th November 2018 16:43

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.= "

    ".(isset($row["username"]) ? (($row["anonymous"] == "yes" && $CURUSER['class'] < UC_STAFF && $row['owner'] != $CURUSER['id']) ? " ".$lang['torrenttable_anon']."" : " " . htmlspecialchars($row['username']) . "") : "(".$lang["torrenttable_unknown_uploader"].")") . "
   

    " . (isset($row["username"]) ? (" " . htmlspecialchars($row['username']) . "") : "(".$lang["torrenttable_unknown_uploader"].")") . "
   

DND 29th November 2018 16:43

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)

darkalchemy 29th November 2018 16:48

My code simply requires the userid and format_username handles everything.

Napon 29th November 2018 16:51

Cool so everyone as a option in this thread to do one of them :drink:


All times are GMT +2. The time now is 17:34.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.