View Single Post
  #8  
Old 22nd November 2010, 04:28
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default latest posters
be nice to have a latest images block for this to.....
Updated: some time later.... hahaha

here goes latest images with Seeds and Leechs stats.
Thanks to joe on this one. add attached to blocks

add below where want it to show. index.php or blocks/usercp.php

Code:
if ($user->user) {
include("blocks/latestimages_block.php");
}
Click the image to open in full size.

user code below for horizontal (center of site) instead of vertical (side of site)

Code:
<?php

if (!defined('IN_PMBT')) die ("You can't access this file directly");

OpenTable("Latest Posters");


    $news = mysql_query("SELECT id, name, added, post_img FROM ".$db_prefix."_torrents WHERE banned = 'no' AND visible='yes'")or sqlerr(__FILE__, __LINE__);

    if (mysql_num_rows($news) > 0) {

        print("<table align=center cellpadding=0 cellspacing=0 width=100% border=0>");

        while ($row2 = mysql_fetch_array($news)) {
            $tor = $row2['0'];
            $altname = $row2['1'];
            //$date_time=get_date_time(time()-(3600*168)); // the 24 is the hours you want listed change by whatever you want
            $orderby = "ORDER BY ".$db_prefix."_torrents.id DESC"; //Order

            $limit = "LIMIT 100"; //Limit

            $where = "WHERE banned = 'no' AND visible='yes' AND ".$db_prefix."_torrents.id='$tor'";

            $res = mysql_query("SELECT ".$db_prefix."_torrents.id, ".$db_prefix."_torrents.seeders, ".$db_prefix."_torrents.leechers, ".$db_prefix."_torrents.post_img, ".$db_prefix."_torrents.screen1, ".$db_prefix."_torrents.screen2, ".$db_prefix."_torrents.screen3, ".$db_prefix."_torrents.screen4, ".$db_prefix."_torrents.added, ".$db_prefix."_categories.name AS cat_name FROM ".$db_prefix."_torrents LEFT JOIN ".$db_prefix."_categories ON ".$db_prefix."_torrents.category = ".$db_prefix."_categories.id $where  $orderby $limit")or sqlerr(__FILE__, __LINE__);
            $row = mysql_fetch_array($res);

            $cat = $row['cat_name'];
            $seed =$row['seeders'];
            $leech =$row['leechers'];
                        $simg1 = $row['screen1'];
                        $simg2 = $row['screen2'];
                        $simg3 = $row['screen3'];
                        $simg4 = $row['screen4'];
            $img1 = "<a href='$siteurl/details.php?id=$row[id]'><img border='0' src='$row[post_img]' alt=\"$altname / $cat\" width='130' onmouseover=\" return overlib('<center><h1><b>screen Shots:</b></h1></center><hr><table width=100%><br><tr><td><img src=$simg1 width=250 border=0></td><td><img src=$simg2 width=250 border=0><img src=$simg3 width=250 border=0><img src=$simg4 width=250 border=0></td></tr></table>', CENTER, HEIGHT, 250, WIDTH, 300);\" onmouseout=\"return nd();\"></a><br><font color=\"green\"><b>S</font> $seed</b> and <font color=\"red\"><b>L</font> $leech </b><br>";
                        $img2 = "<a href='$siteurl/details.php?id=$row[id]'><img border='0' src='$row[post_img]' alt=\"$altname / $cat\" width='130' onmouseover=\" return overlib('<center><h1><b>screen Shots:</b></h1></center><hr><table width=100%><br><br><br><br><br><tr><td><center><font color=red size=4><b>Sorry no screens available</b></font></center></td></tr></table>', CENTER, HEIGHT, 250, WIDTH, 300);\" onmouseout=\"return nd();\"></a><br><font color=\"green\"><b>S</font> $seed</b> and <font color=\"red\"><b>L</font> $leech </b><br>";
            if ($row["post_img"] != ""){
                        if ($row["screen1"]!=''){
                print("<td style=\"text-align: center;\">". $img1 ."<BR>\n</td>\n");
                        }else{
                                print("<td style=\"text-align: center;\">". $img2 ."<BR>\n</td>\n");
                         }
            }
                     
        }

        print("</tr></table>");


    //}

        ?>
        </div>
        </div>
        <?php
}
CloseTable();
?>
screen:
Click the image to open in full size.

