Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   Help SearchRewrite & List Torrent (http://www.bvlist.com/showthread.php?t=6157)

bebeshare 11th March 2011 10:29

Help SearchRewrite & List Torrent
 
1、I have enable SearchRewrite, but the url display like this: details.php?id=11 ,how to change it like:11-ie-cache-fix.html ? or ie-cache-fix.html ?
2、why do not display seeds o and leechers 0 torrents? what shoul i do let them display?

joeroberts 11th March 2011 13:22

in include/rewrite.php is where it changes all the links.
you well also need to fix rewrite.htaccess

bebeshare 11th March 2011 14:31

Quote:

Originally Posted by joeroberts (Post 27134)
in include/rewrite.php is where it changes all the links.
you well also need to fix rewrite.htaccess

PHP Code:

<?php
/*
*-------------------------------phpMyBitTorrent--------------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ?005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*/
if (eregi("rewrite.php",$_SERVER["PHP_SELF"])) die ("You can't access this file directly");
$buffer ob_get_clean();

//Valid HTML
$buffer preg_replace("(&(?!([a-zA-Z]{2,6}|[0-9\#]{1,6})[\;]))""&"$buffer);
$buffer str_replace(array("&&""&middot""&nbsp"), array("&&""?, " ;"), $buffer);

if (
$search_rewrite) {
        
$rewrite_search = Array();
        
$rewrite_replace = Array();
        
$rewrite_search[] = "'(?<!//)index\.php\?page=([0-9]*)&cat=([0-9]*)'";
        
$rewrite_replace[] = "torrent-page-\\1-cat-\\2.html";
        
$rewrite_search[] = "'(?<!//)index\.php\?cat=([0-9]*)&page=([0-9]*)'";
        
$rewrite_replace[] = "torrent-page-\\2-cat-\\1.html";
        
$rewrite_search[] = "'(?<!//)index\.php\?page=([0-9]*)'";
        
$rewrite_replace[] = "torrent-page-\\1.html";
        
$rewrite_search[] = "'(?<!//)index\.php\?cat=([0-9]*)'";
        
$rewrite_replace[] = "torrent-cat-\\1.html";
        
$rewrite_search[] = "'(?<!//)index\.php'";
        
$rewrite_replace[] = "index.html";
        
$rewrite_search[] = "'(?<!//)details\.php\?id=([0-9]*)&hit=1'";
        
$rewrite_replace[] = "torrent-\\1-hit.html";
        
$rewrite_search[] = "'(?<!//)details\.php\?id=([0-9]*)'";
        
$rewrite_replace[] = "torrent-\\1.html";
        
$rewrite_search[] = "'(?<!//)download\.php\?id=([0-9]*)&export=1'";
        
$rewrite_replace[] = "export-\\1.torrent";
        
$rewrite_search[] = "'(?<!//)download\.php\?id=([0-9]*)&password=([a-zA-Z]*)'";
        
$rewrite_replace[] = "download-\\1-pass-\\2.torrent";
        
$rewrite_search[] = "'(?<!//)download\.php\?id=([0-9]*)'";
        
$rewrite_replace[] = "download-\\1.torrent";
        
$rewrite_search[] = "'(?<!//)edit\.php\?id=([0-9]*)'";
        
$rewrite_replace[] = "edit-\\1.html";
        
$rewrite_search[] = "'(?<!//)edit\.php\?op=delete&id=([0-9]*)'";
        
$rewrite_replace[] = "delete-\\1.html";
        
$rewrite_search[] = "'(?<!//)mytorrents\.php\?op=displaytorrent&id=([0-9]*)'";
        
$rewrite_replace[] = "displaytorrent-\\1.html";
        
$rewrite_search[] = "'(?<!//)mytorrents\.php'";
        
$rewrite_replace[] = "mytorrents.html";
        
$rewrite_search[] = "'(?<!//)user\.php\?op=editprofile'";
        
$rewrite_replace[] = "editprofile.html";
        
$rewrite_search[] = "'(?<!//)user\.php\?op=profile&username=([^&\"]*)'";
        
$rewrite_replace[] = "viewprofile-\\1.html";
        
$rewrite_search[] = "'(?<!//)user\.php\?op=profile&id=([0-9]*)'";
        
$rewrite_replace[] = "profile-\\1.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?op=inbox'";
        
$rewrite_replace[] = "inbox.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?op=inbox&page=([0-9]*)'";
        
$rewrite_replace[] = "inbox-page-\\1.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?op=readmsg&mid=([0-9]*)'";
        
$rewrite_replace[] = "msg-\\1.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?mid=([0-9]*)'";
        
$rewrite_replace[] = "msg-\\1.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?op=delall'";
        
$rewrite_replace[] = "msg-delall.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?op=del&mid=([0-9]*)'";
        
$rewrite_replace[] = "msg-\\1-del.html";
        
$rewrite_search[] = "'(?<!//)pm\.php?op=send&replyto=([0-9]*)'";
        
$rewrite_replace[] = "msg-reply-\\1.html";
        
$rewrite_search[] = "'(?<!//)pm\.php'";
        
$rewrite_replace[] = "pm.html";
        
$buffer = preg_replace($rewrite_search,$rewrite_replace,$buffer);
}
//Restart Output Buffering again
ob_start("
ob_gzhandler");
ob_implicit_flush(0);
echo 
$buffer;
?>

what should i do?

joeroberts 11th March 2011 15:04

that is a search and replace system it search's for a text and replaces them with a defined text like so
search for
http://yoursite/index.php
replace with
http://yoursite/home

and again

search for
details.php?id=([0-9]*) (this ([0-9]*) denotes to look for only a number)

replace with
(found number)-ie-cache-fix.html

example
PHP Code:

        $rewrite_search[] = "'(?<!//)details\.php\?id=([0-9]*)'";
        
$rewrite_replace[] = "\\1-ie-cache-fix.html"

and remember in rewrite.htaccess
you need to set the rule
Code:

RewriteRule ^([0-9]*)-ie-cache-fix.html details.php?id=$1

bebeshare 11th March 2011 16:41

Quote:

Originally Posted by joeroberts (Post 27137)
that is a search and replace system it search's for a text and replaces them with a defined text like so
search for
http://yoursite/index.php
replace with
http://yoursite/home

and again

search for
details.php?id=([0-9]*) (this ([0-9]*) denotes to look for only a number)

replace with
(found number)-ie-cache-fix.html

example
PHP Code:

        $rewrite_search[] = "'(?<!//)details\.php\?id=([0-9]*)'";
        
$rewrite_replace[] = "\\1-ie-cache-fix.html"

and remember in rewrite.htaccess
you need to set the rule
Code:

RewriteRule ^([0-9]*)-ie-cache-fix.html details.php?id=$1


I know what you mean, I need that if I want to Torrent Name appears as the end of the URL.
For example:
My Torrent name is: No Strings Attached 2011, my website is http://www.yoursite.com ,
Then the URL will now show http://www.yoursite.com/details.php?id=1,
I want to show the URL http://www.yoursite.com/No-Strings-Attached-2011.html,
how to change it?
Other pages are similar to the above situation.

Now,the URL shown by default.

In addition: It seems that the default only recognizes the first Tracker, how can it recognize Additional Tracker, and display the Trackers and the Additional Tracker's seeds and leechers:cool:


All times are GMT +2. The time now is 14:40.

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