Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Screenshot Request (http://www.bvlist.com/showthread.php?t=1169)

al_ltoticmat 15th October 2008 05:24

Screenshot Request
 
1 Attachment(s)
I found it: posted by Rich here Board Message !


This will allow you to add a link to your upload to display an image in details.php

Adapted to work with TBdev DR SourceCode 0.25 upwards.

In upload.php FIND
Code:

print("");
  print("");
  print("
Torrent name (Taken from filename if not specified. Please use descriptive names.)
");

ADD AFTER
Code:

print("");
  print("");
  print("
Poster CD name (Upload to BitBucket link for a poster image to be shown on the details page)
");



In takeupload.php

FIND
Code:

$nfofile = $_FILES['nfo'];
ADD BEFORE
Code:

if (!empty($_POST['poster']))
$poster = unesc($_POST['poster']);

Edit the Query to look like this
Code:

$torrent_insert_sql = sprintf("INSERT INTO torrents
                                                            (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, description, descr_parsed, category, save_as, added, last_action, nfo, inverted_timestamp, poster)
                                                            VALUES
                                                            ('%s', '%s', %u, '%s', '%s', '%s', %u, %u, '%s', '%s', '%s', '%s', '%s', %u, '%s', NOW(), NOW(), '%s', 4294967295-UNIX_TIMESTAMP(NOW()), '%s' )
                                                            ",
                                                            mysql_escape_string( searchfield($shortfname." ".$dname." ".$torrent) ),
                                                            mysql_escape_string( $fname ),
                                                            $CURUSER['id'],
                                                            'no',
                                                            mysql_escape_string($infohash),
                                                            mysql_escape_string($torrent),
                                                            $totallen,
                                                            count($filelist),
                                                            $type,
                                                            mysql_escape_string(strip_tags($descr)),
                                                            mysql_escape_string(strip_tags($descr)),
                                                            mysql_escape_string($smalldescr),
                                                            mysql_escape_string($descr_parsed),
                                                            (int) $_POST['type'],
                                                            mysql_escape_string($dname),
                                                            mysql_escape_string($nfo),
                                                            mysql_escape_string($poster)
                                                            );


In details.php
Edit the Query to look like this

Code:

$res = do_mysql_query("SELECT
                        UNIX_TIMESTAMP(torrents.added) AS ts,
                        torrents.descr_parsed,
                        torrents.completed_by,
                        torrents.seeders,
                        torrents.banned,
                        torrents.leechers,
                        torrents.info_hash,
                        torrents.filename,
                        torrents.description,
                        torrents.comments,
                        LENGTH(torrents.nfo) AS nfosz,
                        UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed,
                        torrents.numratings,
                        torrents.name,
                        IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating,
                        torrents.owner,
                        torrents.save_as,
                        torrents.descr,
                        torrents.visible,
                        torrents.size,
                        torrents.added,
                        torrents.views,
                        torrents.hits,
                        torrents.times_completed,
                        torrents.id,
                        torrents.type,
                        torrents.numfiles,
                        torrents.poster,
                        categories.name AS cat_name,
                        users.username,
                        users.anonymous
                        FROM torrents
                        LEFT JOIN categories ON torrents.category = categories.id
                        LEFT JOIN users ON torrents.owner = users.id
                        WHERE torrents.id = ".$id)    or sqlerr();

FIND
Code:

if (!empty($row["descr_parsed"]))
ADD AFTER
Code:

if (!empty($row["poster"]))
tr("Poster CD", "", 1);

In edit.php
FIND
Code:

    tr( _("Torrent name"), "", 1);
ADD AFTER
Code:

    tr( _("Poster CD"), "", 1);
In takeedit.php
FIND
Code:

$dname = $row["save_as"];
ADD AFTER
Code:

if (!empty($_POST['poster']))
$poster = unesc($_POST['poster']);

FIND
Code:

$updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'";
ADD BEFORE
Code:

$updateset[] = "poster = " . sqlesc($poster);
Run this quiery on your database
Code:

ALTER TABLE torrents ADD poster VARCHAR(255) NOT NULL
Attachment 425

Dragan3591 15th October 2008 14:03

This is a nice code, but I didn't see a thumbnail view. Did I miss it or it's showing pictures in real size?

wMan 15th October 2008 14:08

thx nice mod a better one on tbdev made by pdq with ajax


All times are GMT +2. The time now is 23:45.

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