Bump: ok this is to add IMDB link in details. find below in ajax.php (i am going off if you have above installed, if not, im sure youl see where to place the line

Code:
        $sql = "SELECT A.id as id,A.post_img,A.screan1,A.screan2,A.screan3,A.screan4, A.exeem, A.seeders, A.leechers, A.tot_peer, A.speed, A.info_hash, A.filename, A.banned, A.nuked, A.nukereason, A.password, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(A.last_action) AS lastseed, A.numratings, A.name, IF(A.numratings < '".$minvotes."', NULL, ROUND(A.ratingsum / A.numratings, 1)) AS rating, A.save_as, A.descr, A.visible, A.size, A.plen, A.added, A.views, A.downloaded, A.completed, A.type, A.private, A.min_ratio, A.numfiles, A.owner, A.ownertype, A.complaints, A.evidence, A.tracker, A.tracker_list, A.dht as dht, A.md5sum as md5sum, A.uploader_host as user_host, B.name AS cat_name, IF(C.name IS NULL, C.username, C.name) as ownername, A.tracker_update, COUNT(S.status) as auths FROM ".$db_prefix."_torrents A LEFT JOIN ".$db_prefix."_categories B ON A.category = B.id LEFT JOIN ".$db_prefix."_users C ON A.owner = C.id LEFT JOIN ".$db_prefix."_privacy_file S ON S.torrent = A.id AND S.status = 'pending' WHERE A.id = '".$_GET['torrent']."' GROUP BY A.id LIMIT 1;";
Make IT
Code:
        $sql = "SELECT A.id as id,A.post_img,A.screan1,A.screan2,A.screan3,A.screan4, A.imdb, A.exeem, A.seeders, A.leechers, A.tot_peer, A.speed, A.info_hash, A.filename, A.banned, A.nuked, A.nukereason, A.password, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(A.last_action) AS lastseed, A.numratings, A.name, IF(A.numratings < '".$minvotes."', NULL, ROUND(A.ratingsum / A.numratings, 1)) AS rating, A.save_as, A.descr, A.visible, A.size, A.plen, A.added, A.views, A.downloaded, A.completed, A.type, A.private, A.min_ratio, A.numfiles, A.owner, A.ownertype, A.complaints, A.evidence, A.tracker, A.tracker_list, A.dht as dht, A.md5sum as md5sum, A.uploader_host as user_host, B.name AS cat_name, IF(C.name IS NULL, C.username, C.name) as ownername, A.tracker_update, COUNT(S.status) as auths FROM ".$db_prefix."_torrents A LEFT JOIN ".$db_prefix."_categories B ON A.category = B.id LEFT JOIN ".$db_prefix."_users C ON A.owner = C.id LEFT JOIN ".$db_prefix."_privacy_file S ON S.torrent = A.id AND S.status = 'pending' WHERE A.id = '".$_GET['torrent']."' GROUP BY A.id LIMIT 1;";
now find below

Code:
#Sceenshot
if($torrent["screan1"] !=''){
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
echo "<tr><td><p>"._bt_screensa."</p></td><td><a href=\"".stripslashes($torrent["screan1"])."\" title=\"Click For Full Size\"><img src=\"".stripslashes($torrent["screan1"])."\" width=\"300\" border=\"0\"><br>Click Here For Full Size</a></td></tr>\n";
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
}
if($torrent["screan2"] !=''){
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
echo "<tr><td><p>"._bt_screensb."</p></td><td><a href=\"".stripslashes($torrent["screan2"])."\" title=\"Click For Full Size\"><img src=\"".stripslashes($torrent["screan2"])."\" width=\"300\" border=\"0\"><br>Click Here For Full Size</a></td></tr>\n";
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
}
if($torrent["screan3"] !=''){
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
echo "<tr><td><p>"._bt_screensc."</p></td><td><a href=\"".stripslashes($torrent["screan3"])."\" title=\"Click For Full Size\"><img src=\"".stripslashes($torrent["screan3"])."\" width=\"300\" border=\"0\"><br>Click Here For Full Size</a></td></tr>\n";
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
}
if($torrent["screan4"] !=''){
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
echo "<tr><td><p>"._bt_screensd."</p></td><td><a href=\"".stripslashes($torrent["screan4"])."\" title=\"Click For Full Size\"><img src=\"".stripslashes($torrent["screan4"])."\" width=\"300\" border=\"0\"><br>Click Here For Full Size</a></td></tr>\n";
echo "<tr><td><HR SIZE=1 NOSHADE></td><td><HR SIZE=1 NOSHADE></td></tr>\n";
}


Add Below


Code:
if ($torrent["imdb"]=='') {
print("<tr><td><p>IMDB:</p></td><td>No Imdb Link Available</td></tr>");
}else{
print("<tr><td><p>IMDB:</p></td><td><a href=".$torrent['imdb']." target=_blank><img src=images/simdb.gif border=0 ></a></tr></tr>\n");

}
Thats it (dont forget this is in 2 places in ajax.php

oh and put image into images/
Click the image to open in full size.
Attached Files
File Type: php latestimages_block.php (5.4 KB, 5 views)
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details
Reply With Quote