Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
Thread Tools
  #1  
Old 11th March 2011, 10:29
bebeshare bebeshare is offline
Member
 
Join Date: Mar 2011
P2P
Posts: 12
Default 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?
Reply With Quote
  #2  
Old 11th March 2011, 13:22
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
in include/rewrite.php is where it changes all the links.
you well also need to fix rewrite.htaccess
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #3  
Old 11th March 2011, 14:31
bebeshare bebeshare is offline
Member
 
Join Date: Mar 2011
P2P
Posts: 12
Default
Quote:
Originally Posted by joeroberts View Post
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})[\;]))""&amp;"$buffer);
$buffer str_replace(array("&amp;&amp;""&amp;middot""&amp;nbsp"), array("&&""?, " ;"), $buffer);

if (
$search_rewrite) {
        
$rewrite_search = Array();
        
$rewrite_replace = Array();
        
$rewrite_search[] = "'(?<!//)index\.php\?page=([0-9]*)&amp;cat=([0-9]*)'";
        
$rewrite_replace[] = "torrent-page-\\1-cat-\\2.html";
        
$rewrite_search[] = "'(?<!//)index\.php\?cat=([0-9]*)&amp;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]*)&amp;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&amp;id=([0-9]*)'";
        
$rewrite_replace[] = "delete-\\1.html";
        
$rewrite_search[] = "'(?<!//)mytorrents\.php\?op=displaytorrent&amp;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&amp;username=([^&\"]*)'";
        
$rewrite_replace[] = "viewprofile-\\1.html";
        
$rewrite_search[] = "'(?<!//)user\.php\?op=profile&amp;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?
Reply With Quote
  #4  
Old 11th March 2011, 15:04
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
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
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #5  
Old 11th March 2011, 16:41
bebeshare bebeshare is offline
Member
 
Join Date: Mar 2011
P2P
Posts: 12
Default
Quote:
Originally Posted by joeroberts View Post
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
Reply With Quote
Reply

Tags
list , searchrewrite , torrent


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 20:41. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.