Go Back   vBulletin Setup > vBulletinSetup Information > Troubleshooting vBulletin Problems

Reply 
 
LinkBack Thread Tools Display Modes
Old 04-29-2009, 10:05 AM   #1
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Exclamation Replacement rule

I created a mod that shows an ABC menu up top and when a letter is clicked, it shows all threads in that forum, that begin with that specific letter in the thread title. The plug-in code is:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="asp_thread_listing" active="1">
	<title>Thread Listing by Letter</title>
	<description>Listing of threads by the first letter of the title</description>
	<version>.1</version>
	<url />
	<versioncheckurl />
	<dependencies>
	</dependencies>
	<codes>
	</codes>
	<templates>
	</templates>
	<plugins>
		<plugin active="1" executionorder="5">
			<title>Add Where Letter</title>
			<hookname>forumdisplay_query_threadid</hookname>
			<phpcode><![CDATA[
if(isset($_GET['letter'])) {
    $vbulletin->input->clean_GPC('r', 'letter', 'TYPE_STR');  
    $letter = $db->escape_string($vbulletin->GPC['letter']);

    if($letter == '#') {
        $hook = " AND LEFT(thread.title, 1) BETWEEN 0 AND 9";
    }
    else {
        $hook = " AND LEFT(thread.title, 1) = '$letter'";
    }

    $hook_query_where .= $hook;
}  			
			]]></phpcode>
		</plugin>
	</plugins>
	<phrases>
	</phrases>
	<options>
	</options>
	<helptopics>
	</helptopics>
	<cronentries>
	</cronentries>
	<faqentries>
	</faqentries>
</product>
I have two issues now:

One, I'm trying to figure out the proper code replacement for "forum-path" so a person can copy/past this into forumdisplay template to use the mod globally, not per forum (as I currently have it linked directly to one specific forum).

Example:

Scriptural Bible Answers - Talk Jesus | Christian Forums & Chat

That's the link for letter A.

What should be the replacement for the forum title/path which for me here is "scriptural-bible-answers"?

Code:
<a rel="nofollow" href="http://www.talkjesus.com/forumdisplay.php?f=x">All</a></td>
I tried that like this, it did not work. Also tried this with vbseo enabled, says invalid links:

Code:
        <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=y">Y</a></td>
Talk Jesus | Christian Forums & Chat - Powered by vBulletin

Second question is, I'd like to add a 0-9 # link as well, before the letter A table column.

Example:
Scriptural Bible Answers - Talk Jesus | Christian Forums & Chat

So I want a link like this:

"0-9"

The question is, how can I properly link it so it shows all threads in that forum that begin with any number?

I tried this, does not work, shows no threads but I do have one thread that begins with a letter, "144,000..."

Code:
<a rel="nofollow" href="http://www.talkjesus.com/scriptural-bible-answers/?letter=#">#</a>
Thanks.
Chad is offline   Reply With Quote

Advertisement [Remove Advertisement]

Old 04-29-2009, 12:20 PM   #2
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

Regarding your first question, try the following...

Code:
<a rel="nofollow" href="http://www.talkjesus.com/forumdisplay.php?f=$forum[forumid]&letter=y">All</a>
I'm not sure about your second problems, sorry.
glennybee is offline   Reply With Quote
Old 04-29-2009, 12:40 PM   #3
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Re: Replacement rule

That link method does not work unfortunately.

I get this error on a vbseo enabled board and default vb install, non-vbseo enabled:

Invalid Forum specified. If you followed a valid link, please notify the administrator

The link in the address bar also appears like this:

http://www.talkjesus.com/a/?letter=e

Where the "a" is coming from I do not know.
Chad is offline   Reply With Quote
Old 04-29-2009, 12:52 PM   #4
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

Sorry Chad, I'm not sure how I can help you further.

What is the code you are using at the moment for the specific forum you have it on?
glennybee is offline   Reply With Quote
Old 04-29-2009, 12:54 PM   #5
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Re: Replacement rule

I'm using a forum-specific method at this time

The link example is this:

<a rel="nofollow" href="http://www.talkjesus.com/scriptural-bible-answers/?letter=c">C</a>

