Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=93)
-   -   [2.0.4]Poster/Screenshot mod (http://www.bvlist.com/showthread.php?t=5698)

\n";
echo "\n";
Add after
Code:

// Poster Modd
echo "
\n";
echo "
\n";
// Screen shot Mod
echo "
\n";
echo "
\n";
echo "
\n";
echo "
\n";
echo "
\n";
echo "
\n";
echo "
\n";
echo "
\n";
// End Mods

Now We Do File upload/taketorrent.php
Find
Code:

if(!isset($build)) $build = "no";
and add after
Code:

if(isset($post_img) && $post_img != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $post_img, $match))
        {
            bterror($errors,'The URL you specified For Poster is invalid.');
        }
        if (empty($match[2]))
        {
            bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$post_img = "NULL";
if(isset($screan1) && $screan1 != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $post_img, $match))
        {
            bterror($errors,'The URL you specified For Screenshot1 is invalid.');
        }
        if (empty($match[2]))
        {
            bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screan1 = "NULL";
if(isset($screan2) && $screan2 != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $post_img, $match))
        {
            bterror($errors,'The URL you specified For Screenshot2 is invalid.');
        }
        if (empty($match[2]))
        {
            bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screan2 = "NULL";
if(isset($screan3) && $screan3 != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $post_img, $match))
        {
            bterror($errors,'The URL you specified For Screenshot3 is invalid.');
        }
        if (empty($match[2]))
        {
            bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screan3 = "NULL";
if(isset($screan4) && $screan4 != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $post_img, $match))
        {
            bterror($errors,'The URL you specified For Screenshot4 is invalid.');
        }
        if (empty($match[2]))
        {
            bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screan4 = "NULL";

Now Find in the same file
Code:

$torrentfields[] = "descr";
$torrentvalues[] = "'".$descr."'";

and add after
Code:

// Poster Modd
$torrentfields[] = "post_img";
$torrentvalues[] = "'".addslashes($post_img)."'";

//ScreenShot Modd
$torrentfields[] = "screan1";
$torrentvalues[] = "'".addslashes($screan1)."'";

$torrentfields[] = "screan2";
$torrentvalues[] = "'".addslashes($screan2)."'";

$torrentfields[] = "screan3";
$torrentvalues[] = "'".addslashes($screan3)."'";

$torrentfields[] = "screan4";
$torrentvalues[] = "'".addslashes($screan4)."'";

//End mods

Now we well do ajax.php
find
Code:

        $sql = "SELECT A.id as id, 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.banned, 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;";
and make it
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;";
Find at or about line 1605
Code:

if ($torrent_global_privacy AND $user->user AND !$user->premium AND $torrent_global_privacy AND $download_level=="user" AND $torrent["owner"] != $user->id AND $torrent["private"] == "true" AND $torrent["owner"] != 0) {
        echo "
";
        switch ($flag) {
                case AUTH_PENDING: {
                        echo "
";
                        break;
                }
                case AUTH_GRANTED: {
                        echo "
";
                        break;
                }
                case AUTH_DENIED: {
                        echo "
";
                        break;
                }
                case AUTH_NONE: {
                        echo "
";
                        break;
                }
        }
        echo "
\n";
}

and add after
Code:

#Poster
if($torrent["post_img"] !=''){
echo "
\n";
echo "
\n";
echo "
\n";
}

Now fined
Code:

if (!empty($torrent["descr"])) {//Sometimes massive upload Torrents do not have description
        echo "
\n";
}

and add after
Code:

#Sceenshot
if($torrent["screan1"] !=''){
echo "
\n";
echo "
\n";
echo "
\n";
}
if($torrent["screan2"] !=''){
echo "
\n";
echo "
\n";
echo "
\n";
}
if($torrent["screan3"] !=''){
echo "
\n";
echo "
\n";
echo "
\n";
}
if($torrent["screan4"] !=''){
echo "
\n";
echo "
\n";
echo "
\n";
}

Now for language file this is only english so open language/english.php
and find the last row not commented out and add
Code:

define("_bt_poster","Poster");
define("_bt_screensa","Screenshot 1");
define("_bt_screensb","Screenshot 2");
define("_bt_screensc","Screenshot 3");
define("_bt_screensd","Screenshot 4");
define("_bt_poster_exp","(Direct link for a poster,Poster Upload " . $siteurl . ")");
define("_bt_screen_expa","(Direct link for a Screenshot 1)");
define("_bt_screen_expb","(Direct link for a Screenshot 2)");
define("_bt_screen_expc","(Direct link for a Screenshot 3)");
define("_bt_screen_expd","(Direct link for a Screenshot 4)");

joeroberts 17th November 2010 14:31

[2.0.4]Poster/Screenshot mod
 
Add a poster and Screenshots to your torrents detail's
This Mod was a request From TryHarder at seed-bytes as he prepares
for his Move to PMBT.

First off you well want to make a change to your database By running this SQL
Please remember to alter the prefix If needed
Code:

ALTER TABLE `torrent_torrents` ADD `post_img` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER `descr` ,
ADD `screan1` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER `post_img` ,
ADD `screan2` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER `screan1` ,
ADD `screan3` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER `screan2` ,
ADD `screan4` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER `screan3` ;

Now We shall start with the File upload/torrent.php
Find
Code:

echo "

"._bttorrentname."

("._btfromtorrent. ""._btdescname.")

\n

"._bt_poster."

"._bt_poster_exp."

\n

"._bt_screensa."

"._bt_screen_expa."

\n

"._bt_screensb."

"._bt_screen_expb."

\n

"._bt_screensc."

"._bt_screen_expc."

\n

"._bt_screensd."

"._bt_screen_expd."

\n

"._btauthstatus."

"._btdwauthpending."

"._btdwauthgranted."

"._btdwauthdenied."

"._btdwauthnorequest."



"._bt_poster."



"._btdescription."

".($user->admin ? "" . pic("edit.gif","",_btalt_edit) ."" : "");
        if ($descript != strip_tags($descript)) //Means it is written in HTML
                echo $descript;
        else
                echo "

".str_replace("\n","",$descript)."

";
        echo "


"._bt_screensa."

Click Here For Full Size




"._bt_screensb."

Click Here For Full Size




"._bt_screensc."

Click Here For Full Size




"._bt_screensd."

Click Here For Full Size



daffy 17th November 2010 15:55

I asked about this Months ago, Nice work joe buddy :D now i can work on more stuff to go with this .:drink:

p.s is there a reason you spellt screen -> screan ?

joeroberts 17th November 2010 16:01

Quote:

Originally Posted by daffy (Post 25709)
p.s is there a reason you spellt screen -> screan ?

it was late when I did the mod :unknown:

daffy 17th November 2010 16:15

no problem, iv correctd them anyway.

Giorgatzelos 18th November 2010 19:47

ok but, at about what line?

Quote:

Now we well do ajax.php
find
Code:
PHP Code:

$sql "SELECT A.id as id, 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.banned, 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;"

and make it......

daffy 18th November 2010 20:45

Quote:

Originally Posted by Giorgatzelos (Post 25757)
ok but, at about what line?

does your word/notepad not hav a search function? i believe they do,
mine tells me it is on line 1439, yours will be roundabouts there.

\n";
and add after
Code:

                echo "
\n";
                echo "
\n";
                echo "
\n";
                echo "
\n";
                echo "
\n";
joeroberts 21st November 2010 17:37

here is the edit part
open edit.php and find
Code:

                else $owner = $original_owner;
and add after
Code:

if(isset($post_img) && $post_img != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $post_img, $match))
        {
            $errmsg[] ='The URL you specified For Poster is invalid.';
        }
        elseif (empty($match[2]))
        {
            $errmsg[] ='The URL you specified is not a (gif|jpg|jpeg|png).';
        }
        else
        $post_img = "'" . addslashes($post_img) . "'";
}
else
$post_img = "NULL";
if(isset($screensa) && $screensa != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $screensa, $match))
        {
            $errmsg[] ='The URL you specified For Screenshot1 is invalid.';
        }
        elseif (empty($match[2]))
        {
            $errmsg[] ='The URL you specified is not a (gif|jpg|jpeg|png).';
        }
        else
        $screensa = "'" . addslashes($screensa) . "'";
}
else
$screensa = "NULL";
if(isset($screensb) && $screensb != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $screensb, $match))
        {
            $errmsg[] ='The URL you specified For Screenshot2 is invalid.';
        }
        elseif (empty($match[2]))
        {
            $errmsg[] ='The URL you specified is not a (gif|jpg|jpeg|png).';
        }
        else
        $screensb = "'" . addslashes($screensb) . "'";
}
else
$screensb = "NULL";
if(isset($screensc) && $screensc != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $screensc, $match))
        {
            $errmsg[] ='The URL you specified For Screenshot3 is invalid.';
        }
        elseif (empty($match[2]))
        {
            $errmsg[] ='The URL you specified is not a (gif|jpg|jpeg|png).';
        }
        else
        $screensc = "'" . addslashes($screensc) . "'";
}
else
$screensc = "NULL";
if(isset($screensd) && $screensd != ''){
        if (!preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i', $screensd, $match))
        {
            $errmsg[] ='The URL you specified For Screenshot4 is invalid.';
        }
        elseif (empty($match[2]))
        {
            $errmsg[] ='The URL you specified is not a (gif|jpg|jpeg|png).';
        }
        else
        $screensd = "'" . addslashes($screensd) . "'";
}
else
$screensd = "NULL";

now find
Code:

              $sql = "UPDATE ".$db_prefix."_torrents SET name = '".$namex."', exeem = '".$exeem."', descr = '".$descr."', category = '".$torrent_category."', ownertype = '".$ownertype."', owner = '".$owner."', password = ".$password.", banned = '".$banned."', nuked = '".$nuked."', ratiobuild = '".$build."', nukereason='".$nukereason."', evidence = '".$evidence."', imdb = '".$imdblink."' WHERE id = '".$id."';";
and make it
Code:

              $sql = "UPDATE ".$db_prefix."_torrents SET
              name = '".$namex."',
              exeem = '".$exeem."',
              descr = '".$descr."',
              post_img = ".$post_img.",
              screan1 = ".$screensa.",
              screan2 = ".$screensb.",
              screan3 = ".$screensc.",
              screan4 = ".$screensd.",
              category = '".$torrent_category."',
              ownertype = '".$ownertype."',
              owner = '".$owner."',
              password = ".$password.",
              banned = '".$banned."',
              nuked = '".$nuked."',
              ratiobuild = '".$build."',
              imdb = '".$imdblink."', 
              nukereason='".$nukereason."',
              evidence = '".$evidence."' WHERE id = '".$id."';";

Now find
Code:

                echo "

IMDB Link

\n

"._bt_poster." :

\n

"._bt_screensa."

\n

"._bt_screensb."

\n

"._bt_screensc."

\n

"._bt_screensd."

\n

\n");
                        }else{
                                print("\n");
                        }
            }
                   
        }

        print("
daffy 22nd November 2010 04:28

latest posters
 
1 Attachment(s)
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");
}

