SQL:
Find:
Upload into images the files contained in the attached archive, and that's all.
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6447"]images.zip[/url]
ALTER TABLE torrents ADD `recommended` enum('yes','no') NOT NULL default 'no';
In torrents-edit.phpFind:
if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){
echo "<tr><td class='table_col1' align='right'><b>".T_("FREE_LEECH").": </b></td><td class='table_col2'><input type="checkbox" name="freeleech"" . (($row["freeleech"] == "1") ? " checked="checked"" : "" ) . " value="1" />".T_("FREE_LEECH_MSG")."<br /></td></tr>";
}
Below, add:
if(get_user_class($CURUSER) > 6){
echo "<tr><td align=right><b>Recommended: </b></td><td><input type='checkbox' name='recommended'" . (($row["recommended"] == "yes") ? " checked='checked'" : "" ) . " value='yes' />";
}
Find:
$updateset[] = "freeleech = '".$_POST["freeleech"]."'";
Below, add:
if(get_user_class($CURUSER) > 6){
if ($_POST["recommended"] == "yes")
$updateset[] = "recommended = 'yes'";
else
$updateset[] = "recommended = 'no'";
}
In index.php
Find:
stdhead(T_("HOME"));
Below, add:
//===| Start Recommended Torrents |===//
begin_frame("Recommended Torrents");
$rec = SQL_Query_exec("SELECT id, name, added, image1, seeders, leechers, times_completed FROM torrents WHERE banned ='no' AND visible='yes' AND recommended='yes' ORDER BY torrents.id DESC LIMIT 5");
if (mysql_num_rows($rec) > 0) {
print("<table align=center cellpadding=0 cellspacing=0 width=100% border=0><tr>");
while ($row2 = mysql_fetch_array($rec, MYSQL_NUM)) {
$tor = $row2['0'];
$altname = $row2['1'];
$where = "WHERE banned = 'no' AND visible='yes' AND torrents.id='$tor'";
$res = SQL_Query_exec("SELECT torrents.id, torrents.image1, torrents.image2, torrents.added, torrents.added, torrents.seeders, torrents.leechers, torrents.times_completed, categories.name AS cat_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id $where");
$row = mysql_fetch_array($res);
$cat = $row['cat_name'];
$img1 = "<a href=torrents-details.php?id=$row[id]'><img border='0' src='uploads/images/$row[image1]' title="$altname | $cat" width=150 height=210></a>
<div style='margin-top:3px; font: Arial 11px'>
<img src=images/check.png height='11' title='Completed' border=0> <font color=#0080FF><b>".$row['times_completed']."</b></font> |
<img src=images/arrow_up.gif height='11' title='Seeders' border=0> <font color=#00AA00><b>".$row['seeders']."</b></font> |
<img src=images/arrow_down.gif height='11' title='Leechers' border=0> <font color=#FF0000><b>".$row['leechers']."</b></font>
</div>";
if ($row["image1"] != ""){
print("<td align=center>".$img1."</td>");
}
}
print("</tr></table>");
}
end_frame();
//===| End Recommended Torrents |===//
Upload into images the files contained in the attached archive, and that's all.
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6447"]images.zip[/url]
