943,394 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 110888
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Aug 15th, 2004
0

Re: vBulletin mod_rewrite

I see, btw is there a demo of this hack somewhere ? Or is this forum already the working example without any extra hacks

Also, i noticed announcements are still using the normal URL ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ToOnZ is offline Offline
6 posts
since Aug 2004
Aug 15th, 2004
0

Re: vBulletin mod_rewrite

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/
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Aug 16th, 2004
0

Re: vBulletin mod_rewrite

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.
Reputation Points: 10
Solved Threads: 0
Light Poster
Ted S is offline Offline
40 posts
since Aug 2004
Aug 16th, 2004
0

Re: vBulletin mod_rewrite

Cool hack there, i think i shall use it on my forum and let the googlies in :cheesy:
Reputation Points: 13
Solved Threads: 2
Junior Poster
YoungCoder is offline Offline
193 posts
since Aug 2004
Aug 17th, 2004
0

Re: vBulletin mod_rewrite

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:

PHP Syntax (Toggle Plain Text)
  1. <a href="$forum['url'].html">
But I got an error so had to change to:

PHP Syntax (Toggle Plain Text)
  1. <a href="$forum[url].html">

In Step four Part one I had to use:
PHP Syntax (Toggle Plain Text)
  1. <a href="lastpostinthread$thread[threadid].html">
Instead of the instructed:
PHP Syntax (Toggle Plain Text)
  1. <a href="lastpostinthread[threadid].html">

All works fine now.

I also used the rewrite rule Teds posted:
PHP Syntax (Toggle Plain Text)
  1. RewriteRule ^/f([0-9]+)-(.*).html$ /forumdisplay.php?forumid=$1 [L]
But as my .htaccess file is in my forum directory I had to remove the /'s to make it work:
PHP Syntax (Toggle Plain Text)
  1. RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]

Thanks again :mrgreen:
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SiFor is offline Offline
3 posts
since Aug 2004
Aug 17th, 2004
0

Re: vBulletin mod_rewrite

The change you made in Step 4 Part 1 would make it stop working?
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Aug 17th, 2004
0

Re: vBulletin mod_rewrite

It may be the way I posted it:

PHP Syntax (Toggle Plain Text)
  1. <a href="lastpostinthread[threadid].html">
That is the code as instructed in the first post.

I had to chage it to this:
PHP Syntax (Toggle Plain Text)
  1. <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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SiFor is offline Offline
3 posts
since Aug 2004
Aug 17th, 2004
0

Re: vBulletin mod_rewrite

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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Aug 17th, 2004
0

Re: vBulletin mod_rewrite

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.
Reputation Points: 10
Solved Threads: 1
Light Poster
I, Brian is offline Offline
47 posts
since Mar 2004
Aug 17th, 2004
0

Re: vBulletin mod_rewrite

Look at all of the templates in the FORUMHOME template group and replace all occurrences of <a href="forumdisplay.php?..."> with <a href="$forum['url'].html">
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: DNS subdomain wildcard
Next Thread in PHP Forum Timeline: Perplexed Newbie can't find syntax errors





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC