| Lutik89 | Дата: Четверг, 27.08.2009, 00:26 | Сообщение # 1 |
 Рядовой
Группа: Пользователи
Сообщений: 3
Статус: Offline
| запрос в БД 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; 1. details.php найти Code stdhead($tracker_lang['torrent_details']." \"" . $row["name"] . "\""); после вставить 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> <? в запрос 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") добавляем Code torrents.image3, torrents.image4, torrents.image5, torrents.image6, torrents.image7, torrents.image8 Добавлено (27.08.2009, 00:01) --------------------------------------------- ищем Code tr($tracker_lang['description'], format_comment($row["descr"]), 1, 1); ниже вставляем 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); } Добавлено (27.08.2009, 00:02) --------------------------------------------- 2.upload.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>  <input type=file name=image0 size=80><br /><b>".$tracker_lang['image']." №2:</b>  <input type=file name=image1 size=80>\n", 1); после вставляем Code tr("Скриншоты", $tracker_lang['max_file_size'].": 500kb<br />".$tracker_lang['avialable_formats'].": .gif .jpg .png<br /> <b>Скриншот №1:</b>  <input type=file name=image2 size=80><br /> <b>Скриншот №2:</b>  <input type=file name=image3 size=80><br /> <b>Скриншот №3:</b>  <input type=file name=image4 size=80><br /> <b>Скриншот №4:</b>  <input type=file name=image5 size=80><br /> <b>Скриншот №5:</b>  <input type=file name=image6 size=80><br /> <b>Скриншот №6:</b>  <input type=file name=image7 size=80>\n", 1); 3.takeupload.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() . "')"); заменяем на 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() . "')"); Добавлено (27.08.2009, 00:07) --------------------------------------------- edit.php Code tr($tracker_lang['images'], "<input type=radio name=img1action value='keep' checked>Оставить Постер  "."<input type=radio name=img1action value='delete'>Удалить Постер  "."<input type=radio name=img1action value='update'>Обновить Постер<br /><b>Постер:</b>  <input type=file name=image0 size=80> <br /><br /> <input type=radio name=img2action value='keep' checked>Оставить скриншот №1  "."<input type=radio name=img2action value='delete'>Удалить скриншот №1  "."<input type=radio name=img2action value='update'>Обновить скриншот №1<br /><b>Скриншот №1:</b>  <input type=file name=image1 size=80><br /><br /> <input type=radio name=img3action value='keep' checked>Оставить скриншот №2  "."<input type=radio name=img3action value='delete'>Удалить скриншот №2  "."<input type=radio name=img3action value='update'>Обновить скриншот №2<br /><b>Скриншот №2:</b>  <input type=file name=image2 size=80><br /><br /> <input type=radio name=img4action value='keep' checked>Оставить скриншот №3  "."<input type=radio name=img4action value='delete'>Удалить скриншот №3  "."<input type=radio name=img4action value='update'>Обновить скриншот №3<br /><b>Скриншот №3:</b>  <input type=file name=image3 size=80><br /><br /> <input type=radio name=img5action value='keep' checked>Оставить скриншот №4  "."<input type=radio name=img5action value='delete'>Удалить скриншот №4  "."<input type=radio name=img5action value='update'>Обновить скриншот №4<br /><b>Скриншот №4:</b>  <input type=file name=image4 size=80><br /><br /> <input type=radio name=img6action value='keep' checked>Оставить скриншот №5  "."<input type=radio name=img6action value='delete'>Удалить скриншот №1  "."<input type=radio name=img6action value='update'>Обновить скриншот №1<br /><b>Скриншот №5:</b>  <input type=file name=image5 size=80><br /><br /> <input type=radio name=img7action value='keep' checked>Оставить скриншот №6  "."<input type=radio name=img7action value='delete'>Удалить скриншот №6  "."<input type=radio name=img7action value='update'>Обновить скриншот №6<br /><b>Скриншот №6:</b>  <input type=file name=image6 size=80>", 1); Добавлено (27.08.2009, 00:11) --------------------------------------------- takeedit.php ищем Code $res = sql_query("SELECT owner, filename, save_as, image1, image2 FROM torrents WHERE id = $id"); меняем на Code $res = sql_query("SELECT owner, filename, save_as, image1, image2, image3, image4, image5, image6, image7 FROM torrents WHERE id = $id"); ищем Code $img2action = $_POST['img2action']; if ($img2action == "update") $updateset[] = "image2 = " .sqlesc(uploadimage(1, $row[image2], $id)); if ($img2action == "delete") { if ($row[image2]) { $del = unlink("torrents/images/$row[image2]"); $updateset[] = "image2 = ''"; } } Добавлено (27.08.2009, 00:11) --------------------------------------------- после вставляем Code $img3action = $_POST['img3action']; if ($img3action == "update") $updateset[] = "image3 = " .sqlesc(uploadimage(2, $row[image3], $id)); if ($img3action == "delete") { if ($row[image3]) { $del = unlink("torrents/images/$row[image3]"); $updateset[] = "image3 = ''"; } }
$img4action = $_POST['img4action']; if ($img4action == "update") $updateset[] = "image4 = " .sqlesc(uploadimage(3, $row[image4], $id)); if ($img4action == "delete") { if ($row[image4]) { $del = unlink("torrents/images/$row[image4]"); $updateset[] = "image4 = ''"; } }
$img5action = $_POST['img5action']; if ($img5action == "update") $updateset[] = "image5 = " .sqlesc(uploadimage(4, $row[image5], $id)); if ($img5action == "delete") { if ($row[image5]) { $del = unlink("torrents/images/$row[image5]"); $updateset[] = "image5 = ''"; } }
$img6action = $_POST['img6action']; if ($img6action == "update") $updateset[] = "image6 = " .sqlesc(uploadimage(5, $row[image6], $id)); if ($img6action == "delete") { if ($row[image6]) { $del = unlink("torrents/images/$row[image6]"); $updateset[] = "image6 = ''"; } }
$img7action = $_POST['img7action']; if ($img7action == "update") $updateset[] = "image7 = " .sqlesc(uploadimage(6, $row[image7], $id)); if ($img7action == "delete") { if ($row[image7]) { $del = unlink("torrents/images/$row[image7]"); $updateset[] = "image7 = ''"; } } Добавлено (27.08.2009, 00:17) --------------------------------------------- ищем Code @sql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].",".$file[2].")"); меняем на Code @sql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].",".$file[2].",".$file[3].",".$file[4].",".$file[5].",".$file[6].",".$file[7].")"); delete.php ищем Code $res = sql_query("SELECT name,owner,seeders,image1,image2 FROM torrents WHERE id = $id"); меняем на Code $res = sql_query("SELECT name,owner,seeders,image1,image2,image3,image4,image5,image6,image7 FROM torrents WHERE id = $id"); ищем Code if ($row["image1"]) { $img1 = "torrents/images/$row[image1]"; $del = unlink($img1); } if ($row["image2"]) { $img2 = "torrents/images/$row[image2]"; $del = unlink($img2); } после вставляем Code if ($row["image3"]) { $img3 = "torrents/images/$row[image3]"; $del = unlink($img3); } if ($row["image4"]) { $img4 = "torrents/images/$row[image4]"; $del = unlink($img4); }if ($row["image5"]) { $img5 = "torrents/images/$row[image5]"; $del = unlink($img5); } if ($row["image6"]) { $img6 = "torrents/images/$row[image6]"; $del = unlink($img6); }if ($row["image7"]) { $img7 = "torrents/images/$row[image7]"; $del = unlink($img7); } Мод робочий! Добавлено (27.08.2009, 00:25) --------------------------------------------- вот скрин>>> http://s14.radikal.ru/i187/0908/f8/83fdc87a03ed.jpg Добавлено (27.08.2009, 00:26) ---------------------------------------------

|
| |
|
|