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 |
#222
|
||||
|
||||
i just installed it, and it works perfectly with no problems
|
#223
|
||||
|
||||
Quote:
I also had a question, how hard would it be to modify the hack so that you use the glossary for something else? Like say I want a glossary, but I also want to use the same type of formating for another idea? How hard would it be tweak the current code so that there are like 2 glossaries (sp?) and 1 works as a glossary and the other works for another purpose? Please let us/me know how the hacking is going. Thanks. |
#224
|
||||
|
||||
How do I get the glossary word to link to itself on an individual page? That way people can click the word and have that word and it' description the only thing on the page. Can anybody help me with this? I think it would be simple, but I can't seem to figure it out.
|
#225
|
||||
|
||||
bump
|
#226
|
||||
|
||||
Very nice hack - working fine with 2.3.0. Not sure how I managed to miss this one for so long. Got a few ideas for modifying this, I'll let you know how it goes.
|
#227
|
||||
|
||||
At the risk of echoing what others have already said, this is an awesome hack, TWTCommish!
I'm also thoroughly impressly by the level of creativity of my fellow vBulletin hackers on this thread. It seems there are some great ideas out there for "interpreting" this script for various uses. Like others have stated, I'd be quite interested in:[list=1][*]The ability for user-submitted (yet moderated) entries[*]A "quick search" box.[/list=1] The vB Links Directory (now under version 3.0 development at this thread may offer a good model for incorporating these features. I'd love to take a try at it, but I'm still within my first six months as a vBer, and don't feel quite ready to forray into scripting my own hacks yet. So, in the spirit of our hacker's site - is anyone seeing The Matrix: Reloaded today? |
#228
|
||||
|
||||
Thank you TWTCommish, yet again!
I've taken this little gem and converted it into an online herbal. I'll be redoing some code within the structure of the mod and admin CPs to allow for formatting buttons when placing new listings. All in all my herbalist Mods and my users thank you as well for allowing us to have the herbal up and running with minimal time for coding the backend! Thank you! )O( Cloudrunner )O( P.S. Was curious as to your thoughts on recycling the code for the vb buttons within newthread / newreply. Will this break the glossary code with the admin CP at all do you think? |
#229
|
||||
|
||||
The Matrix: Reloaded - no, I have not.
Has somebody tried to make an e-library of it? |
#230
|
|||
|
|||
I was wondering if anybody's modified the code so that when you first enter the glossary it will list total terms/definitions in the database?
If you have a big glossary it's nice to be able to show just how many terms you have in there. Also, has anybody worked on the user-submission for the glossary? Would be nice to have registered members be able to suggest glossary they feel belong and have moderators/admin approve these much like moderated posts. Other than that I have to say this is a killer hack, and we're loving it already! You can see ours in action here. Thanks again for a great hack, and I really hope you keep working on this gem! |
#231
|
||||
|
||||
yes, I have actually....contact me for how to do it.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|