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.