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
Make your Index.php Attractive !
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2014-06-21 18:58:29
 
<?php
//
//  TorrentTrader v2.x
//      $LastChangedDate: 2011-11-17 00:13:07 +0000 (Thu, 17 Nov 2011) $
//      $LastChangedBy: dj-howarth1 $
//
//      http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn(true);
 
 
stdhead(T_("HOME"));
 
 
?>
<style type="text/css">
.tag_cloud
{padding: 7px; text-decoration: bold;
font-family: Verdana,Arial,Helvetica,sans-serif; }
tag_cloud:link { color: #111111; text-decoration:none;}
.tag_cloud:visited { color: #004dff; }
.tag_cloud:hover { color: #805000; }
.tag_cloud:active { color: #805000; background: #777; }
</style>
 
 
<div id="wrapper" style="width:99%;border:1px dotted #ddd;background-color: #fdeef4;">
<?php
//print out the tag cloud
require_once "backend/searchcloud_functions.php";
print cloud();
?>
</div><br /><br />
 
<?php
 
end_block();
 
 
 
?>
<?php
include "social.php"
?>
<?php
end_frame();
// End Social
 
//check
if (file_exists("check.php") && $CURUSER["class"] == 7){
show_error_msg("WARNING", "Check.php still exists, please delete or rename the file as it could pose a security risk<br /><br /><a href='check.php'>View Check.php</a> - Use to check your config!<br /><br />",0);
}
 
//Site Notice
if ($site_config['SITENOTICEON']){
begin_frame(T_("NOTICE"));
echo $site_config['SITENOTICE'];
end_frame();
}
 
// Latest Posters
if (!$site_config["MEMBERSONLY"] || $CURUSER) {
begin_frame(T_("Most Popular Torrents"));
$rec = SQL_Query_exec("SELECT id, name, added, image1, seeders, leechers, times_completed FROM torrents WHERE banned ='no' AND visible='yes' ORDER BY torrents.id DESC LIMIT 42");
if (mysql_num_rows($rec) > 0) {
print("<marquee scrollAmount=0 onmouseover=this.scrollAmount=0 onmouseout=this.scrollAmount=0 scrolldelay=0 behavior=alternate direction=left><table align=left cellpadding=4 cellspacing=7 width=100% border=0 class=marquee id=mycrawler2><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=144 height=220></a>
<div style='margin-top:6px;  font: Arial 14px;'>
<img src=images/check.gif height='12' width='12' title='Completed' border=0><align=center><font color=darkgreen>".$row['times_completed']."</font>|
<img src=images/arrow_up.gif height='11'  width='11' title='Seeders' border=0><align=center> <font color=green>".$row['seeders']."</font>| 
<img src=images/arrow_down.gif height='11' width='11' title='Leechers' border=0><text-align=center><font color=red>".$row['leechers']."</font>|
 
</div>";
if ($row["image1"] != ""){
print("<td align=left>".$img1."</td>");
}
}
print("</tr></table></marquee>");
}
 
end_frame();
}
 
 
//Site News
if ($site_config['NEWSON'] && $CURUSER['view_news'] == "yes"){
begin_frame(T_("NEWS"));
$res = SQL_Query_exec("SELECT news.id, news.title, news.added, news.body, users.username FROM news LEFT JOIN users ON news.userid = users.id ORDER BY added DESC LIMIT 10");
if (mysql_num_rows($res) > 0){
print("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>n<ul>");
$news_flag = 0;
 
while($array = mysql_fetch_assoc($res)){
 
            if (!$array["username"])
                 $array["username"] = T_('UNKNOWN_USER');
 
$numcomm = get_row_count("comments", "WHERE news='".$array['id']."'");
 
// Show first 2 items expanded
if ($news_flag < 2) {
$disp = "block";
$pic = "minus";
} else {
$disp = "none";
$pic = "plus";
}
 
print("<br /><a href="javascript: klappe_news('a".$array['id']."')"><img border="0" src="".$site_config["SITEURL"]."/images/$pic.gif" id="pica".$array['id']."" alt="Show/Hide" />");
print(" <b>". $array['title'] . "</b></a> - <b>".T_("POSTED").":</b> " . date("d-M-y", utc_to_tz_time($array['added'])) . " <b>".T_("BY").":</b> $array[username]");
 
print("<div id="ka".$array['id']."" style="display: $disp;"> ".format_comment($array["body"])." <br /><br />".T_("COMMENTS")." (<a href='comments.php?type=news&id=".$array['id']."'>".number_format($numcomm)."</a>)</div><br /> ");
 
$news_flag++;
}
print("</ul></td></tr></table>n");
}else{
echo "<br /><b>".T_("NO_NEWS")."</b>";
}
end_frame();
}
 
// latest torrents
begin_frame(T_("LATEST_TORRENTS"));
print("<br /><center><font size=3><b><a href='torrents.php'>".T_("BROWSE_TORRENTS")."</a> - <a href='torrents-search.php'>".T_("SEARCH_TORRENTS")."</a></b></font size></center><br />");
print("<br /><left><font size=4><b><a href='torrents.php'>".T_("LATEST_TORRENTS")."</a></b></font size></center><br />");
 
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<br /><br /><center><b>".T_("BROWSE_MEMBERS_ONLY")."</b></center><br /><br />";
} else {
$query = "SELECT torrents.id, torrents.anon, torrents.announce, 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.safe ,torrents.external, torrents.freeleech, categories.name AS cat_name, categories.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes'  AND safe='yes' AND banned = 'no' ORDER BY id DESC LIMIT 20";
$res = SQL_Query_exec($query);
if (mysql_num_rows($res)) {
torrenttable($res);
}else {
        
     print("<div class='f-border'>");
     print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
     print("<div>");
     print T_("NO_UPLOADS");
     print("</div>");
     print("</div>");
 
}
if ($CURUSER)
SQL_Query_exec("UPDATE users SET last_browse=".gmtime()." WHERE id=$CURUSER[id]");
 
}
end_frame();
 
// Popular Torrents
begin_frame(T_("Popular Torrents"));
 
print("<br /><center><font size=3><b><a href='torrents.php'>".T_("BROWSE_TORRENTS")."</a> - <a href='torrents-search.php'>".T_("SEARCH_TORRENTS")."</a></b></font size></center><br />");
 
//Movies
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Movies'>".T_("Movies Torrents")."</a></b></font size></center><br />");
 
 
    $mov = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'MOVIES'  ORDER BY id DESC LIMIT 15";
 
    $mo =SQL_Query_exec($mov ) or die(mysql_error());
 
    if (mysql_num_rows($mo)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($mo);
                                       
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
end_frame();
 
//Mobile
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Mobile'>".T_("Mobile Torrents")."</a></b></font size></center><br />");
    $mobile = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'Mobile'  ORDER BY id DESC LIMIT 10";
 
    $m =SQL_Query_exec($mobile) or die(mysql_error());
 
    if (mysql_num_rows($m)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($m);
 
    }else {
   
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
 
//Games
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=games'>".T_("Games Torrents")."</a></b></font size></center><br />");
 
 
    $games = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'Games'  ORDER BY id DESC LIMIT 10";
 
    $games =SQL_Query_exec($games ) or die(mysql_error());
 
    if (mysql_num_rows($games)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($games);
                                       
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
end_frame();
 
//Books
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Books'>".T_("Books Torrents")."</a></b></font size></center><br />");
    $books = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat='Books'  ORDER BY id DESC LIMIT 10";
 
    $books =SQL_Query_exec($books) or die(mysql_error());
 
    if (mysql_num_rows($books)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($books);
                                       
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
 
//XXX
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=XXX'>".T_("Adult Torrents")."</a></b></font size></center><br />");
    $xx = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat='XXX'  ORDER BY id DESC LIMIT 10";
 
    $xx =SQL_Query_exec($xx) or die(mysql_error());
 
    if (mysql_num_rows($xx)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($xx);
                                       
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
 
//Music
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Music'>".T_("Music Torrents")."</a></b></font size></center><br />");
 
 
    $music = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'Music'  ORDER BY id DESC LIMIT 10";
 
    $music =SQL_Query_exec($music ) or die(mysql_error());
 
    if (mysql_num_rows($music)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($music);
                                       
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='105%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
end_frame();
 
 
//Applications
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Apps'>".T_("Applications Torrents")."</a></b></font size></center><br />");
    $apps = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'Apps'  ORDER BY id DESC LIMIT 10";
 
    $app =SQL_Query_exec($apps) or die(mysql_error());
 
    if (mysql_num_rows($app)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($app);
 
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
 
 
 
//TV
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=TV'>".T_("TV Shows Torrents")."</a></b></font size></center><br />");
 
 
    $tv = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'TV'  ORDER BY id DESC LIMIT 10";
 
    $tv =SQL_Query_exec($tv ) or die(mysql_error());
 
    if (mysql_num_rows($tv)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($tv);
                                       
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
end_frame();
 
 
 
 
//Anime
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Apps'>".T_("Anime Torrents")."</a></b></font size></center><br />");
$anime = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'Anime'  ORDER BY id DESC LIMIT 10";
 
    $a =SQL_Query_exec($anime) or die(mysql_error());
 
    if (mysql_num_rows($a)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($a);
 
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
 
 
 
 
 
//Other
print("<br /><left><font size=4><b><a href='torrents.php?parent_cat=Other'>".T_("Other Torrents")."</a></b></font size></center><br />");
$other = "SELECT torrents.id, torrents.anon, torrents.announce, 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.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' AND categories.parent_cat= 'Other'  ORDER BY id DESC LIMIT 10";
 
    $ot =SQL_Query_exec($other) or die(mysql_error());
 
    if (mysql_num_rows($ot)) {
        echo'<font size="4">';
        echo '</font>';
        torrenttable($ot);
 
    }else {
 
    print("<div class='f-border'>");
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");
    print("<div>");
    print T_("NO_UPLOADS");
    print("</div>");
    print("</div>");
 
    }
end_frame();
 
 
 
 
//check permissions
if ($site_config["MEMBERSONLY"]){
 
if($CURUSER["view_torrents"]=="no")
show_error_msg("Error","You do not have permission to view torrents",1);
}
// Dont Edit 
 
if ($site_config['DISCLAIMERON']){
begin_frame(T_("DISCLAIMER"));
echo T_("DISCLAIMERTXT");
end_frame();
}
 
stdfoot();
 
?>

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=7036"]index.php[/url]

[ATTACH]2319._xfImport[/ATTACH]
index.php
Download
Unknown User
2014-06-26 17:59:55
lol any screenshots ?
Unknown User
2014-10-16 06:11:10
This is cool but only try this if you are not worried about high server loads on high traffic sites like public trackers.

Here is my reason, Popular torrents alone uses about 10 queries from database.. So if you have about 1000 users on index page... alone.. just Popular torrents will have to make 10,000 queries and thats not only query on index page.

You can either rewrite everything to use just two queries or cache the contents in each query for optimization purposes.

There is a guide in tutorials section to do this...
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728