Style with format_username

Started by denede, February 05, 2014, 03:28:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


so that's why i was getting a lot of id, class, errors.. hmm
hope that V4 will be made this way. it will be a nice addition.


Its not as straight forward as adding format_username, first for doing browse you will need another left join added to browse.php main query to users, you will need to draw id, class, username, donor, warned as that's in format_username, because its browse you cannot use $CURUSER values as each uploader needs his specific values pulled to show user class color ect, details.php is the same - add a left join to users if not there, or add a cached user query you can pull it from on the scripts you need it, its either using format_username($CURUSER) or the query format_username($row['.....).


Trying to bring a little "style" to my default interface so I thought about using format_username on the site on some key parts.

$keepget = "";
                if($row['anonymous'] == 'yes') {
    if ($CURUSER['class'] < UC_UPLOADER)
    $uprow = "<i>Hidden</i>";
    $uprow = "<i>Hidden</i> (<a href='userdetails.php?id=$row[owner]'><b>$row[username]</b></a>)";
    else {
                $uprow = (isset($row["username"]) ? ("<a href='{$TBDEV['baseurl']}/userdetails.php?id=" . $row["owner"] . "'><b>" . htmlspecialchars($row["username"]) . "</b></a>") : "<i>{$lang['details_unknown']}</i>");
                if ($owned)
                        $uprow .= " $spacer<$editlink><b>{$lang['details_edit']}</b></a>";
                $HTMLOUT .= tr("Upped by", $uprow, 1);

(the details part where it shows whom uploaded the torrent)

       $htmlout .= "<td align='center'>" . (isset($row["username"]) ? ("<a href='{$TBDEV['baseurl']}/userdetails.php?id=" . $row["owner"] . "'><b>" . htmlspecialchars($row["username"]) . "</b></a>") : "<i>(".$lang["torrenttable_unknown_uploader"].")</i>") . "</td>\n";

(the torrenttable part where it shows whom uploaded the torrent)

$list[] = '<a href=\'userdetails.php?id='.$a['userid'].'\' target=\''.$target.'\'>'.htmlsafechars($a['username']).'</a>';

(thanks part from details where it shows who thanked)

tried to make them work with format_username and the only part i managed to do was in the statusbar part. :))
advices on how to do it ?
From the codes above, i will do the same on the rest of the site. Code is relatively the same.