Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Strike (http://www.bvlist.com/forumdisplay.php?f=21)
-   -   Search Engine & Recommended torrents, question (http://www.bvlist.com/showthread.php?t=4550)

cekosexama 20th February 2010 23:06

Search Engine & Recommended torrents, question
 
Hello, can someone tell me how to put search engine on torrentstrike

http://img689.imageshack.us/img689/624/searchi.jpg



And the other question is, how to make ''Recommended torrents'' on brose.php. Like this:

http://img94.imageshack.us/img94/5015/recomendedn.jpg

Timisoreanul 20th February 2010 23:31

1 Attachment(s)
Hi, for search engine , try the file below. Enjoy

cekosexama 21st February 2010 00:13

Quote:

Originally Posted by Timisoreanul (Post 21240)
Hi, for search engine , try the file below. Enjoy

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

Timisoreanul 21st February 2010 00:23

Please post your browse.php

cekosexama 21st February 2010 00:24

i found it :)

ill share code , here it is:
PHP Code:

<table width=750 class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded><form method="get" action=browse3.php><div class="sidebox"><div class="boxhead">
<table width=750 class=main border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td class=embedded><div class="sidebox">
      <div class="boxhead">
        <h2>Search torrents</h2>
      </div>
      <div class="boxbody">
        <p align="center">Search:
          <input type="text" name="search" size="40" value="<?= htmlspecialchars($searchstr?>" />
              <select name="cat">
                <option value="0">(All cats.)</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>
              <select name=blah>
                <option value="0" selected="selected">In title</option>
                <option value="1"<? print($blah == " selected" ""); ?>>In the description</option>
                <option value="2"<? print($blah == " selected" ""); ?>>In both</option>
              </select>
              <?= $deadchkbox ?>
              <input type="submit" value="Search" />
        </p>
      </div>
    </div>
        <p></p></td>
  </tr>
</table>
<h2>&nbsp;</h2>
    </div>
        </div>
</form>
</td></tr></table>

Edit: I still need the recomended torrents code,pl0x some 1 share it :)


 
 
Timisoreanul 21st February 2010 00:33

Yes thats it, for those who want to put search in browse,
search
Code:

                 
         

         





end afther that put this :
Code:





Search:

in
if ($_GET["incldead"])
    $deadchkbox .= " checked=\"checked\"";
$deadchkbox .= " /> including dead torrents\n";

?>







this is english
cekosexama yours code is not english.
cekosexama 21st February 2010 01:05

I translated and edited the code in the forums, when i saw it was on Bulgarian :)

";
}

end_frame();
}
mysql_free_result($res1);
so if you whant to show the recommend torrents on browse , use the last code end add it to browse.php
Timisoreanul 21st February 2010 01:26

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';
upload add
Code:

tr("Recommend torrent","YesNo",1);
takeupload in query after
Code:

type,
add
Code:

recommend,
and after
Code:

$type,
add
Code:

$recommend,
edit add
Code:

tr("Recommend torrent","YesNo",1);
takeedit after
Code:

$updateset[] = "category = " . (0 + $type);
add
Code:

$recommend = unesc($_POST['recommend']);
$updateset[] = "recommend = " . sqlesc($recommend);

index.php add where you want
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 "






$dispname


Seed ($arr1[seeders]) Leech ($arr1[leechers]) Snatched ($arr1[times_completed])

Size: ".mksize($arr1['size'])."

Upped by: ".$arr1['username']."

" . "Download Torrent" . "

cekosexama 21st February 2010 01:50

From all this i got confuzed, i cant do nothing :lol:

";
}

end_frame();
}
mysql_free_result($res1);
save end close.
good luck
Timisoreanul 21st February 2010 02:11

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';
click execute.
Step 2: in your folder tracker,, open upload.php find
Code:

tr("Type", $s, 1);
add afther it
Code:

tr("Recommend torrent","YesNo",1);
now save end close the file.
Step 3 : find end open takeupload.php search for
Code:

$ret = mysql_query("INSERT INTO torrents:
end you will see , type, recommend, descr, ori_descr, description, category now replace that line with this:
Code:

, type, recommend, descr, ori_descr, description, category
save end close
Step 4 :find end open edit.php find
Code:

        tr("Type", $s, 1);
end add afther it this:
Code:

tr("Recommend torrent","YesNo",1);
save end close
Step 5: find end open takeedit.php find
Code:

$updateset[] = "category = " . (0 + $type);
add afther it this:
Code:

$recommend = unesc($_POST['recommend']);
$updateset[] = "recommend = " . sqlesc($recommend);

Step 6 : find end open browse.php find:
Code:

        stdhead("Search results for \"$searchstr\"");
else
        stdhead();

afther that add this:
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 "






$dispname


Seed ($arr1[seeders]) Leech ($arr1[leechers]) Snatched ($arr1[times_completed])

Size: ".mksize($arr1['size'])."

Upped by: ".$arr1['username']."

" . "Download Torrent" . "


All times are GMT +2. The time now is 17:42.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.