View Full Version : how do we make our links like yours?
evo_j
05-08-2005, 10:10 PM
how do we make our vbulletin links same as this forum? have messed about various versions of the archive hack from vb.org, would prfer to make same as this forum, we dont have mod_mime running at the moment not sure if we can but are moving to a dedicated server very soon with full control, were running 3.07 same as this version
Regards
J
clasione
05-08-2005, 10:25 PM
Welcome EvoJ !!!!
Nice to meet you..... This is the whole kit n' kabootle below.....
It's unsupported here but there's the code..
Step 1 - File Edits
This step covers all files that need to be edited. Step 2 covers the template edits.
forumdisplay.php
Find:
PHP Code:
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
}
Replace with:
PHP Code:
// ################ MOD_REWRITE HACK ######################
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));
$navbits["f$forumID-$forumURL.html"] = $forumTitle;
}
// ################ MOD_REWRITE HACK ######################
Find:
PHP Code:
$thread = process_thread_array($thread, $lastread, $foruminfo['allowicons']);
Below that add:
PHP Code:
// ################ MOD_REWRITE HACK ######################
$thread['url'] = strtolower(str_replace(" ", "-", $thread['threadtitle']));
$thread['url'] = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $thread['url']);
// ################ MOD_REWRITE HACK ######################
showthread.php
Find:
PHP Code:
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
}
Replace with:
PHP Code:
// ################ MOD_REWRITE HACK ######################
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));
$navbits["f$forumID-$forumURL.html"] = $forumTitle;
}
// ################ MOD_REWRITE HACK ######################
search.php
Find:
PHP Code:
$thread = process_thread_array($thread, $lastread["$thread[forumid]"]);
Below that add:
PHP Code:
// ################ MOD_REWRITE HACK ######################
$thread['url'] = strtolower(str_replace(" ", "-", $thread['threadtitle']));
$thread['url'] = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $thread['url']);
// ################ MOD_REWRITE HACK ######################
includes/functions_forumlist.php
Find:
PHP Code:
// do light bulb
$forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);
Above that add:
PHP Code:
// ################ MOD_REWRITE HACK ######################
$forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
// ################ MOD_REWRITE HACK ######################
Find:
PHP Code:
$forumperms = $bbuserinfo['forumpermissions']["$forumid"];
Above that add:
PHP Code:
// ################ MOD_REWRITE HACK ######################
$forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
// ################ MOD_REWRITE HACK ######################
includes/functions_online.php
Find:
PHP Code:
// ###################### Start showonline #######################
Above that add:
PHP Code:
// ###################### MOD_REWRITE HACK #################
function mod_rewrite_title($title)
{
$rewritten = strtolower(str_replace(" ", "-",str_replace("/", "-", $title)));
return ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $rewritten);
}
// ###################### MOD_REWRITE HACK #################
Find all instances of:
PHP Code:
<a href="showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>
And replace with:
PHP Code:
<a href="t$threadid-" .mod_rewrite_title($threadtitle). ".html\" title=\"$threadpreview\">$threadtitle</a>
Find all instances of:
PHP Code:
<a href="forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>
And replace with:
PHP Code:
<a href="f$forumid-" .mod_rewrite_title($forumtitle). ".html\">$forumtitle</a>
Find:
PHP Code:
convert_short_varnames($values);
$userinfo['values'] = $values;
Below that add:
PHP Code:
// #################### MOD_REWRITE HACK #################
if (eregi("t([0-9]+)-(.*).html$", $filename, $tmatch)) {
$filename = 'showthread.php';
$values['threadid'] = $tmatch[1];
}
if (eregi("f([0-9]+)-(.*).html$", $filename, $fmatch)) {
$filename = 'forumdisplay.php';
$values['forumid'] = $fmatch[1];
}
// #################### MOD_REWRITE HACK #################
Step 2 - Template Edits
This step covers all the template edits needed. Step 3 covers the .htaccess file needed.
Within the Forum Home Templates group the following templates all require the modification below.
forumhome_forumbit_level1_nopost
forumhome_forumbit_level1_post
forumhome_forumbit_level2_nopost
forumhome_forumbit_level2_post
forumhome_subforumbit_nopost
forumhome_subforumbit_post
Find:
PHP Code:
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
replace:
PHP Code:
<a href="f$forum[forumid]-$forum[url].html">
In the forumhome_lastpostby template find:
PHP Code:
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
And Replace with:
PHP Code:
<a href="newpostinthread$lastpostinfo[lastthreadid].html" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
Find:
PHP Code:
<a href="showthread.php?$session[sessionurl]goto=lastpost&t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
And replace with:
PHP Code:
<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
Find:
PHP Code:
<a href="showthread.php?$session[sessionurl]goto=lastpost&t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
And replace with:
PHP Code:
<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
In the Threadbit Templates group, the threadbit template requires the following modifications.
Find:
PHP Code:
<a href="showthread.php?$session[sessionurl]goto=lastpost&t=$thread[threadid]">
And replace with:
PHP Code:
<a href="lastpostinthread$thread[threadid].html">
Find:
PHP Code:
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$thread[threadid]">
And replace with:
PHP Code:
<a href="newpostinthread$thread[threadid].html">
Find:
PHP Code:
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">
And replace with:
PHP Code:
<a href="t$thread[threadid]-$thread[url].html">
Find:
PHP Code:
<a href="showthread.php?$session[sessionurl]goto=lastpost&t=$thread[threadid]">
And replace with:
PHP Code:
<a href="lastpostinthread[threadid].html">
Step 3 -.htaccess file
Open notepad or your usual text editor and copy and paste the following into a new file.
PHP Code:
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
evo_j
05-08-2005, 10:31 PM
thanks that looks EXCELLENT!! do i need any special features enabled on server??
clasione
05-08-2005, 10:43 PM
Not that I know of, as long as you have access to .htaccess you should be able to get that running in notime.. ;)
evo_j
05-08-2005, 10:44 PM
Not that I know of, as long as you have access to .htaccess you should be able to get that running in notime.. ;)
great will try it out and let you know, best hack ive found yet for vb seo
thanks
clasione
05-08-2005, 11:43 PM
Just make sure you back up the files your modifing incase you need to put them back....
but that should work on 3.0.7 with no problems...
and yes, it's the best vb hack available for optimization... Previous versions were close, but not as good as this one...
evo_j
05-09-2005, 07:11 AM
Hi, just wondering, this mod looks as if its dependant on mod_rewrite on the linux server, is that right?? as if so, i am not sure many virtual hosts will enable this, i just had a closer look at the code before installing it??
thanks
clasione
05-09-2005, 07:35 AM
I'm really not too sure. I know that alot of shared hosts do not give you access to .htaccess, but as far as anything else, i'm really not sure....
I'm dedicated, and my server admin takes care of the server settings...
evo_j
05-09-2005, 07:38 AM
hi, yes i have .htaccess file to edit, but i think lookin at the code it relies on mod_rewrite which is a feature of apache, not always enabled by virtual hosts, is it possible to ask the person who wrote this??? as its quite a large hack to install if its not going to run properly...
thanks for ur help
clasione
05-09-2005, 08:06 AM
Yes, must b enabled..
Before you begin, make sure your web server supports it. Calling your host support line is probably easiest.
evo_j
05-11-2005, 06:17 PM
is there a fix for the online.php file, as all the links that it shows the users lookin at, when you view whos online and what they are doing are broken?? any ideas??
but mostly working now, some coding errors though in the hack and wrong code links that need changing, however i worked out it
many thanks
clasione
05-11-2005, 06:22 PM
Post a link to the board and I'll take a look...
evo_j
05-11-2005, 08:12 PM
Post a link to the board and I'll take a look...
thanks
http://www.ironforlife.com/online.php?order=asc&sort=username&pp=40&page=1
clasione
05-11-2005, 08:35 PM
Did you check this file modification?
includes/functions_online.php
evo_j
05-12-2005, 05:55 AM
Did you check this file modification?
includes/functions_online.php
yep i did the full hack, i will double check over it now though for that page
thanks
evo_j
05-12-2005, 12:12 PM
yep i did the full hack, i will double check over it now though for that page
thanks
actually the hack is also missing the \ before the " for the functions online page, just took me a while to work that out, now its fixed, the links are still not working
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.