| | |
vBulletin mod_rewrite
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Yes, I never bothered to rewrite announcements. I will in a bit though
This forum is a demo of this hack - another example is a forum I designed and coded, www.mod-rewrite.com/forum/
This forum is a demo of this hack - another example is a forum I designed and coded, www.mod-rewrite.com/forum/ •
•
Join Date: Aug 2004
Posts: 40
Reputation:
Solved Threads: 0
The quickstyle chooser is run via javascript using the following code:
[php]
function switch_styleid(selectobj)
{
var styleid = selectobj.options[selectobj.selectedIndex].value;
if (styleid == "")
{
return;
}
var url = new String(window.location);
var fragment = new String("");
// get rid of fragment
url = url.split("#");
// deal with the fragment first
if (url[1])
{
fragment = "#" + url[1];
}
// deal with the main url
url = url[0];
// remove styleid=x& from main bit
if (url.indexOf("styleid=") != -1 && is_regexp)
{
re = new RegExp("styleid=\\d+&?");
url = url.replace(re, "");
}
// add the ? to the url if needed
if (url.indexOf("?") == -1)
{
url += "?";
}
else
{
// make sure that we have a valid character to join our styleid bit
lastchar = url.substr(url.length - 1);
if (lastchar != "&" && lastchar != "?")
{
url += "&";
}
}
window.location = url + "styleid=" + styleid + fragment;
}
[/php]
I have no idea how to make it work properly so for now I must stick with [R] flags.
[php]
function switch_styleid(selectobj)
{
var styleid = selectobj.options[selectobj.selectedIndex].value;
if (styleid == "")
{
return;
}
var url = new String(window.location);
var fragment = new String("");
// get rid of fragment
url = url.split("#");
// deal with the fragment first
if (url[1])
{
fragment = "#" + url[1];
}
// deal with the main url
url = url[0];
// remove styleid=x& from main bit
if (url.indexOf("styleid=") != -1 && is_regexp)
{
re = new RegExp("styleid=\\d+&?");
url = url.replace(re, "");
}
// add the ? to the url if needed
if (url.indexOf("?") == -1)
{
url += "?";
}
else
{
// make sure that we have a valid character to join our styleid bit
lastchar = url.substr(url.length - 1);
if (lastchar != "&" && lastchar != "?")
{
url += "&";
}
}
window.location = url + "styleid=" + styleid + fragment;
}
[/php]
I have no idea how to make it work properly so for now I must stick with [R] flags.
Cool hack there, i think i shall use it on my forum and let the googlies in :cheesy:
Class Info:
Warrior Priest | Bright Wizard |Witch Hunter | Rune Priest |Engineer | Hammerer |Ironbreaker | Black Orc |Orc Choppa | Goblin Shaman |Squig Herder | Chosen |Magus | Zealot | Marauder
Warrior Priest | Bright Wizard |Witch Hunter | Rune Priest |Engineer | Hammerer |Ironbreaker | Black Orc |Orc Choppa | Goblin Shaman |Squig Herder | Chosen |Magus | Zealot | Marauder
Thanks for sharing this, I just got it setup on my forums. I'm using V3.0.3 and found a couple of the instructions didnt work for me.
Heres what I changed.
In step two it asks to replace all with the following:
But I got an error so had to change to:
In Step four Part one I had to use:
Instead of the instructed:
All works fine now.
I also used the rewrite rule Teds posted:
But as my .htaccess file is in my forum directory I had to remove the /'s to make it work:
Thanks again :mrgreen:
Heres what I changed.
In step two it asks to replace all with the following:
PHP Syntax (Toggle Plain Text)
<a href="$forum['url'].html">
PHP Syntax (Toggle Plain Text)
<a href="$forum[url].html">
In Step four Part one I had to use:
PHP Syntax (Toggle Plain Text)
<a href="lastpostinthread$thread[threadid].html">
PHP Syntax (Toggle Plain Text)
<a href="lastpostinthread[threadid].html">
All works fine now.
I also used the rewrite rule Teds posted:
PHP Syntax (Toggle Plain Text)
RewriteRule ^/f([0-9]+)-(.*).html$ /forumdisplay.php?forumid=$1 [L]
PHP Syntax (Toggle Plain Text)
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
Thanks again :mrgreen:
CertForums.co.uk Help, Advice and Resources to Pass Your Certification
Nominated for VB board of the month August
Nominated for VB board of the month August
It may be the way I posted it:
That is the code as instructed in the first post.
I had to chage it to this:
Also, theres no reply with quote buttons in any of the posts apart from the first post of this thread.
PHP Syntax (Toggle Plain Text)
<a href="lastpostinthread[threadid].html">
I had to chage it to this:
PHP Syntax (Toggle Plain Text)
<a href="lastpostinthread$thread[threadid].html">
Also, theres no reply with quote buttons in any of the posts apart from the first post of this thread.
CertForums.co.uk Help, Advice and Resources to Pass Your Certification
Nominated for VB board of the month August
Nominated for VB board of the month August
Yes, that makes much more sense! As to your question, that's because there are limited features available to the DaniWeb tutorial threads. The idea is that all replies be comments / responses to the original article.
I've been testing this on a new install, but for some reason I have the simple issue of "forumdisplay" is showing as the normal dynamic link, rather than the HTML form. It's probably a small mistake, but if there are any pointers to which part of the instructions I possibly messed up on, that would be most appreciated.
![]() |
Similar Threads
- [Revised] vBulletin Mod_rewrite Tutorial (PHP)
- vBulletin mod_rewrite for vB 3.0.7 (Existing Scripts)
- vBulletin mod_rewrite for vB 3.0.7 (Growing an Online Community)
- vBulletin mod_rewrite in phpBB mod format (Existing Scripts)
Other Threads in the PHP Forum
- Previous Thread: Help Needed
- Next Thread: mysql_num_rows warning
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






