View Single Post
  #10  
Old 21st February 2010, 02:11
Timisoreanul's Avatar
Timisoreanul Timisoreanul is offline
Senior Member
 
Join Date: Apr 2008
P2P
Posts: 211
Default
Ok , let's try another method,

Step 1: go to your phpmyadmin, then select your database of tracker, then click SQL end run
Code:
ALTER TABLE `torrents` ADD `recommend` ENUM( 'Yes', 'No' ) NOT NULL DEFAULT 'No';
click execute.
Step 2: in your folder tracker,, open upload.php find
Code:
tr("Type", $s, 1);
add afther it
Code:
tr("Recommend torrent","<input type=radio name=recommend" . ($row["recommend"] == "yes" ? " checked" : "") . " value=yes>Yes<input type=radio name=recommend" . ($row["recommend"] == "no" ? " checked" : "") . " value=no>No",1);
now save end close the file.
Step 3 : find end open takeupload.php search for
Code:
$ret = mysql_query("INSERT INTO torrents:
end you will see , type, recommend, descr, ori_descr, description, category now replace that line with this:
Code:
, type, recommend, descr, ori_descr, description, category
save end close
Step 4 :find end open edit.php find
Code:
	tr("Type", $s, 1);
end add afther it this:
Code:
tr("Recommend torrent","<input type=radio name=recommend" . ($row["recommend"] == "yes" ? " checked" : "") . " value=yes>Yes<input type=radio name=recommend" . ($row["recommend"] == "no" ? " checked" : "") . " value=no>No",1);
save end close
Step 5: find end open takeedit.php find
Code:
$updateset[] = "category = " . (0 + $type);
add afther it this:
Code:
$recommend = unesc($_POST['recommend']);
$updateset[] = "recommend = " . sqlesc($recommend);
Step 6 : find end open browse.php find:
Code:
	stdhead("Search results for \"$searchstr\"");
else
	stdhead();
afther that add this:
Code:
$res1 = mysql_query("SELECT torrents.id, torrents.size, torrents.name, torrents.filename, torrents.poster, torrents.leechers, torrents.seeders, torrents.times_completed, torrents.owner, users.username AS username, users.class AS class FROM torrents INNER JOIN users ON torrents.owner = users.id WHERE torrents.recommend='yes' ORDER BY torrents.times_completed DESC LIMIT 3");
if (mysql_num_rows($res1) > 0) {
begin_frame("Recommend Torrent",true,5);
while ($arr1 = mysql_fetch_assoc($res1)) {
$dispname = htmlspecialchars(trim($arr1["name"]));
$count_dispname=strlen($dispname);
$max_lenght_of_torrent_name="15"; // maximum lenght
if($count_dispname > $max_lenght_of_torrent_name){
$short_torrent_name_alt="title=\"$dispname \"";
$dispname=substr($dispname, 0, $max_lenght_of_torrent_name) . "...";
}else
$short_torrent_name_alt="$dispname";
echo "<td width=\"50%\" align=\"center\">
<br/>
<b><a href=\"./details.php?id=$arr1[id]&hit=1\"$short_torrent_name_alt><img src=\"$arr1[poster]\" border=\"0\" width=\"150\" height=\"150\"></a></b>
<br/>
<a href=\"./details.php?id=$arr1[id]&hit=1\"$short_torrent_name_alt><b>$dispname</b></a><br/><br/>
<b><a href=\"./details.php?id=$arr1[id]&dllist=1#seeders\"><font color=green>Seed ($arr1[seeders])</font> <font color=red>Leech ($arr1[leechers])</font></a> <font color=blue>Snatched ($arr1[times_completed])</font></b><br/>
<b>Size:</b> ".mksize($arr1['size'])."<br/>
<b>Upped by:</b> <a href=userdetails.php?id=$arr1[owner]><b>".$arr1['username']."</b></a><br/>
<a class=\"index\" href=\"download.php/$arr1[id]/" . rawurlencode($arr1["filename"]) . "\">" . "<font color=red>Download Torrent</font>" . "</a><br>
</td>";
}

end_frame();
}
mysql_free_result($res1);
save end close.
good luck
__________________
only me
Reply With Quote