http://www.place2bscene.co.uk/UserFiles/daffy/la.jpg

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

Code:


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("");

        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 = "\"$altname

screen Shots:


', CENTER, HEIGHT, 250, WIDTH, 300);\" onmouseout=\"return nd();\">S $seed and L $leech ";
                        $img2 = "\"$altname

screen Shots:


Sorry no screens available
', CENTER, HEIGHT, 250, WIDTH, 300);\" onmouseout=\"return nd();\">
S $seed and L $leech ";
            if ($row["post_img"] != ""){
                        if ($row["screen1"]!=''){
                print("
". $img1 ."
\n
". $img2 ."
\n
");


    //}

        ?>
       
       
        }
CloseTable();
?>
screen:
http://www.place2bscene.co.uk/UserFiles/daffy/la2.jpg

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 "

\n";
echo "

"._bt_screensa."

Click Here For Full Size\n";
echo "

\n";
}
if($torrent["screan2"] !=''){
echo "

\n";
echo "

"._bt_screensb."

Click Here For Full Size\n";
echo "

\n";
}
if($torrent["screan3"] !=''){
echo "

\n";
echo "

"._bt_screensc."

Click Here For Full Size\n";
echo "

\n";
}
if($torrent["screan4"] !=''){
echo "

\n";
echo "

"._bt_screensd."

Click Here For Full Size\n";
echo "

\n";
}



Add Below


Code:

if ($torrent["imdb"]=='') {
print("

IMDB:

No Imdb Link Available");
}else{
print("

IMDB:

\n");

}

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

oh and put image into images/
http://i53.tinypic.com/2r4ik9u.gif
hackajack 19th December 2011 14:00

Hey guys

First off, thank you for an amazing bittorrent package. It has been an absolute breeze setting it up and all the included features are really great. My only request would be an easier way to upload images. Currently we have to use the image bucket to upload a picture and then reference the location in the description field with [IMG]sitename/username/image.jpg[/IMG]

I just found this thread and applied all the code changes but it looks like the mod only allows for image location via url. Is there anyway to modify this to allow clients to browse their local machine for the image to upload? Could that image location then be auto populated at the bottom of the description window?

Thanks so much

joeroberts 19th December 2011 15:17

go to admin->image-bucket and you can set it up there the link for uploading well appear under the description box in upload


All times are GMT +2. The time now is 08:28.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.