|
#1
|
|||
|
|||
Search Engine & Recommended torrents, question
|
#2
|
||||
|
||||
Hi, for search engine , try the file below. Enjoy
__________________
only me |
#3
|
|||
|
|||
It didnt work , makes error
Code:
Fatal error: Call to a member function query() on a non-object in D:\serverr\xampp\htdocs\Upload\browse.php on line 118 |
#4
|
||||
|
||||
Please post your browse.php
__________________
only me |
#5
|
|||
|
|||
i found it :)
ill share code , here it is: PHP Code:
Last edited by cekosexama; 21st February 2010 at 01:07. |
#6
|
||||
|
||||
Yes thats it, for those who want to put search in browse,
search Code:
<input type="submit" class="btn" value="Go!"/> </div> </td> </tr> </table> </td> </tr> </table> </form> Code:
<p><p> <table width=650 class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded> <form method="get" action=browse.php> <p align="center"> Search: <input type="text" name="search" size="40" value="<?= htmlspecialchars($searchstr) ?>" /> in <select name="cat"> <option value="0">(all types)</option> <? $cats = genrelist(); $catdropdown = ""; foreach ($cats as $cat) { $catdropdown .= "<option value=\"" . $cat["id"] . "\""; if ($cat["id"] == $_GET["cat"]) $catdropdown .= " selected=\"selected\""; $catdropdown .= ">" . htmlspecialchars($cat["name"]) . "</option>\n"; } $deadchkbox = "<input type=\"checkbox\" name=\"incldead\" value=\"1\""; if ($_GET["incldead"]) $deadchkbox .= " checked=\"checked\""; $deadchkbox .= " /> including dead torrents\n"; ?> <?= $catdropdown ?> </select> <?= $deadchkbox ?> <input type="submit" value="Search!" /> </p> </form> </td></tr></table> cekosexama yours code is not english.
__________________
only me |
#7
|
|||
|
|||
I translated and edited the code in the forums, when i saw it was on Bulgarian :)
|
#8
|
||||
|
||||
cekosexama i found recommend torrents on torrentstrike forum, thanks to nicky, here is the code
sql Code:
ALTER TABLE `torrents` ADD `recommend` ENUM( 'Yes', 'No' ) NOT NULL DEFAULT 'No'; Code:
tr("Recommend torrent","<input type=radio name=recommend" . ($row["recommend"] == "yes" ? " checked" : "") . " value=yes>Yes<input type=radio name=recommend" . ($row["recommend"] == "no" ? " checked" : "") . " value=no>No",1); Code:
type, Code:
recommend, Code:
$type, Code:
$recommend, Code:
tr("Recommend torrent","<input type=radio name=recommend" . ($row["recommend"] == "yes" ? " checked" : "") . " value=yes>Yes<input type=radio name=recommend" . ($row["recommend"] == "no" ? " checked" : "") . " value=no>No",1); Code:
$updateset[] = "category = " . (0 + $type); Code:
$recommend = unesc($_POST['recommend']); $updateset[] = "recommend = " . sqlesc($recommend); Code:
$res1 = mysql_query("SELECT torrents.id, torrents.size, torrents.name, torrents.filename, torrents.poster, torrents.leechers, torrents.seeders, torrents.times_completed, torrents.owner, users.username AS username, users.class AS class FROM torrents INNER JOIN users ON torrents.owner = users.id WHERE torrents.recommend='yes' ORDER BY torrents.times_completed DESC LIMIT 3"); if (mysql_num_rows($res1) > 0) { begin_frame("Recommend Torrent",true,5); while ($arr1 = mysql_fetch_assoc($res1)) { $dispname = htmlspecialchars(trim($arr1["name"])); $count_dispname=strlen($dispname); $max_lenght_of_torrent_name="15"; // maximum lenght if($count_dispname > $max_lenght_of_torrent_name){ $short_torrent_name_alt="title=\"$dispname \""; $dispname=substr($dispname, 0, $max_lenght_of_torrent_name) . "..."; }else $short_torrent_name_alt="$dispname"; echo "<td width=\"50%\" align=\"center\"> <br/> <b><a href=\"./details.php?id=$arr1[id]&hit=1\"$short_torrent_name_alt><img src=\"$arr1[poster]\" border=\"0\" width=\"150\" height=\"150\"></a></b> <br/> <a href=\"./details.php?id=$arr1[id]&hit=1\"$short_torrent_name_alt><b>$dispname</b></a><br/><br/> <b><a href=\"./details.php?id=$arr1[id]&dllist=1#seeders\"><font color=green>Seed ($arr1[seeders])</font> <font color=red>Leech ($arr1[leechers])</font></a> <font color=blue>Snatched ($arr1[times_completed])</font></b><br/> <b>Size:</b> ".mksize($arr1['size'])."<br/> <b>Upped by:</b> <a href=userdetails.php?id=$arr1[owner]><b>".$arr1['username']."</b></a><br/> <a class=\"index\" href=\"download.php/$arr1[id]/" . rawurlencode($arr1["filename"]) . "\">" . "<font color=red>Download Torrent</font>" . "</a><br> </td>"; } end_frame(); } mysql_free_result($res1);
__________________
only me |
#9
|
|||
|
|||
From all this i got confuzed, i cant do nothing
|
#10
|
||||
|
||||
Ok , let's try another method,
Step 1: go to your phpmyadmin, then select your database of tracker, then click SQL end run Code:
ALTER TABLE `torrents` ADD `recommend` ENUM( 'Yes', 'No' ) NOT NULL DEFAULT 'No'; Step 2: in your folder tracker,, open upload.php find Code:
tr("Type", $s, 1); Code:
tr("Recommend torrent","<input type=radio name=recommend" . ($row["recommend"] == "yes" ? " checked" : "") . " value=yes>Yes<input type=radio name=recommend" . ($row["recommend"] == "no" ? " checked" : "") . " value=no>No",1); Step 3 : find end open takeupload.php search for Code:
$ret = mysql_query("INSERT INTO torrents: Code:
, type, recommend, descr, ori_descr, description, category Step 4 :find end open edit.php find Code:
tr("Type", $s, 1); Code:
tr("Recommend torrent","<input type=radio name=recommend" . ($row["recommend"] == "yes" ? " checked" : "") . " value=yes>Yes<input type=radio name=recommend" . ($row["recommend"] == "no" ? " checked" : "") . " value=no>No",1); Step 5: find end open takeedit.php find Code:
$updateset[] = "category = " . (0 + $type); Code:
$recommend = unesc($_POST['recommend']); $updateset[] = "recommend = " . sqlesc($recommend); Code:
stdhead("Search results for \"$searchstr\""); else stdhead(); Code:
$res1 = mysql_query("SELECT torrents.id, torrents.size, torrents.name, torrents.filename, torrents.poster, torrents.leechers, torrents.seeders, torrents.times_completed, torrents.owner, users.username AS username, users.class AS class FROM torrents INNER JOIN users ON torrents.owner = users.id WHERE torrents.recommend='yes' ORDER BY torrents.times_completed DESC LIMIT 3"); if (mysql_num_rows($res1) > 0) { begin_frame("Recommend Torrent",true,5); while ($arr1 = mysql_fetch_assoc($res1)) { $dispname = htmlspecialchars(trim($arr1["name"])); $count_dispname=strlen($dispname); $max_lenght_of_torrent_name="15"; // maximum lenght if($count_dispname > $max_lenght_of_torrent_name){ $short_torrent_name_alt="title=\"$dispname \""; $dispname=substr($dispname, 0, $max_lenght_of_torrent_name) . "..."; }else $short_torrent_name_alt="$dispname"; echo "<td width=\"50%\" align=\"center\"> <br/> <b><a href=\"./details.php?id=$arr1[id]&hit=1\"$short_torrent_name_alt><img src=\"$arr1[poster]\" border=\"0\" width=\"150\" height=\"150\"></a></b> <br/> <a href=\"./details.php?id=$arr1[id]&hit=1\"$short_torrent_name_alt><b>$dispname</b></a><br/><br/> <b><a href=\"./details.php?id=$arr1[id]&dllist=1#seeders\"><font color=green>Seed ($arr1[seeders])</font> <font color=red>Leech ($arr1[leechers])</font></a> <font color=blue>Snatched ($arr1[times_completed])</font></b><br/> <b>Size:</b> ".mksize($arr1['size'])."<br/> <b>Upped by:</b> <a href=userdetails.php?id=$arr1[owner]><b>".$arr1['username']."</b></a><br/> <a class=\"index\" href=\"download.php/$arr1[id]/" . rawurlencode($arr1["filename"]) . "\">" . "<font color=red>Download Torrent</font>" . "</a><br> </td>"; } end_frame(); } mysql_free_result($res1); good luck
__________________
only me |
Tags |
engine , question , recommended , search , torrents |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Torrent search engine script | movizdb | Downloads | 1 | 3rd November 2010 18:14 |
SEO - Optimization for Search Engine | kp380lv | Mods & Themes | 0 | 27th September 2009 17:48 |
Bit torrent search engine | atencorps | Downloads | 0 | 28th December 2008 02:40 |
meta search engine script(pirate search) | movizdb | Downloads | 1 | 13th October 2008 15:19 |