Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Recommended Torrent [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-04-16 14:57:08
Credit to original author, updated and ive added to torrent-details so members can see older torrents that have been recommended

[color=rgb(251, 160, 38)]You need to recommend 1 torrent

SQL[/color]
ALTER TABLE torrents ADD `recommended` enum('yes','no') NOT NULL default 'no';


[color=rgb(251, 160, 38)]Index.php[/color]
//===| Start Recommended Torrents |===//
   begin_frame(T_("recommended"));
$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 RAND() LIMIT 7");
if (mysqli_num_rows($rec) > 0) {
print("<table align=center cellpadding=3 cellspacing=3 width=100% border=0><tr>");
while ($row2 = mysqli_fetch_array($rec)) {
$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 = mysqli_fetch_array($res);
$cat = $row['cat_name'];
$img1 = "<a href=torrents-details.php?id=$row[id]' target='_new'><div><img id='cover_img1' class='cover_img' border='0' src='uploads/images/$row[image1]' title=\"$altname | $cat\" width='90px' height='130px'></a></div>
<div style='margin-top:10px; font-size:13px;'>
<img src=images/check.png height='14' title='Completed' border=0><font color=#0080FF> <b>".$row['times_completed']."</b></font> |
<img src=images/arrow_up.gif height='12' title='Seeders' border=0><font color=#00AA00><b>".$row['seeders']."</b></font> |
<img src=images/arrow_down.gif height='12' title='Leechers' border=0><font color=#FF0000> <b>".$row['leechers']."</b></font>
</div>";
if ($row["image1"] != ""){
print("<td align=center>".$img1."</td>");
}else{
   $img1 = "<a href=torrents-details.php?id=$row[id]'><img id='cover_img1' class='cover_img' border='0' src=images/no-poster.jpg title=\"$altname | $cat\" width='90px' height='130px'></a>
<div style='margin-top:10px; font-size:13px;'>
<img src=images/check.png height='14' title='Completed' border=0><font color=#0080FF> <b>".$row['times_completed']."</b></font> |
<img src=images/arrow_up.gif height='12' title='Seeders' border=0><font color=#00AA00><b>".$row['seeders']."</b></font> |
<img src=images/arrow_down.gif height='12' title='Leechers' border=0><font color=#FF0000> <b>".$row['leechers']."</b></font>
</div>";
print("<td align=center>".$img1."</td>");
}
}
print("</tr></table>");
}
   end_frame();

//===| End Recommended Torrents |===//


[color=rgb(251, 160, 38)]Torrent-details.php[/color]
find
$res = SQL_Query_exec("SELECT torrents.anon,


add torrents.recommended to line
$res = SQL_Query_exec("SELECT torrents.anon, torrents.recommended,


find
    if ($row["external"]!='yes'){
       print ("<b>".T_("SPEED").": </b>" . $totalspeed . "<br />");
   }


before add
if ($row["external"]!='yes' && $row["recommended"]== yes){
       print ("<b>Top Torrent: </b><font color='orange'>Recommended</font></br>");
   }


[color=rgb(251, 160, 38)]Torrents-edit.php[/color]
find
    if ($CURUSER["edit_torrents"] == "yes")
       $updateset[] = "freeleech = '".$_POST["freeleech"]."'";


add after
     if(get_user_class($CURUSER) > 6){
            if ($_POST["recommended"] == "yes")
                        $updateset[] = "recommended = 'yes'";
                else
            $updateset[] = "recommended = 'no'";
    }    


find
if ($site_config['ANONYMOUSUPLOAD']) {
   echo "<tr><td class='table_col1' align='right'><b>".T_("ANONYMOUS_UPLOAD").": </b></td><td class='table_col2'><input type=\"checkbox\" name=\"anon\"" . (($row["anon"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" />(".T_("ANONYMOUS_UPLOAD_MSG").")<br /></td></tr>";
}


before add
if(get_user_class($CURUSER) > 6){
   echo "<tr><td class='table_col1' align='right'><b>Recommended: </b></td><td class='table_col2'><input type='checkbox' name='recommended'" . (($row["recommended"] == "yes") ? " checked='checked'" : "" ) . " value='yes' /> Check the box to recommend the torrent.";
}


Add images to image folder

forgot no-poster image put this in images also
images.zip
Download
no-poster.png
no-poster.png
2019-04-17 08:07:47
Working. But too much gaps between images don't you think?
Screenshot_4.png
Screenshot_4.png
2019-04-17 13:38:38
it has a limit of 7 so if its less than 7 they will be spread out more
2019-04-17 14:00:15
it doesn't have scroll?
2019-04-19 03:50:47
ideally you would use jquery for scollers which isnt something im familiar with, i forgot one image so updated first post.

You can use the scoller from http://www.torrenttrader.xyz/index.php?threads/recent-torrent-scroller-ttv3.4929/
on index code change carroussel.php to recomend.php
then download carroussel.php and rename to recomend.php
in recomend.php change visible='yes' to recommended='yes'
add file to root

i have a few of these top download, freeleech, vip only etc so with jquery a class would do them all so is better, but you can do it this way by adding php files like in this post

this also works in code from 1st post find print("<table align=center cellpadding=3 cellspacing=3 width=100% border=0><tr>");
replace with
print('<marquee scrollAmount="7" onMouseover="this.scrollAmount=0" onMouseout="this.scrollAmount=3" scrolldelay="0" direction="left"><table align=center cellpadding=3 cellspacing=3 width=100% border=0><tr>');
2019-05-21 16:05:16
Thanls all! ;)
2019-05-30 16:53:51
Mini correction ;)
search torrents-edit:

if ($row["external"]!='yes' && $row["recommended"]== yes){
       print ("<b>Top Torrent: </b><font color='orange'>Recommended</font></br>");
   }


Change to:

if ($row["external"]!='yes' && $row["recommended"]== 'yes'){
       print ("<b>Top Torrent: </b><font color='orange'>Recommended</font></br>");
   }


Big thanks m-jay (y)
Unknown User
2019-10-06 10:05:01
[USER=20288]@m-jay[/USER] having sql inside while loop is never a smart idea, this code could be significantly shrinked and performance improved
2019-12-13 07:38:19
how to increase the box size? I make the images bigger but box size is not changing.
[ATTACH type="full" alt="5303"]5303[/ATTACH]
Screenshot_9.png
Screenshot_9.png
2019-12-13 09:22:30
"arne, post: 67664, member: 5":

how to increase the box size? I make the images bigger but box size is not changing.
[ATTACH type="full" alt="5303"]5303[/ATTACH]


The total size is in your <table tag, but it is already at its max 100%
for image size, search this line twice and modify it to your taste

$cat\" width='90px' height='130px'

Unknown User
2019-12-24 22:16:47
how can i add the 5 per LINE
<br>
5 per line
LIMIT 100 but 5 per LINE
You get the ideea!

nl2br_limit
Unknown User
2019-12-26 18:17:20
"extremlymtorrents, post: 67702, member: 20299":

how can i add the 5 per LINE
<br>
5 per line
LIMIT 100 but 5 per LINE
You get the ideea!

nl2br_limit

This code posted by [USER=20288]@m-jay[/USER] is not good for live site.

But if you really want it, you can do it with modulo like this


$x = 1;
while ($row2 = mysqli_fetch_array($rec)) {
$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 = mysqli_fetch_array($res);
$cat = $row['cat_name'];
if ($x % 6 === 0)
echo "</tr><tr>";
$img1 = "<a href=torrents-details.php?id=$row[id]' target='_new'><div><img id='cover_img1' class='cover_img' border='0' src='uploads/images/$row[image1]' title=\"$altname | $cat\" width='90px' height='130px'></a></div>
<div style='margin-top:10px; font-size:13px;'>
<img src=images/check.png height='14' title='Completed' border=0><font color=#0080FF> <b>".$row['times_completed']."</b></font> |
<img src=images/arrow_up.gif height='12' title='Seeders' border=0><font color=#00AA00><b>".$row['seeders']."</b></font> |
<img src=images/arrow_down.gif height='12' title='Leechers' border=0><font color=#FF0000> <b>".$row['leechers']."</b></font>
</div>";
if ($row["image1"] != ""){
print("<td align=center>".$img1."</td>");
$x++;
}
Unknown User
2019-12-26 19:39:23
[USER=20311]shadows[/USER]
U the best WORKS with some edits .. but WORKS ! Thx m8 and Merry Xmas
2020-11-08 15:43:24
...nothing for upload ?
2020-11-08 19:09:22
Thank you m-jay
Last edited by coco on 2021-05-04 18:03:08
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728