|
#11
|
|||
|
|||
al of this is done in my v2
|
#12
|
|||
|
|||
|
#13
|
||||
|
||||
where I must put class in browse like this one
PHP Code:
|
#14
|
|||
|
|||
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()); |
#15
|
|||
|
|||
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:
|
#16
|
|||
|
|||
Quote:
@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. |
#17
|
|||
|
|||
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']) ? " <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"; } |
#18
|
|||
|
|||
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:
|
#19
|
|||
|
|||
My code simply requires the userid and format_username handles everything.
|
#20
|
|||
|
|||
Cool so everyone as a option in this thread to do one of them
|
Tags |
browse , color , user |
|
|