| group colors [message #4433] |
Sun, 11 July 2010 18:57  |
|
when a user makes comment on a torrent. there level color isnt there. wot do i put here to show users color
define("_btcommheader","By <a href=\"user.php?op=profile&id=**uid**\" target=\"_top\">**user**</a> On **time**");
also in torrent details. Uploaded By, dosnt show users group color.
iv tried this but dosnt seem to show up any colors
echo "<tr><td><p>"._btuppedby."</p></td><td><p>";
switch ($torrent["ownertype"]) {
case 0: {
echo "<a href=\"user.php?op=profile&id=".$torrent["owner"]."\"><font color=\"".getusercolor($row["can_do"])."\">".htmlspecialchars($torrent["ownername"])."</a></font>";
if ($user->admin) echo " [".htmlspecialchars($torrent["user_host"])."]";
break;
}
case 1: {
if ($user->moderator) echo "<a href=\"user.php?op=profile&id=".$torrent["owner"]."\"><font color=\"".getusercolor($row["can_do"])."\">".htmlspecialchars($torrent["ownername"])."</a></font>";
else echo "<i>"._btunknown."</i>";
if ($user->admin) echo " [".htmlspecialchars($torrent["user_host"])."]";
}
case 2: {
if ($user->admin) echo "[".htmlspecialchars($torrent["user_host"])."]";
else echo "<i>"._btunknown."</i>";
}
}


For cheap, fast, reliable webhosting, please click here on my affiliate link!
[Updated on: Sun, 11 July 2010 19:03] Report message to a moderator
|
|
|
| Re: group colors [message #4434 is a reply to message #4433] |
Sun, 11 July 2010 19:23   |
|
for comments
in ajax.php find
#Read Comments
$id = $_GET['torrent'];
$password = $_GET["password"];
if (!isset($id) OR !is_numeric($id) OR $id < 1) error(_bterridnotset);
$password = urldecode($password);
$sql = "SELECT password FROM ".$db_prefix."_torrents WHERE id = '".$id."' AND (password IS NULL OR password = '".$password."') LIMIT 1;";
$res = $db->sql_query($sql);
if ($db->sql_numrows($res) < 1) die(); //Password is wrong or not set
$db->sql_freeresult($res);
$sql = "SELECT C.*, U.id as uid, U.username, U.name, IF(U.name IS NULL, U.username, U.name) as user_name, U.avatar as user_avatar FROM ".$db_prefix."_comments C LEFT JOIN ".$db_prefix."_users U ON C.user = U.id WHERE C.torrent ='".$id."' ORDER BY added ASC;";
$res = $db->sql_query($sql) or btsqlerror($sql);
if ($db->sql_numrows($res) < 1) {
echo "<h3 align=\"center\" class=\"title\">"._btnocommentsyet."</h3>";
} else while ($comment = $db->sql_fetchrow($res)) {
echo "<a name=\"comm".$comment["id"]."\"></a><table width=\"100%\" class=\"main\">";
echo "<thead>\n<tr><td class=\"colhead\">";
$search = Array("**user**","**uid**","**time**");
$replace = Array(htmlspecialchars($comment["user_name"]),$comment["uid"],formatTimestamp($comment["added"]));
and change it to
#Read Comments
$id = $_GET['torrent'];
$password = $_GET["password"];
if (!isset($id) OR !is_numeric($id) OR $id < 1) error(_bterridnotset);
$password = urldecode($password);
$sql = "SELECT password FROM ".$db_prefix."_torrents WHERE id = '".$id."' AND (password IS NULL OR password = '".$password."') LIMIT 1;";
$res = $db->sql_query($sql);
if ($db->sql_numrows($res) < 1) die(); //Password is wrong or not set
$db->sql_freeresult($res);
$sql = "SELECT C.*, U.id as uid, U.can_do as can_do, U.username, U.name, IF(U.name IS NULL, U.username, U.name) as user_name, U.avatar as user_avatar FROM ".$db_prefix."_comments C LEFT JOIN ".$db_prefix."_users U ON C.user = U.id WHERE C.torrent ='".$id."' ORDER BY added ASC;";
$res = $db->sql_query($sql) or btsqlerror($sql);
if ($db->sql_numrows($res) < 1) {
echo "<h3 align=\"center\" class=\"title\">"._btnocommentsyet."</h3>";
} else while ($comment = $db->sql_fetchrow($res)) {
echo "<a name=\"comm".$comment["id"]."\"></a><table width=\"100%\" class=\"main\">";
echo "<thead>\n<tr><td class=\"colhead\">";
$search = Array("**user**","**uid**","**time**");
$replace = Array("<font color=\"".getusercolor($comment["can_do"])."\">".htmlspecialchars($comment["user_name"])."</font>",$comment["uid"],formatTimestamp($comment["added"]));
|
|
|
|
| Re: group colors [message #4436 is a reply to message #4434] |
Sun, 11 July 2010 19:35   |
|
you meant frame.php didnt you lol.
this is my part incase anyone wants to change there own.
case "commentlist": {
if (!isset($id) OR !is_numeric($id) OR $id < 1) error(_bterridnotset);
$password = urldecode($password);
$sql = "SELECT password FROM ".$db_prefix."_torrents WHERE id = '".$id."' AND (password IS NULL OR password = '".$password."') LIMIT 1;";
$res = $db->sql_query($sql);
if ($db->sql_numrows($res) < 1) die(); //Password is wrong or not set
$db->sql_freeresult($res);
$sql = "SELECT C.*, U.id as uid, U.can_do as can_do, U.username, U.name, IF(U.name IS NULL, U.username, U.name) as user_name, U.avatar as user_avatar FROM ".$db_prefix."_comments C LEFT JOIN ".$db_prefix."_users U ON C.user = U.id WHERE C.torrent ='".$id."' ORDER BY added ASC;";
$res = $db->sql_query($sql) or btsqlerror($sql);
if ($db->sql_numrows($res) < 1) {
echo "<h3 align=\"center\" class=\"title\"><u>Be the first to comment.</u></h3>";
} else while ($comment = $db->sql_fetchrow($res)) {
echo "<a name=\"comm".$comment["id"]."\"></a><table width=\"100%\" class=\"main\">";
echo "<thead>\n<tr><td class=\"colhead\">";
$search = Array("**user**","**uid**","**time**");
$replace = Array("<font color=\"".getusercolor($comment["can_do"])."\">".htmlspecialchars($comment["user_name"])."</font>",$comment["uid"],formatTimestamp($comment["added"]));
echo str_replace($search,$replace,_btcommheader);
echo "</td>\n</tr>\n</thead>\n";
echo "<tbody>\n<tr><td>";
echo "<table width=\"100%\">\n</tr>\n<td width=\"100\">";
if ($comment["user_avatar"] != "blank.gif") echo "<img src=\"avatars/".$comment["user_avatar"]."\" alt=\"".str_replace("**user**",($comment["name"] == "") ? $comment["username"]:$comment["name"],_btalt_avatar)."\" width=\"70\" border=\"0\">";
else echo pic("noavatar.png");
echo "</td>\n<td>";
$body = stripslashes(format_comment($comment["text"]));
parse_smiles($body);
if ($user->admin OR $user->id == $comment["user"]) echo "<div align=\"right\"><a href=\"comment.php?op=delete&id=".$id."&cid=".$comment["id"]."\" target=\"_top\">".pic("drop.gif")."</a></div>";
echo "<div align=\"justify\">".$body."</div>";
echo "</td>\n</tr>\n</table>\n";
echo "<tr><td><HR></td></tr>\n";
echo "</td>\n</tr>\n</tbody>\n";
echo "</table>";
}
break;
}


For cheap, fast, reliable webhosting, please click here on my affiliate link!
|
|
|
|
|
|
|