####################################################
##
## MOD Title: Recommendet Torrents
##
## MOD Author: Sk@yver
##
## MOD Description: This MOD will add the ability to
## recommend torrents and show
## recommended or top 10 torrents
## in torrent browse page.
##
## MOD Required Settings: NO
##
## MOD Compatibility: TTv2.x
## Support multilanguage: Yes
## Installation Level: Easy
## Installation Time: 5min.
## SQL changes: YES
##
## Files To Edit: 5
## languages/english.lang #Or your language
## torrents.php
## torrents-edit.php
## account.php
## backend/config.php
##
## Files To Upload: 0
##
####################################################
MOD instruction is in the Attachment.


SQL
ALTER TABLE `torrents` ADD `recommended` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `recommended` enum('rcm','top','hide') NOT NULL default 'rcm';
open torrents.php
find:
stdhead("" . BROWSE_TORRENTS . "");
add after
/// START RECOMMENDED TORRENTS ///
if ($site_config['RECOMMENDED_ON'] AND $count){
if($show == "recommended"){
$CURUSER["recommended"]="rcm";
}
if($CURUSER["recommended"]=="top" OR $show == "top10"){
$top10 = mysql_query("SELECT torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id ORDER BY seeders + leechers DESC LIMIT 10") or die(mysql_error());
if(mysql_num_rows($top10) > 0){
begin_frame("" . TOP_10 . "");
echo "<div align=center><a href=torrents.php?show=recommended><b>" . SHOW_RECO . "</b></a></div><br>";
torrenttable($top10);
end_frame();
}
$CURUSER["recommended"]="top10";;
}
if ($CURUSER["recommended"]=='rcm'){
$recom = mysql_query("SELECT torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.recommended='yes'") or die(mysql_error());
if(mysql_num_rows($recom) > 0){
begin_frame("" . RECO_TOR . "");
echo "<div align=center><a href=torrents.php?show=top10><b>" . SHOW_TOP_10 . "</b></a></div><br>";
torrenttable($recom);
end_frame();
}
}
}
/// END RECOMMENDED TORRENTS ///
open torrents-edit.php
find
$updateset[] = "freeleech = '".$_POST["freeleech"]."'";
add after
/// START RECOMMENDED TORRENTS ///
$updateset[] = "recommended = '" . ($_POST["recommended"] ? "yes" : "no") . "'";
// END RECOMMENDED TORRENTS ///
find
echo "<tr><td align=right><B>Free Leech: </b></TD><TD><input type="checkbox" name="freeleech"" . (($row["freeleech"] == "1") ? " checked="checked"" : "" ) . " value="1" />Leeching is free? (Only Uploading Counts)<br>";
}
add after
/// START RECOMMENDED TORRENTS ///
if ($site_config['RECOMMENDED_ON'] AND $CURUSER["class"] > 4){
echo "<tr><td align=right><B>".RECO_TOR.": </b></TD><TD><input type="checkbox" name="recommended"" . (($row["recommended"] == "yes") ? " checked="checked"" : "" ) . " value="1" /> " . SHOW_IN_RECÎ . "<br>";
}
// END RECOMMENDED TORRENTS ///
open account.php
find
print("<TR><TD align=right class=table_col1 valign=top><B>Category Filter: </B></td><TD align=left class=table_col1><i>The system will only display the following categories when browsing (uncheck all to disable filter).</i><BR>".$categories."</td></tr>");
add after
/// START RECOMMENDED TORRENTS ///
if ($site_config['RECOMMENDED_ON']){
print("<TR><TD align=right class=table_col1><B>".RECO_TOR.":</b></td><TD align=left class=table_col1><input type=radio name=reco". ($CURUSER["recommended"] == "rcm" ? " checked" : "") . " value=rcm>".RECO_TOR."<input type=radio name=reco". ($CURUSER["recommended"] == "top" ? " checked" : "") . " value=top>".TOP_10."<input type=radio name=reco". ($CURUSER["recommended"] == "hide" ? " checked" : "") . " value=hide>".HIDE."</td></tr>");
}
/// END RECOMMENDED TORRENTS ///
find
$pmnotif = $_POST["pmnotif"];
add after
/// START RECOMMENDED TORRENTS ///
$reco = $_POST["reco"];
/// END RECOMMENDED TORRENTS ///
find
$updateset[] = "commentpm = " . sqlesc($commentpm);
add after
/// START RECOMMENDED TORRENTS ///
$updateset[] = "recommended = ".sqlesc($reco);
/// END RECOMMENDED TORRENTS ///
open backend/config.php
add anywhere
/// START RECOMMENDED TORRENTS ///
$site_config['RECOMMENDED_ON'] = true; //enable/disable Recommended Torrents
$site_config['RECO_CLASS'] = 6; /// Level of users to recommende torrent (5=MOD) (6=SUPER MOD)
// END RECOMMENDED TORRENTS ///
finish lolll
[url="
http://devscorner.xyz/applications/core/interface/file/attachment.php?id=1666"]Recommended_torrents_ADDON.zip[/url]
[url="
http://devscorner.xyz/applications/core/interface/file/attachment.php?id=7180"]recommendedtorrents_block.php[/url]