Quote:
Originally Posted by deathemperor
would you like to share the xml file of the edited plugin ?
also what about the showthread url if I don't want to display the thread title on url ?
thanks for your help
|
ok I got some time.
I'll just give you my whole xml file I edited. If you go into plugin manager, and then click edit on the first listed file for this hack, this is what you have to replace. Leave the 2nd url mod rewrite file alone.
heres my global_complete
Please note, for this XML file to work, you must have the same .htaccess code as me, as this is configured to display forums as forum-14.html and threads the defualt way except this removes the "t" that was before the topic number. So if you want to use my XML, replace your current .htaccess with the following...
Code:
RewriteEngine On
RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?f=$1 [L]
RewriteRule ^([0-9]+)(((-p)([0-9]+))?)([A-Za-z0-9\-]+)\.html$ showthread.php?t=$1&page=$5&pp=10 [L]
and your global_complete with the following..
PHP Code:
// lets fix the forum links in the navbar
if(THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'newthread' OR THIS_SCRIPT == 'newreply')
{
preg_match_all('/<a href="forumdisplay\.php\?f=([0-9]+)">(.*?)<\/a>/i', $GLOBALS['navbits']['breadcrumb'], $nnavbits);
$size = sizeof($nnavbits[1]);
for($i = 0; $i <= $size; $i++)
{
$output = str_replace('forumdisplay.php?f=' . $nnavbits[1][$i] . '"', 'f' . $nnavbits[1][$i] . '-' . strtolower(str_replace('--', '-', preg_replace('/[^A-Za-z0-9-]+/i', '', str_replace(' ', '-', $nnavbits[2][$i])))) . '.html"', $output);
}
}
// we better do the same here on forumhome and forumdisplay
if(THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay')
{
preg_match_all('/<a href="forumdisplay\.php\?f=([0-9]+)">(.*?)<\/a>/i', $GLOBALS['forumbits'], $seobits);
$size = sizeof($seobits[1]);
for($i = 0; $i < $size; $i++)
{
if(!preg_match('/forum_link\.gif".*?forumdisplay.php\?f=' . $seobits[1][$i] . '/is', $GLOBALS['forumbits']))
{
$output = str_replace('forumdisplay.php?f=' . $seobits[1][$i] . '"', 'forum-' . $seobits[1][$i] . '' . strtolower(str_replace('--', '-', preg_replace('/[^0-9]+/i', '', str_replace(array(' ', '<strong>', '</strong>'), array('-', '', ''), $seobits[2][$i])))) . '.html"', $output);
}
}
}
// we need to fix the thread links and also the multi-page thread links on forumdisplay
if(THIS_SCRIPT == 'forumdisplay')
{
// normal thread bits
if(!empty($GLOBALS['threadbits']))
{
preg_match_all('/<a href="showthread\.php\?t=([0-9]+)" id="(.*)">(.*?)<\/a>/i', $GLOBALS['threadbits'], $seobits2);
$size = sizeof($seobits2[1]);
for($j = 0; $j < $size; $j++)
{
$output = str_replace('showthread.php?t=' . $seobits2[1][$j] . '"', '' . $seobits2[1][$j] . '-' . strtolower(str_replace('--', '-', str_replace(' ', '-', preg_replace('/[^\sA-Za-z0-9]+/', '', $seobits2[3][$j])))) . '.html"', $output);
}
}
// normal thread bits
if(!empty($GLOBALS['threadbits_sticky']))
{
preg_match_all('/<a href="showthread\.php\?t=([0-9]+)" id="(.*)">(.*?)<\/a>/i', $GLOBALS['threadbits_sticky'], $stickybits);
$size = sizeof($stickybits[1]);
for($j = 0; $j < $size; $j++)
{
$output = str_replace('showthread.php?t=' . $stickybits[1][$j] . '"', '' . $stickybits[1][$j] . '-' . strtolower(str_replace('--', '-', str_replace(' ', '-', preg_replace('/[^\sA-Za-z0-9]+/', '', $stickybits[3][$j])))) . '.html"', $output);
}
}
// do pagenav
if(substr_count($GLOBALS['threadbits'], 'page=') > 0)
{
preg_match_all('/<a href="showthread\.php\?t=([0-9]+)&\;page=([0-9]+)">(.*?)<\/a>/i', $GLOBALS['threadbits'], $lala);
$somesize = sizeof($lala[1]);
for($i = 0; $i <= $somesize; $i++)
{
$tid = $lala[1][$i];
preg_match('/<a href="showthread\.php\?t=(' . $tid . ')" id="(.*)">(.*)<\/a>/i', $GLOBALS['threadbits'], $somematch);
$output = str_replace(
'showthread.php?t=' . $lala[1][$i] . '&page=' . $lala[2][$i],
'' . $lala[1][$i] . '-p' . $lala[2][$i] . '-' . strtolower(str_replace('--', '-', str_replace(' ', '-', preg_replace('/[^\sA-Za-z0-9]+/', '', $somematch[3])))) . '.html"', $output
);
unset($tid, $somematch);
}
}
}
// we need to rewrite the pagenav links on showthread and also similar threads O_.
if(THIS_SCRIPT == 'showthread')
{
// do pagenav
if($GLOBALS['totalposts'] > $GLOBALS['perpage'])
{
preg_match_all('/<a class="smallfont" href="showthread\.php\?t=([0-9]+)(&\;page=([0-9]+))?&\;pp=([0-9]+)".*>(.*?)<\/a>/i', $GLOBALS['pagenav'], $seobits3);
$size2 = sizeof($seobits3[1]);
for($k = 0; $k < $size2; $k++)
{
if($seobits3[2][$k] != '')
{
$output = str_replace('showthread.php?t=' . $seobits3[1][$k] . '&page=' . $seobits3[3][$k] . '&pp=' . $seobits3[4][$k], '' . $seobits3[1][$k] . '-p' . $seobits3[3][$k] . '-' . strtolower(str_replace('--', '-', str_replace(' ', '-', preg_replace('/[^\sA-Za-z0-9]+/', '', $GLOBALS['thread']['title'])))) . '.html"', $output);
}
else
{
$output = str_replace('showthread.php?t=' . $seobits3[1][$k] . '&pp=' . $seobits3[4][$k], '' . $seobits3[1][$k] . ($seobits3[1][$k] == 1 ? '' : '-p' . $seobits3[3][$k]) . '-' . strtolower(str_replace('--', '-', str_replace(' ', '-', preg_replace('/[^\sA-Za-z0-9]+/', '', $GLOBALS['thread']['title'])))) . '.html"', $output);
}
}
}
// do similar threads
if($GLOBALS['vboptions']['showsimilarthreads'] AND $GLOBALS['thread']['similar'])
{
preg_match_all('/<a href="showthread\.php\?t=([0-9]+)">(.*?)<\/a>/i', $GLOBALS['similarthreads'], $seobits4);
$yetanothervar = sizeof($seobits4[1]);
for($l = 0; $l < $yetanothervar; $l++)
{
$output = str_replace('showthread.php?t=' . $seobits4[1][$l] . '"', '' . $seobits4[1][$l] . '-' . strtolower(str_replace('--', '-', str_replace(' ', '-', preg_replace('/[^\sA-Za-z0-9]+/', '', $seobits4[2][$l])))) . '.html"', $output);
}
}
}
I hope I helped someone or anyone! If you need any help...
aim: daredevilbp
msn:
neomania60@hotmail.com
- Credits to
www.DnLodge.com