Whereas the "scriptural-bible-answers" is the forum name on my vbseo enabled forum.
Chad is offline   Reply With Quote
Old 04-29-2009, 01:21 PM   #6
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

On my vBSEO enabled forum, if I use a regular dynamic vbulletin url, it still works and is then rewritten to a static url, i.e.

Code:
http://www.digital-kaos.co.uk/forums/forumdisplay.php?f=38
This gets rewritten to...

Code:
http://www.digital-kaos.co.uk/forums/f38/
But if I use the same dynamic url on your forum, it shows an error, and it shouldn't. If it worked, the code I suggested above should work.

For example:

Code:
http://www.talkjesus.com/forumdisplay.php?f=10
glennybee is offline   Reply With Quote
Old 04-29-2009, 01:35 PM   #7
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Re: Replacement rule

I don't have a forum ID of 10, but I have 17 (which is that same 'scriptural-bible-answers' forum)

Scriptural Bible Answers - Talk Jesus | Christian Forums & Chat

Redirects properly to

Scriptural Bible Answers - Talk Jesus | Christian Forums & Chat

I'm using default vbseo url rewrite settings (default preset)

Your link method unfortunately still does not work. I'm really confused myself why. I asked vbseo, they have not helped me.

Appreciate your help at least
Chad is offline   Reply With Quote
Old 04-29-2009, 01:56 PM   #8
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

Ah I see, so dynamic urls do work, good.

So this url format works on any forum...

Code:
http://www.talkjesus.com/forumdisplay.php?f=19&letter=a
So in theory this should work...

Code:
<a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]&letter=a">A</>
glennybee is offline   Reply With Quote
Old 04-29-2009, 02:34 PM   #9
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Re: Replacement rule

Thanks.

Tried that too, doesn't work.

The link in the address bar ends up like this

http://www.talkjesus.com/forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]&letter=a
Chad is offline   Reply With Quote
Old 04-29-2009, 02:36 PM   #10
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

Are you putting that code in the address bar or in a template? It should be a template, so what template are you working in?
glennybee is offline   Reply With Quote
Old 04-29-2009, 02:37 PM   #11
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Re: Replacement rule

I'm putting it in forumdisplay.

As for the the link, that's what *appears* in the address bar when I click the link in the menu
Chad is offline   Reply With Quote
Old 04-29-2009, 02:42 PM   #12
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

Ok I just tested this code in my forumdisplay template...

<a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]">A</>

It shows the letter A with a link to that forum and it works in every forum.

This is where I put the code:

Code:
$header
$navbar

<a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]">A</>

<if condition="$show['forumslist']">
<!-- sub-forum list  -->
Does that work for you without the extra code that you want?
glennybee is offline   Reply With Quote
Old 04-29-2009, 02:46 PM   #13
vBulletin Owner
 
Join Date: Oct 2008
Posts: 16
Chad will become famous soon enough
Re: Replacement rule

Doesn't work still
Chad is offline   Reply With Quote
Old 04-29-2009, 02:53 PM   #14
Supporters
vBulletin Owner
 
glennybee's Avatar
 
Join Date: Mar 2008
Location: Scotland
Posts: 1,058
glennybee is just really niceglennybee is just really nice
Re: Replacement rule

Maybe there's something wrong with your rewrite rules because that code should work fine on any forum, even with vBSEO.

Does it work if you disable vBSEO?
glennybee is offline   Reply With Quote
Reply 
vBulletin Setup > vBulletinSetup Information > Troubleshooting vBulletin Problems

Tags
replacement, rule

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
the [ you ] Replacement Hack GeminiFilly Troubleshooting vBulletin Problems 15 07-19-2009 10:02 AM
Replacement Part Established Website Business For Sale! Auctions Webmaster Auctions 0 06-15-2009 12:55 PM
Rule the Web: How to Do Anything and Everything on the Internet---Better, Faster, Eas News Webmaster Auctions 0 06-04-2009 11:20 PM
A replacement for vBSEO virtual HTML headers. The Cadet vBulletin SEO Tips and SEO Questions 8 05-07-2009 01:22 PM
how i can do a replacement in the postes ? big-ah Feedback and Suggestions 2 11-22-2006 08:55 AM


All times are GMT -8. The time now is 11:18 AM.