Edgein |
8th December 2009 12:51 |
[FTS 1.1] Genre mod
run this using phpmyadmin :
PHP Code:
ALTER TABLE `torrents` ADD `Genre` varchar(120) NOT NULL default '';
In include/functions
find
PHP Code:
tr("Torrent name", "<input type=\"text\" name=\"name\" size=\"80\" value=\"$name\"/>(Taken from filename if not specified. <b>Please use descriptive names.</b>)\n", 1);
Add after
PHP Code:
tr("Genres", "<input type=\"text\" name=\"genre\" size=\"80\" />\n", 1);
In takeupload.php
find
PHP Code:
$imageurl = !empty($_POST['imageurl']) ? $_POST['imageurl'] : '';
after add
PHP Code:
$genre = $_POST["genre"];
Find
PHP Code:
$ret = sql_query("INSERT INTO torrents (search_text, filename, owner, visible, anonymous, info_hash, name,
And add after name,
then insert in the query :
after :
in details.php
search for the $res query , it should start like this :
PHP Code:
$res = sql_query("SELECT torrents.seeders, torrents.banned,".(_youtube_mod_ == 'yes' ? " torrents.tube," : "")." torrents.leechers, torrents.info_hash, torrents.imageurl,
then add in the query :
after
PHP Code:
categories.name AS cat_name,
now look for :
then add under it :
Look for
PHP Code:
tr("Download", "You are not allowed to download.");
then add under it :
PHP Code:
if (!empty($row["genre"])) print("<tr><td class=rowhead width=1%>Genres</td><td width=99% align=left>$genres</td></tr>");
then in edit.php
Find
PHP Code:
tr("Torrent Image URL", "<input type=\"text\" name=\"imageurl\" value=\"" . htmlspecialchars($row["imageurl"]) . "\" size=\"80\" />", 1);
and add under it
PHP Code:
tr("Genres", "<input type =\"text\" name=\"genre\" size=\"80\" value=\"" .htmlspecialchars($row["genre"]). "\">", 1);
in takeedit.php
find
PHP Code:
$dname = $row["save_as"];
add under it
find this
PHP Code:
$updateset[] = "ori_descr = " . sqlesc($descr);
and add under this
PHP Code:
$updateset[] = "genre= " . sqlesc($genre);
Then in include/functions.php
find
PHP Code:
<td class="colhead" align="center"><font color=white>Type</font></td> <td class="colhead" align="left"><a href="browse.php?<? print $oldlink; ?>sort=1&type=<? print $link1; ?>"><font color=white>Name</font></a> <font color=white>/</font> <a href="browse.php?<? print $oldlink; ?>sort=4&type=<? print $link4; ?>"><font color=white>Added</font></a></td>
Replace this with
PHP Code:
<td class="colhead" align="center"><font color=#FF0000>Type</font></td> <td class="colhead" align="left"><a href="browse.php?<? print $oldlink; ?>sort=1&type=<? print $link1; ?>"><font color=#FF0000>Name</font></a> <font color=white>/</font> <a href="browse.php?<? print $oldlink; ?>sort=4&type=<? print $link4; ?>"><font color=#FF0000>Added</font></a> <font color=#FF0000><u>Genre</u></font></td>
Then find this
PHP Code:
$dispname = substr($dispname, 0, $max_lenght_of_torrent_name) . "..."; } else $short_torrent_name_alt = "title=\"$dispname\"";
And add under this
PHP Code:
if (!empty($row["genre"])) {$genre = "" . htmlspecialchars($row["genre"]) . "";}
Then find this
PHP Code:
if ($added >= $last_browse) print ("\"><b>$dispname $sticky</b></a> <img src=pic/new.png border=0> $thisisfree$double " . str_replace(" ", "", $timezone) . "</div>"); else print ("\"><b>$dispname $sticky</b></a> $thisisfree$double " . str_replace(" ", " ", $timezone) . "</div>");
and Replace this with
PHP Code:
if ($added >= $last_browse) print ("\"><b>$dispname $sticky</b></a> <img src=pic/new.png border=0> $thisisfree$double " . str_replace(" ", "", $timezone) . "<font color=#0000FF><b>Genre: </b></font><font color=#00B8F5>$genre </div>"); else print ("\"><b>$dispname $sticky</b></a> $thisisfree$double " . str_replace(" ", " ", $timezone) . "<font color=#0000FF><b>Genre: </b></font><font color=#00B8F5>$genre </div>");
in the end you must have
http://www.edgein.org/genre.jpg
|