Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 04-05-10, 12:17
Rendevous's Avatar
Rendevous Rendevous is offline
Senior Member
 
Join Date: Nov 2009
P2P
Posts: 38
Default Anonymous Comments
bittorrent

find:

Code:
function commenttable($rows)
{
	global $CURUSER;
	begin_main_frame();
	begin_frame();
	$count = 0;
	foreach ($rows as $row)
	{
		print("<p class=sub>#" . $row["id"] . " by ");
    if (isset($row["username"]))
		{
			$title = $row["title"];
			if ($title == "")
				$title = get_user_class_name($row["class"]);
			else
				$title = htmlspecialchars($title);
        print("<a name=comm". $row["id"] .
        	" href=userdetails.php?id=" . $row["user"] . "><b>" .
        	htmlspecialchars($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=".
    			"/pic/warned.gif alt=\"Warned\">" : "") . " ($title)\n");
		}
		else
   		print("<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n");

		print(" at " . $row["added"] . " GMT" .
			($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=comment.php?action=edit&amp;cid=$row[id]>Edit</a>]" : "") .
			(get_user_class() >= UC_MODERATOR ? "- [<a href=comment.php?action=delete&amp;cid=$row[id]>Delete</a>]" : "") .
			($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [<a href=comment.php?action=vieworiginal&amp;cid=$row[id]>View original</a>]" : "") . "</p>\n");
		$avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : "");
		if (!$avatar)
			$avatar = "/pic/default_avatar.gif";
		$text = format_comment($row["text"]);
    if ($row["editedby"])
    	$text .= "<p><font size=1 class=small>Last edited by <a href=userdetails.php?id=$row[editedby]><b>$row[username]</b></a> at $row[editedat] GMT</font></p>\n";
		begin_table(true);
		print("<tr valign=top>\n");
		print("<td align=center width=150 style='padding: 0px'><img width=150 src=$avatar></td>\n");
		print("<td class=text>$text</td>\n");
		print("</tr>\n");
     end_table();
  }
	end_frame();
	end_main_frame();
replace with:


Code:
function commenttable($rows) {

  global $CURUSER, $HTTP_SERVER_VARS;

   begin_main_frame();

    begin_frame();

    $count = 0;
    foreach ($rows as $row)

    {
        $querie = mysql_query("SELECT anonymous FROM comments WHERE id = $row[id]");
        $arraya = mysql_fetch_assoc($querie);

      print("<p class=sub>#" . $row["id"] . " by ");

	$title = "(" . get_user_class_name($row["class"]) . ")";
    $title = "";
       
        if ($arraya['anonymous'] == 'no' && isset($row["username"]))
        {
$username = $row["username"];
$ratres = mysql_query("SELECT uploaded, downloaded from users where username='$username'");
$rat = mysql_fetch_array($ratres);
if ($rat["downloaded"] > 0)

{
$ratio = $rat['uploaded'] / $rat['downloaded'];
$ratio = number_format($ratio, 3);
$color = get_ratio_color($ratio);
if ($color)
$ratio = "<font color=$color>$ratio</font>";
}
else
if ($rat["uploaded"] > 0)
$ratio = "Inf.";
else

$ratio = "---";

	print("<a name=comm". $row["id"] . " href=userdetails.php?id=" . $row["user"] . "><b>" . htmlspecialchars($row["username"]) . "</b></a> " . $title . " " . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=". "/pic/warned.gif alt=\"Warned\">" : "") . " (Ratio: $ratio)\n");

	}

        else if (!isset($row["username"])) {
        print("<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n");
        }

        else if ($arraya['anonymous'] == 'yes') {
        print("<a name=\"comm" . $row["id"] . "\"><font color=blue><b>Anonymous</b></font></a>\n");
        }

        print(" at " . $row["added"] . " GMT" .
          ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=comment.php?action=edit&amp;cid=$row[id]>".Edit."</a>] " : "") .
          (get_user_class() >= UC_USER ? "- [<a href=report.php?commentid=$row[id]>Report</a>] " : "") .
          (get_user_class() >= UC_MODERATOR ? "- [<a href=comment.php?action=delete&amp;cid=$row[id]>".Delete."</a>]" : "") .
          ($row["editedby"] && get_user_class() >= UC_MODERATOR ? " - [<a href=comment.php?action=vieworiginal&amp;cid=$row[id]>".View_original."</a>]" : "") . "</p>\n");

      $resa = mysql_query("SELECT owner, anonymous FROM torrents WHERE owner = $row[user]");
      $array = mysql_fetch_assoc($resa);

      if ($row['anonymous'] == 'yes' && $row['user'] == $array['owner']) {
      $avatar = "/pic/default_avatar.gif";
      }

      else {
      $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : "");
      }

      if (!$avatar)
        $avatar = "/pic/default_avatar.gif";
      begin_table(true);
        print("<tr valign=top>\n");
        print("<td align=center width=100 style='padding: 0px'><img width=100 src=$avatar></td>\n");
        print("<td class=text>" . format_comment($row["text"]) . "</td>\n");
        print("</tr>\n");
      end_table();
    }
    end_frame();
  end_main_frame();
}
Add this to sql:

Code:
ALTER TABLE comments ADD `anonymous` enum('yes','no') NOT NULL default 'no';
comments.php

find:

Code:
$res = mysql_query("SELECT name FROM torrents WHERE id = $torrentid") or sqlerr(__FILE__,__LINE__);
change too:

Code:
$res = mysql_query("SELECT name, owner, anonymous FROM torrents WHERE id = $torrentid") or sqlerr(__FILE__,__LINE__);
find:

Code:
mysql_query("INSERT INTO comments (user, torrent, added, text, ori_text) VALUES (" .
		  $CURUSER["id"] . ",$torrentid, '" . get_date_time() . "', " . sqlesc($text) .
		   "," . sqlesc($text) . ")");
replace with

Code:
if ($CURUSER['id'] == $arr['owner'] && $arr['anonymous'] == 'yes') {
$anon = "'yes'";
}
else {
$anon = "'no'";
}
mysql_query("INSERT INTO comments (user, torrent, added, text, ori_text, anonymous) VALUES (" .
   $CURUSER["id"] . ",$torrentid, '" . get_date_time() . "', " . sqlesc($text) .
	"," . sqlesc($text) . ", $anon)");
find:

Code:
$res = mysql_query("SELECT comments.id, text, comments.added,
after add:

Code:
comments.anonymous,
details.php

find:

Code:
$subres = mysql_query("SELECT comments.id, text, user, comments.added,
after add:

Code:
comments.anonymous,
Thanks to Wilba from Tbdev
Reply With Quote
The Following 3 Users Say Thank You to Rendevous For This Useful Post:
d6bmg (07-06-11), kalwin (19-01-12), Tibys08 (29-05-11)
Reply

Tags
anonymous , comments

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anonymous Uploader dyzzy Mods & Themes 1 07-11-12 15:45
Rating in Comments Fynnon Mods & Themes 6 05-05-10 06:27
Anonymous Uploader Rendevous Mods & Themes 0 04-05-10 12:11
Anonymous in browse.php lovebeer TBDev 2 17-03-10 15:13
Anonymous mod netdsl YSE 0 21-09-08 13:24



All times are GMT +2. The time now is 02:20. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2018, vBulletin Solutions Inc.