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 |
#112
|
|||
|
|||
And as for your hack I haven't changed anything else than the file name and the filename in the templates.
|
#113
|
||||
|
||||
Ok, nevermind, I got it fixed. Attached is an updated glossary.php file -- if anyone reading this wants vB Code support, use this one.
|
#114
|
|||
|
|||
Cool ! This update works for me.
Thank you so much for the very fast responces and action. It's not only a great hack, but your a great guy too ! |
#115
|
|||
|
|||
What do I need to do to change the background color ?
so that entry 1 is the same background as entry 3 and that entry 2 is the same background as entry 4 etc. etc. Mabye this is already mentioned in this thread but I can't find it. |
#116
|
||||
|
||||
To do that open the glossarybit template and change this:
Code:
$color Code:
{firstaltcolor} Code:
{secondaltcolor} |
#117
|
|||
|
|||
If I change that code to a color code the entire page background color on my list all page will be the same for each and every entry
|
#118
|
||||
|
||||
Yes, isn't that what you wanted? The same color for entry 2, 3, 4, etc.
|
#119
|
|||
|
|||
just as on your list, that you see a darker gray background for entry 1 and a lighter gray for entry 2 and than the darker gray background for 3 and the lighter gray for entry 4 etc etc.
|
#120
|
||||
|
||||
It already does that without any changes. It uses your firstaltcolor and secondaltcolor variables (the ones you use for the background of your posts) to alternate colors.
|
#121
|
|||
|
|||
Not on my board, maybe I installed something wrong or forgot a template!
Which template does this? My glossarybit looks like this : (is this one ok?) <tr bgcolor="$color"> <td width="20%" valign="top"><b><normalfont>$text</normalfont></b></td> <td width="80%" valign="top"><normalfont>$description</normalfont></td> </tr> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|