| | |
[Revised] vBulletin Mod_rewrite Tutorial
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2005
Posts: 11
Reputation:
Solved Threads: 0
WOW. I just followed everyone's little fixes and it works like a charm. No problems even on the first run.
By the way, for the page numbers, this is just fine, am I correct?
http://forum.mysite.com/showthread.p...6&page=2&pp=10
It would be nice to fix that as well so google will index every page.
Thanks Dani, Keith and the rest!
Time to blow the competition.
By the way, for the page numbers, this is just fine, am I correct?
http://forum.mysite.com/showthread.p...6&page=2&pp=10
It would be nice to fix that as well so google will index every page.
Thanks Dani, Keith and the rest!
Time to blow the competition.
•
•
Join Date: Apr 2005
Posts: 1
Reputation:
Solved Threads: 0
Hi,
Does anyone have a solution for the broken link / 404 page error when question marks are used in the title?
I have followed everything from this thread, and the one before it, reading through almost 22 pages of bug fixes, different code variations etc. But I don't think anyone has solved this one yet.
Does anyone have a solution for the broken link / 404 page error when question marks are used in the title?
I have followed everything from this thread, and the one before it, reading through almost 22 pages of bug fixes, different code variations etc. But I don't think anyone has solved this one yet.
•
•
•
•
Originally Posted by azziedone
Hi,
Does anyone have a solution for the broken link / 404 page error when question marks are used in the title?
I have followed everything from this thread, and the one before it, reading through almost 22 pages of bug fixes, different code variations etc. But I don't think anyone has solved this one yet.
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
•
•
•
•
Originally Posted by extremefitness
Anyone figure out a way to use this while using multiple styles? Using the dropdown selector ignores any attempt to change your style.
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: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
Sorry for a newbie question but I would like to replace the showthread.html? links at the bottom of each page (previous and next thread links) with title based keyword links.
I've modified the mod_rewrite hack to format thread links with both $threadID and $pagenumber as t#p# like this:
t125p4-my-thread-title.html
For which I modified my .htaccess line like so:
RewriteRule ^t([0-9]+)p([0-9]+)-(.*).html$ showthread.html?t=$1&page=$2 [L]
It rewrites just fine -- but now I need to find a way to modify the SHOWTHREAD template where the "previous" and "next thread" links are found in code like this:
It seems like this should be pretty easy since we have access to the $threadID and $pagenumber variables -- and the URL part will be the same for all pages in the thread.
However, I cannot seem to access $thread[url]. I'm too inexperienced with vBulletin and PHP to figure out what to try next.
Any suggestions appreciated.
- Chad
I've modified the mod_rewrite hack to format thread links with both $threadID and $pagenumber as t#p# like this:
t125p4-my-thread-title.html
For which I modified my .htaccess line like so:
RewriteRule ^t([0-9]+)p([0-9]+)-(.*).html$ showthread.html?t=$1&page=$2 [L]
It rewrites just fine -- but now I need to find a way to modify the SHOWTHREAD template where the "previous" and "next thread" links are found in code like this:
PHP Syntax (Toggle Plain Text)
<div class="smallfont" align="center"> <strong>«</strong> <a href="showthread.html?$session[sessionurl]t=$threadid&goto=nextoldest">$vbphrase[prev_thread]</a> | <a href="showthread.html?$session[sessionurl]t=$threadid&goto=nextnewest">$vbphrase[next_thread]</a> <strong>»</strong> </div>
It seems like this should be pretty easy since we have access to the $threadID and $pagenumber variables -- and the URL part will be the same for all pages in the thread.
However, I cannot seem to access $thread[url]. I'm too inexperienced with vBulletin and PHP to figure out what to try next.
Any suggestions appreciated.
- Chad
•
•
Join Date: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
Aahh, my mistake. I don't want to modify the "Previous/Next Thread" links. I want to modify the numbered page links from the PAGENAV template -- specifically the numbered links 1|2|3|4 etc. which are built from the pagenav_pagelink template here:
Now, it seems this is built by the function construct_page_nav in function.php so I first simplified the pagenav_pagelink template (above) to read:
And then added a section into the beginning of function construct_page_nav (at the beginning of the while ($curpage++ < $totalpages) loop) like this:
This results in a nicely formatted link:
t25p2-my-test-thread-title.html
So now how do I go about getting the REAL thread title and URL into the above code?
- Chad
PHP Syntax (Toggle Plain Text)
<td class="alt1"><a href="$address&page=$curpage$address2" class="smallfont" title="<phrase 1="$pagenumbers[first]" ="$pagenumbers[last]" 3="$total" rel="nofollow">$vbphrase[show_results_x_to_y_of_z</phrase>">$curpage</a></td>
Now, it seems this is built by the function construct_page_nav in function.php so I first simplified the pagenav_pagelink template (above) to read:
PHP Syntax (Toggle Plain Text)
<td class="alt1"><a href="$tpURL.html" class="smallfont" title="$threadTitle, page $curpage">$curpage</a></td>
And then added a section into the beginning of function construct_page_nav (at the beginning of the while ($curpage++ < $totalpages) loop) like this:
PHP Syntax (Toggle Plain Text)
// TEST MOD by Chad global $threadid; $threadTitle = 'My Test Thread Title'; $threadURL = 'my-test-thread-title'; $tpURL = 't'.$threadid.'p'.$curpage.'-'.$threadURL; // END MOD
This results in a nicely formatted link:
t25p2-my-test-thread-title.html
So now how do I go about getting the REAL thread title and URL into the above code?
- Chad
![]() |
Similar Threads
- 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
| Thread Tools | Search this Thread |
apache api array basic body broken cache cakephp class cms code computing confirm cron curl customizableitems database date date/time delete dynamic email error fcc file filter folder form forum freelancing function functions gc_maxlifetime header headmethod howtowriteathesis href htaccess html iframe image include ip javascript joomla limit link list login malfunction memmory memory menu method mod_rewrite msqli_multi_query multiple mycodeisbad mysql navigation neutrality oop parameter parsing paypal pdf php phpmysql query question random recourse regex root script search select seo server sessions snippet soap source space sql static support! system table thesishelp trouble tutorial update upload url variable web webdesign xml youtube





