The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hi folks. Need some little help here.
I have this mod I released that shows an ABC link nav menu for any specific forum the code is placed into. https://vborg.vbsupport.ru/showthread.php?t=211939 The letters are linked like this: <a rel="nofollow" href="http://www.yourdomain.com/forumdisplay.php?f=2&letter=a">A</a> However, I'd like to add another link for numbers, but one link for any number: 0-9 and the link would be "#" not "0-9". Clicking the link would show all threads that begin with any number. How can I achieve this? Thanks. |
#2
|
||||
|
||||
![]()
I don't remember the code for that one, but at some point it hooked into a query with code like :
where $something = $letter You'll need to do a conditional. If $letter == '#', your query is going to look like: where $something BETWEEN 0 AND 9 I'm rebuilding my computer at the moment, so I didn't look at the mod. If you need more help, I'll reinstall that and take a second look. Also, I didn't test it, but in theory it should work. ![]() |
#3
|
||||
|
||||
![]()
Thanks Eddie, but I don't know anything about programming past the assistance I was given. If you can figure it out, great thanks.
|
#4
|
||||
|
||||
![]()
Untested...so try it on a test install first:
PHP Code:
|
#5
|
||||
|
||||
![]()
Thanks, but what am I supposed to do with that code? Where does it go in the plugin file?
|
#6
|
||||
|
||||
![]()
That's the updated code. It replaces what's in the plugin.
Also, I looked at the vbseo version, and it doesn't look like it was changed (except that it uses the correct hook). So, I'm wondering if there's either a change that didn't get picked up with the plugin, or if there really needs to be two different files. |
#7
|
||||
|
||||
![]()
Thanks Ed. Still confused though.
The plugin now is this: 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</hookname> <phpcode><![CDATA[if(isset($_GET['letter'])){ $vbulletin->input->clean_GPC('r', 'letter', TYPE_STR); $letter = $db->escape_string($vbulletin->GPC['letter']); $hook_query_where .= " AND LEFT(thread.title, 1) = '$letter'"; }]]></phpcode> </plugin> </plugins> <phrases> </phrases> <options> </options> <helptopics> </helptopics> <cronentries> </cronentries> <faqentries> </faqentries> </product> 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</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> --------------- Added [DATE]1240808021[/DATE] at [TIME]1240808021[/TIME] --------------- Just wanted to give you a heads up. Tested your code on a fresh install, non-vbseo. It always displayed all threads regardless of the letter clicked. |
#8
|
||||
|
||||
![]()
This line is incorrect (PHP Tags "fix" it):
$vbulletin->input->clean_GPC('r', 'letter', 'TYPE_STR); Change it to: PHP Code:
|
#9
|
||||
|
||||
![]() Quote:
Quote:
Quote:
|
#10
|
||||
|
||||
![]()
Thanks, that works now.
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: http://www.talkjesus.com/scriptural-bible-answers/?letter=a" That's the link for letter A. What should be the vbseo replacement for the forum title/path which for me here is "scriptural-bible-answers"? My vbseo panel shows [forum_title] I tried that like this, it did not work. Talk Jesus | Christian Forums & Chat - Powered by vBulletin[forum_title]/?letter=a" I even added a $ before [forum and still does not work. Just redirects back to home page. 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? What would the link code look like for a singe link for "0-9" or better yet, just "#"? Thanks! --------------- Added [DATE]1240864909[/DATE] at [TIME]1240864909[/TIME] --------------- Would appreciate if anyone can help me on this, thanks. I'm trying to make the template versions to one version, vbseo or non-vbseo since vbseo changes it automatically. Regarding 0-9 numbered threads listing: 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> I'm using this in a test forum (fresh install) without vbseo Code:
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center"> <td colspan="30" height="16" class="thead"> <strong>Search topics by first letter</strong><tr align="center"> <td class="alt1" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]">All</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=a">A</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=b">B</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=c">C</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=d">D</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=e">E</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=f">F</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=g">G</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=h">H</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=i">I</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=j">J</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=k">K</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=l">L</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=m">M</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=n">N</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=o">O</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=p">P</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=q">Q</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=r">R</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=s">S</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=t">T</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=u">U</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=v">V</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=y">Y</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=x">X</a></td> <td class="alt2" width="3%"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=y">Y</a></td> <td class="alt1" style="padding:5px;text-align:center"> <a rel="nofollow" href="http://www.talkjesus.com/test/forumdisplay.php?f=$foruminfo[forumid]&letter=Z">Z</a></td> </tr> </table> <br /> |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|