The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
I must pay homage to user/moderator wluke for this idea. I must also thank him for allowing me to run with it, and release it publicly. Thanks Wayne!
What's it do? Simple: creates a glossary of terms. They're sorted alphabetically much in the same way the Memberlist is. I find this is extremely useful for most forums, which surely have a lot of their own lingo. For my site, it's a few acronyms and goofy phrases. My members get a kick out of referring newbies to the glossary to learn about the phrases. It's really helped the whole place seem less like a clique...because others can catch up easily with a reference like this. Here's a live demo What's it take? This hack involves a MySQL command, the uploading of two files, the modification of one, and the creation of five templates. It also requires the modification of a second file, and of two templates, if you want to display a random glossary term on the New Reply/New Thread pages. It'll require a bit more still if you want to add the Glossary to your forum jump menu. First off, run the following query in MySQL. This is the table that will store the glossary data. Code:
CREATE TABLE `glossary` ( `glossaryid` int(11) NOT NULL auto_increment, `text` text NOT NULL, `description` text NOT NULL, PRIMARY KEY (`glossaryid`) ) TYPE=MyISAM; Next, you'll need to create five templates. I've attached a text file containing all five to this post. Should be pretty straightforward. Mess with the formatting as you see fit, of course. After that, you'll probably want to open (back it up!!!) your /admin/index.php file. Find the code below (around line 340): Code:
makenavselect("Templates"); // *** Code:
makenavoption("Add", "admin_glossary.php?action=add", "|"); makenavoption("Edit", "admin_glossary.php?action=edit", "|"); makenavoption("Delete", "admin_glossary.php?action=delete"); makenavselect("Glossary", "<hr><br>"); Display a random glossary term on new thread/new reply pages Open newreply.php and find the following code (around line 468...it should be right near the end of the file): Code:
getforumrules($foruminfo,$permissions); Code:
$rand_term = $DB_site->query_first("SELECT text AS term_text, description AS term_description FROM glossary ORDER BY RAND()"); extract($rand_term); $term_description = str_replace("'", "\\'", htmlspecialchars(strip_tags($term_description))); Save and upload. Next, open newthread.php and find the same bit of code (duplicated below) around line 368 or so: Code:
getforumrules($foruminfo,$permissions); Next: the templates. Find the below in both templates... Code:
$vbcode_smilies</td> Code:
$vbcode_smilies<br><center><smallfont><b>Random Term: <a href="#" onclick="alert('$term_description'); return false;">$term_text</a></b></smallfont><br> <smallfont><a href="$bburl/glossary.php" target="_blank">More Glossary Terms!</a></smallfont><br></td> Add vBGlossary to the forum jump menu Open forumdisplay.php in your main forums directory. Find this, near the top of the file (line 13 or so): Code:
case 'cp': $goto = 'usercp'; break; Code:
case 'gl': $goto = 'glossary'; break; Code:
<option value="gl" $frmjmpsel[glossary]>The Glossary</option> I hope you all enjoy this hack. It didn't take nearly as much time/effort as I thought it would...I really love it, though. Show Your Support
|
Comments |
#92
|
|||
|
|||
First off this seems to be slowing down nethread.php quite a bit. I have an error which maybe be the reason for the slow down:
Line: 316 Char: 75 Error: Undetermind string constant Code: 0 Now besides that error When you click the term it like refreshes the page, takesm e to the top of it or something but nothing happens. My line 316 looks like: </table><br><center><font face="verdana,arial,helvetica" size="1" ><b>Random Term: <a href="#" onclick="alert('Basic Performance Upgrades (with or without multiple + indicators) When I look at it in my view source it seems to be splitting after the word Upgrades. I guess there is a space somewhere in the code I put in a template or *.php file? Thanks! |
#93
|
||||
|
||||
Yeah, I think you'd have to show me what specific code you're using and such. I was pretty sure I'd taken all parsing problems like that out of the equation. You're getting a JS error. As for newthread.php -- it's only adding one query, so it shouldn't be slowing it down much.
|
#94
|
|||
|
|||
Seems to be working fine for me, I just installed 2.2.2 last night and installed this hack right after and it is working perfectly, I did not get any of the above errors. Maybe you accidentaly added some extra coding without noticing it and that is the cause for this problem.
Though, it is working great on my vB 2.2.2. Thanks for a great hack TWT! |
#95
|
|||
|
|||
I probably have to go over the code again, It's just after I installed it my friend looked at it and he's a really good coder and he couldn't figure it out.. so I figured lemme throw it up on here.. I'll try it again..
|
#96
|
||||
|
||||
Well, a coder, even a good one, may not understand vBulletin code (and while my code is not vBulletin code, it uses the same customs and functions for the most part)...to really understand what's going on they'd probably have to look at some of the inner-workings of it first. I assure you it works fine and makes sense, though.
|
#97
|
|||
|
|||
Code he knows, he wrote one of the biggest & best scripts one here.. it's the java he doesn't really do..
|
#98
|
||||
|
||||
I'm confused...I'm not saying he doesn't "know code," but knowing code doesn't mean you know someone else's functions very well. Also, there's no Java in vBulletin, or in my hack. Theres a tiny bit of JavaScript, though (it's actually very, very different from Java, despite the name)...but there's hardly any of it at all. Are you saying that he doesn't know anything about JavaScript?
BTW: which script did he write? I'm sort of curious. |
#99
|
|||
|
|||
I will take a guess.....TubeDogg?
I am just judging from your avatar, I have seen it somewhere other than here I believe, it may have been at PixelJuction. |
#100
|
|||
|
|||
It's working on my site fine.
I had it installed before upgrading to 2.2.2 and it was working just fine. Upgraded to 2.2.2 and still no problems. You can see it working here And for the "sorry no matches" message ... I just added PHP Code:
Anthony |
#101
|
||||
|
||||
What a fantastic hack, TWT! I run a site dedicated to Marvel Comics' X-Men, and with 30 years of history to them there's a lot of terms and acronyms that often need explaining. Now, with this glossary hack, that'll be a breeze! Thanks!
One thing, though, and that is I get an SQL error whenever I try and edit a glossary entry. Database error in vBulletin Control Panel 2.2.2: Invalid SQL: UPDATE glossary SET text = 'Adamantium', description = 'An artificially created alloy of iron that is the most impervious substance known on Earth, with the exception of the unknown Adamantium-Vibranium alloy of which Captain America's shield is composed.' WHERE glossaryid = '1' mysql error: You have an error in your SQL syntax near 's shield is composed.' WHERE glossaryid = '1'' at line 1 mysql error number: 1064 Add and delete work fine, so I've just been deleting an entry I need to edit and re-adding it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|