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 |
#72
|
|||
|
|||
Thanks TWT for the terms! :up:
Anyone need a button? |
#73
|
|||
|
|||
Okay
well a Show all would be good and i could reall yuse a submit feature. LoL.. just somthing like that would be cool. Anything! thx |
#74
|
||||
|
||||
Thanks Kevin -- awesome button. :up: I think I'll modify this shortly to allow people to view all terms, and maybe even a quick search or something. Anyone think a search would be useful? How do you think the submission thing should be handled, everyone?
|
#75
|
|||
|
|||
Well, I like the idea of members being able to search, if it turns our you have a huge database of terms, this would be ideal. I think allowing those to view all terms would be a nice idea, but if you are going to implement the search feature, there is not much of a reason to implement a "View All", imo.
In regards to allowing "Term Submissions" I think that would be great, but they would have to be moderated in a way, you would not want loads of trash filling up your glossary for you to later have to delete. Maybe have a form where only members can fill it out, once they fill it out, it is directly sent to the webmaster/administrator with the term and it's difinition. Once the admin/webmaster reviews it, he/she can then add it to the database (this would take away the time it takes to moderate them, instead, it directly goes to the admin/webmaster). Just my thoughts. - Still a nice hack |
#76
|
|||
|
|||
I was looking at kevins button that he attached and thought I would post one with the border on it for those that wanted it.
|
#77
|
||||
|
||||
http://www.movieforums.net/glossary.php?ltr=D
LOL! Looks interesting. I might install it. I know it's hard enough trying to keep up with the slang of Star Wars geeks - much less SW geeks who roleplay. |
#78
|
|||
|
|||
Got vbp3.0pr7 and vb2.2.2 and all is working great!
Thanks. |
#79
|
|||
|
|||
Cool Hack!
I would love to have a 'list all' option, any suggestions how to do this, or 'TWTCommish' could you add that to the script? Many thanks in advance. |
#80
|
|||
|
|||
good idea.
|
#81
|
||||
|
||||
Ok, I added the functionality for this. I've attached the new glossary.php file to this post...just upload it over the old one...but make the template changes first, naturally.
Find this in your glossary template: Code:
<td width="100%"><normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> > Glossary</b></normalfont></td> Code:
<td width="50%" align="right">$view_all</td> Code:
<normalfont><a href="$bburl/glossary.php?s=$session[sessionhash]&view=all">View All</a></normalfont> Code:
<normalfont color="white"><b>View All</b></normalfont> http://www.movieforums.net/glossary.php Let me know if I've missed anything (more than likely!). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|