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 |
#102
|
||||
|
||||
Sorry about that, I forgot to use addslashes() there, I think. I've attached an updated admin_glossary.php file.
|
#103
|
||||
|
||||
this hack is amazing and I love you.
|
#104
|
||||
|
||||
I love you too, man.
|
#105
|
||||
|
||||
Quote:
I'm curious, though, if you can use HTML code/vB Code in the descriptions? I'm asking because I'd like to know if this system could be adapted to post the X-Men character biographics that myself and my site's staff compile. And is there a way that you can link one glossary entry to another (or several others)? |
#106
|
||||
|
||||
I'm curious, though, if you can use HTML code/vB Code in the descriptions.
Yes, you can use HTML...all HTML will be stripped from the Random Term JavaScript display, though. No, right now it doesn't parse for vB Code, but if you want, I could upload a modified glossary.php file and have it do so. It's a VERY minor change, really. And is there a way that you can link one glossary entry to another (or several others)? Well, sort of. You can display only a specific term. Like this (I forgot to add error-checking for it, though, I think): http://www.movieforums.net/glossary.php?glossaryid=48 So, in that sense, you can link to a term directly. I dunno what you mean about several, though. You mean have "related terms" or something? |
#107
|
||||
|
||||
Quote:
Quote:
That would be sweet! |
#108
|
|||
|
|||
Dear TWTCommish,
When I have a text with line breaks and enter it as a new record the line breaks are gone and everything is placed line after line without breaks. Could you make something in your hack that line breaks will be accepted. Its a hugh job to put by hand the <br> codes in. |
#109
|
||||
|
||||
There must be something else going on, because line breaks DO work for me. Are you referring to the random term JS alert, though? If that's the case, then yes, line breaks are removed. But not on the actual glossary listings.
|
#110
|
|||
|
|||
Sorry I'm a little duno
When I have a text and add that to the list it will not project the text as I had copied, all lines are after each other without the <br> codes. When I go into that data to edit it and put myself the <br> codes in everything looks fine, but to do that is a hugh job. |
#111
|
||||
|
||||
I understand what you mean -- but I don't know what to say. It spaces my lines out flawlessly. Anyone else having this problem?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|