•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 403,031 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,883 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 35346 | Replies: 131
![]() |
•
•
Join Date: Feb 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I am quite a newbie to vB, but this is mod is very sweet,
I rember that I read somewhere it better to use "_" for spaces than spaces itself, but cant find it anymore
can anyone say something to this ?
also the archives are not rewritten, its probablly not needed at, all just would be nice to know
and while I am at the archive issue, may its only a setting I did wrong, my arviches neve shows the links clickable, it this a special mod I need therefor or only a setting
I rember that I read somewhere it better to use "_" for spaces than spaces itself, but cant find it anymore
can anyone say something to this ?also the archives are not rewritten, its probablly not needed at, all just would be nice to know
and while I am at the archive issue, may its only a setting I did wrong, my arviches neve shows the links clickable, it this a special mod I need therefor or only a setting
•
•
Join Date: Feb 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I am getting duplicate forum titles also. How did you resolve this issue?
You can see the results here:www.okctalk.com other than that it seems to be working great.
Cheers!
You can see the results here:www.okctalk.com other than that it seems to be working great.
Cheers!
•
•
•
•
Originally Posted by infiniterb
Got a problem. The rewite works fine, except that I'm seeing duplicate forum names. Any idea what I need to edit to fix this?
www.clantt.com/vb/ is the url in question.
Thanks in advance. Nice work.
•
•
Join Date: Feb 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I realized a bug, in this thingie, just stupid guys like me may trap into this but just wanted to correct for the guys with less html knowledge:
the correct version of above replacement is:
Find:
[php]<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">[/php]
replace:
[php]<a href="f$forum[forumid]-$forum[url].html">[/php]
otherwise you got 2 forum titles, in your forum home, and I am sure you will not like to seen this,
except this little bug, great post, thx keith
•
•
•
•
Originally Posted by KeithMcL
Step 2 - Template Edits
This step covers all the template edits 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
In each of the templates above find:
[php]<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">[/php]
And Keith said: replace with: wich is WRONG
[php]<a href="f$forum[forumid]-$forum[url].html">$forum[title]</a>[/php]
Find:
[php]<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">[/php]
replace:
[php]<a href="f$forum[forumid]-$forum[url].html">[/php]
otherwise you got 2 forum titles, in your forum home, and I am sure you will not like to seen this,
except this little bug, great post, thx keith
Would it be fairly easy to modify this a bit so that the URL for topics also included the forum title, but make it look like a directory?
Basically, something like this:
http://www.bigblueball.com/forums/t2...mber_2004.html
Would be modified to look like this:
http://www.bigblueball.com/forums/announcements/t28559_member_of_the_month_-december_2004.html
... where announcements is the forum title.
Similarly, why not translate
http://www.bigblueball.com/forums/f1...uncements.html to
http://www.bigblueball.com/forums/f120_announcements/ or
http://www.bigblueball.com/forums/f1...nts/index.html ?
This mimics the structure of the forum, is logical to visitors AND opens up the possibility of improving SEO (by combining forum title + thread title in the URL).
Basically, something like this:
http://www.bigblueball.com/forums/t2...mber_2004.html
Would be modified to look like this:
http://www.bigblueball.com/forums/announcements/t28559_member_of_the_month_-december_2004.html
... where announcements is the forum title.
Similarly, why not translate
http://www.bigblueball.com/forums/f1...uncements.html to
http://www.bigblueball.com/forums/f120_announcements/ or
http://www.bigblueball.com/forums/f1...nts/index.html ?
This mimics the structure of the forum, is logical to visitors AND opens up the possibility of improving SEO (by combining forum title + thread title in the URL).
BigBlueBall - Everything about instant messaging
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
I found a bug. If the forum name has a ? in it, the resulting URL fails. For example:
http://www.bigblueball.com/forums/f1...ou-laugh?.html doesn't work.
I'm also getting complaints from my admin that there are too many redirects:
Is this something to be concerned about?
http://www.bigblueball.com/forums/f1...ou-laugh?.html doesn't work.
I'm also getting complaints from my admin that there are too many redirects:
# wget http://www.bigblueball.com/forums/newpostinthread28848.html --00:54:48-- http://www.bigblueball.com/forums/newpostinthread28848.html => `newpostinthread28848.html' Resolving www.bigblueball.com... done. Connecting to www.bigblueball.com[70.84.84.106]:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://www.bigblueball.com/forums/showthread.php?t=28848&goto=lastpost [following] --00:54:48-- http://www.bigblueball.com/forums/showthread.php?t=28848&goto=lastpost => `showthread.php?t=28848&goto=lastpost' Connecting to www.bigblueball.com[70.84.84.106]:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://www.bigblueball.com/forums/showthread.php?p=159143#post159143 [following] --00:54:48-- http://www.bigblueball.com/forums/showthread.php?p=159143 => `showthread.php?p=159143' Connecting to www.bigblueball.com[70.84.84.106]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 37,924 [text/html] 100%[================================================== ==================>] 37,924 36.17M/s ETA 00:00 00:54:48 (36.17 MB/s) - `showthread.php?p=159143' saved [37924/37924]
BigBlueBall - Everything about instant messaging
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
I fixed the problem with question marks in the forum title. I had to make the following changes:
forumdisplay.php - Added regular expression to strip out special characters
[PHP]// ################ MOD_REWRITE HACK ######################
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));
$forumURL = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forumURL);
$navbits["f$forumID-$forumURL.html"] = $forumTitle;
}
// ################ MOD_REWRITE HACK ###################### [/PHP]
includes/functions_forumlist.php - Replace in both sections
[PHP]// ################ MOD_REWRITE HACK ######################
$forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
$forum['url'] = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forum['url']);
// ################ MOD_REWRITE HACK ###################### [/PHP]Now, questions marks and other special characters that might be in your forum titles won't mess up your URLs.
forumdisplay.php - Added regular expression to strip out special characters
[PHP]// ################ MOD_REWRITE HACK ######################
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));
$forumURL = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forumURL);
$navbits["f$forumID-$forumURL.html"] = $forumTitle;
}
// ################ MOD_REWRITE HACK ###################### [/PHP]
includes/functions_forumlist.php - Replace in both sections
[PHP]// ################ MOD_REWRITE HACK ######################
$forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
$forum['url'] = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forum['url']);
// ################ MOD_REWRITE HACK ###################### [/PHP]Now, questions marks and other special characters that might be in your forum titles won't mess up your URLs.
BigBlueBall - Everything about instant messaging
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
•
•
Join Date: Feb 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
can you post a test url ?
cause on the url you given there is still the 404 error
I also heard that":" could cause problems is this with your replacement fixed also ?
I always wanted to ask when I use a new template / style all the stuff hast to be redone, I tried to load the template inherited from my master template with all the changed I made here, the the rewirte does work, but the button / pathes arent correct anymore, can this be fixed within the xml file ?
cause on the url you given there is still the 404 error
I also heard that":" could cause problems is this with your replacement fixed also ?
I always wanted to ask when I use a new template / style all the stuff hast to be redone, I tried to load the template inherited from my master template with all the changed I made here, the the rewirte does work, but the button / pathes arent correct anymore, can this be fixed within the xml file ?
•
•
•
•
Originally Posted by oil
can you post a test url?
http://www.bigblueball.com/forums/f1...ou-laugh?.html (no more question mark).
•
•
•
•
Originally Posted by oil
I also heard that":" could cause problems is this with your replacement fixed also?
•
•
•
•
Originally Posted by oil
I always wanted to ask when I use a new template / style all the stuff hast to be redone, I tried to load the template inherited from my master template with all the changed I made here, the the rewirte does work, but the button / pathes arent correct anymore, can this be fixed within the xml file ?
BigBlueBall - Everything about instant messaging
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
MessengerMods - Customize MSN with display pictures and emoticons
HisBuddyIcons - AIM buddy icons for dudes
BigBlueTemplates - 1,000s of professional website templates
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- vBulletin mod_rewrite (PHP)
Other Threads in the PHP Forum
- Previous Thread: using php to check for filenames
- Next Thread: Interesting, yet probably simple, PHP Nuke Error


Linear Mode