View Single Post
  #1  
Old 2nd September 2008, 21:07
kristaps's Avatar
kristaps kristaps is offline
Senior Member
 
Join Date: Aug 2008
Posts: 29
Default [YSE 6] Lightbox sistem in browse + upload screens with torrent
Sql

PHP Code:
ALTER TABLE `torrentsADD `image3TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrentsADD `image4TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrentsADD `image5TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrentsADD `image6TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrentsADD `image7TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrentsADD `image8TEXT CHARACTER SET cp1251 NOT NULL
details.php find

PHP Code:
stdhead($tracker_lang['torrent_details']." \"" $row["name"] . "\""); 
after add

PHP Code:
?>
<script type="text/javascript" src="lightbox/jquery.js"></script>
<link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="lightbox/lightbox.js"></script>
<script type="text/javascript">
$(function() {$('a[@rel*=lightbox]').lightBox();});
</script>
<?
then find this query

PHP Code:
$res sql_query("SELECT torrents.free, torrents.free_who, torrents.seeders, categories.id AS cat_id, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, 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.image1, torrents.image2, categories.name AS cat_name, users.username, groups.image FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN groups ON users.groups = groups.id WHERE torrents.id = $id"
and add this

PHP Code:
torrents.image3torrents.image4torrents.image5,  torrents.image6torrents.image7torrents.image8 
find this

PHP Code:
tr($tracker_lang['description'], format_comment($row["descr"]), 11); 
after add this

PHP Code:
if ($row["image3"] != "" OR $row["image4"] != "" OR $row["image5"] != "" OR $row["image6"] != "" OR $row["image7"] != "" OR $row["image8"] != "") {
                  if (
$row["image3"] != "")
                    
$img3 "<a href=\"torrents/images/$row[image3]\" rel=\"lightbox\"><img border='0' width=80 src='torrents/images/$row[image3]' /></a>";
                  if (
$row["image4"] != "")
            
$img4 "<a href=\"torrents/images/$row[image4]\" rel=\"lightbox\"><img border='0' width=80 src='torrents/images/$row[image4]' /></a>";
                  if (
$row["image5"] != "")
            
$img5 "<a href=\"torrents/images/$row[image5]\" rel=\"lightbox\"><img border='0' width=80 src='torrents/images/$row[image5]' /></a>";
                  if (
$row["image6"] != "")
            
$img6 "<a href=\"torrents/images/$row[image6]\" rel=\"lightbox\"><img border='0' width=80 src='torrents/images/$row[image6]' /></a>";
                  if (
$row["image7"] != "")
            
$img7 "<a href=\"torrents/images/$row[image7]\" rel=\"lightbox\"><img border='0' width=80 src='torrents/images/$row[image7]' /></a>";                   if ($row["image8"] != "")
            
$img8 "<a href=\"torrents/images/$row[image8]\" rel=\"lightbox\"><img border='0' width=80 src='torrents/images/$row[image8]' /></a>";

                  
tr("Скриншоты"$img3 "&nbsp" $img4 "&nbsp" $img5 "&nbsp&nbsp" $img6 "&nbsp" $img7 "&nbsp" $img8,  1);
 } 

2. in upload.php find this

PHP Code:
tr($tracker_lang['images'], $tracker_lang['max_file_size'].": 500kb<br />".$tracker_lang['avialable_formats'].": .gif .jpg .png<br /><b>".$tracker_lang['image']." №1:</b>&nbsp&nbsp<input type=file name=image0 size=80><br /><b>".$tracker_lang['image']." №2:</b>&nbsp&nbsp<input type=file name=image1 size=80>\n"1); 
after add

PHP Code:
tr("Скриншоты"$tracker_lang['max_file_size'].": 500kb<br />".$tracker_lang['avialable_formats'].": .gif .jpg .png<br />
<b>Скриншот №1:</b>&nbsp&nbsp<input type=file name=image2 size=80><br />
<b>Скриншот №2:</b>&nbsp&nbsp<input type=file name=image3 size=80><br />
<b>Скриншот №3:</b>&nbsp&nbsp<input type=file name=image4 size=80><br />
<b>Скриншот №4:</b>&nbsp&nbsp<input type=file name=image5 size=80><br />
<b>Скриншот №5:</b>&nbsp&nbsp<input type=file name=image6 size=80><br />
<b>Скриншот №6:</b>&nbsp&nbsp<input type=file name=image7 size=80>\n"
1); 

3 in takeupload.php find

PHP Code:
$ret sql_query("INSERT INTO torrents (search_text, filename, owner, visible, sticky, info_hash, name, size, numfiles, type, descr, ori_descr, free, image1, image2, category, save_as, added, last_action) VALUES (" implode(","array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname$CURUSER["id"], "no"$sticky$infohash$torrent$totallencount($filelist), $type$descr$descr$free$inames[0], $inames[1], $inames[2], $_POST["type"], $dname))) . ", '" get_date_time() . "', '" get_date_time() . "')"); 
change with this

PHP Code:
$ret sql_query("INSERT INTO torrents (search_text, filename, owner, visible, sticky, info_hash, name, size, numfiles, type, descr, ori_descr, free, image1, image2, image3, image4, image5, image6, image7, image8, category, save_as, added, last_action) VALUES (" implode(","array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname$CURUSER["id"], "no"$sticky$infohash$torrent$totallencount($filelist), $type$descr$descr$free$inames[0], $inames[1], $inames[2], $inames[3], $inames[4], $inames[5], $inames[6], $inames[7], $_POST["type"], $dname))) . ", '" get_date_time() . "', '" get_date_time() . "')"); 
Reply With Quote
The Following 2 Users Say Thank You to kristaps For This Useful Post:
look (26th March 2012), wxlg1117 (4th September 2009)