kristaps |
2nd September 2008 21:07 |
[YSE 6] Lightbox sistem in browse + upload screens with torrent
Sql
PHP Code:
ALTER TABLE `torrents` ADD `image3` TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrents` ADD `image4` TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrents` ADD `image5` TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrents` ADD `image6` TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrents` ADD `image7` TEXT CHARACTER SET cp1251 NOT NULL;
ALTER TABLE `torrents` ADD `image8` TEXT 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.image3, torrents.image4, torrents.image5, torrents.image6, torrents.image7, torrents.image8
find this
PHP Code:
tr($tracker_lang['description'], format_comment($row["descr"]), 1, 1);
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 . " " . $img4 . " " . $img5 . "  " . $img6 . " " . $img7 . " " . $img8, 1);
}
2. in upload.php find this
PHP Code:
tr($tracker_lang['images'], $tracker_lang['max_file_size'].": 500kb".$tracker_lang['avialable_formats'].": .gif .jpg .png<b>".$tracker_lang['image']." №1:</b>  <input type=file name=image0 size=80><b>".$tracker_lang['image']." №2:</b>  <input type=file name=image1 size=80>\n", 1);
after add
PHP Code:
tr("Скриншоты", $tracker_lang['max_file_size'].": 500kb".$tracker_lang['avialable_formats'].": .gif .jpg .png
<b>Скриншот №1:</b>  <input type=file name=image2 size=80>
<b>Скриншот №2:</b>  <input type=file name=image3 size=80>
<b>Скриншот №3:</b>  <input type=file name=image4 size=80>
<b>Скриншот №4:</b>  <input type=file name=image5 size=80>
<b>Скриншот №5:</b>  <input type=file name=image6 size=80>
<b>Скриншот №6:</b>  <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, $totallen, count($filelist), $type, $descr, $descr, $free, $inames[0], $inames[1], $inames[2], 0 + $_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, $totallen, count($filelist), $type, $descr, $descr, $free, $inames[0], $inames[1], $inames[2], $inames[3], $inames[4], $inames[5], $inames[6], $inames[7], 0 + $_POST["type"], $dname))) . ", '" . get_date_time() . "', '" . get_date_time() . "')");
|