Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by TWTCommish TWTCommish is offline
Developer Last Online: Dec 2022 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-22-2002 Last Update: Never Installs: 34
 
No support by the author.

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;
Attched to the post right after this one is an archive: files.zip. This archive contains two files: glossary.php and admin_glossary.php. The first goes in your main forums directory. The second should be uploaded into your /admin/ directory.

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");
// ***
Right after that, add this:

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>");
There, it should work now! Now, on to the extras (well worth installing, in my opinion):

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);
Right after it, add this:

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)));
Yeah, that last line is a little messy -- I like saving space, though.

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);
After that, add the same bit of code above.

Next: the templates. Find the below in both templates...

Code:
$vbcode_smilies</td>
...and in both templates, replace it with this:

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>
There, you're done!


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;
Right after it, add this:

Code:
	case 'gl': $goto = 'glossary'; break;
Next (and last) step: open the forumjump template and add this bit of code somewhere amongst the other options...where you put it depends on where you want it in the menu.

Code:
		<option value="gl" $frmjmpsel[glossary]>The Glossary</option>
That's it! All done. Enjoy.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 01-23-2002, 05:10 AM
Lucky Lucky is offline
 
Join Date: Dec 2001
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did any of you notice that the newreply.php and newthread.php get an error when you try to add what is said to be added to both?

Just wondering?

BTW:
I too am unable to add in admin cp.
Reply With Quote
  #13  
Old 01-23-2002, 05:28 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Lucky
Did any of you notice that the newreply.php and newthread.php get an error when you try to add what is said to be added to both?

Just wondering?

BTW:
I too am unable to add in admin cp.
I never went that far. I just ran the query, uploaded the files and modified admin/index.php. I wanted to test it out first. But, it doesn't work. I feel like a moron. I've been messing with it all night and I can't figure out what's wrong with the admin file. I can add entries manually using the exact same query that's in the admin file. I'm missing something totally obvious.
Reply With Quote
  #14  
Old 01-23-2002, 06:10 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am also getting 404 with both admin. Never went past that.
Reply With Quote
  #15  
Old 01-23-2002, 06:16 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in doformheader you put glossary. It should be admin_glossary.
Reply With Quote
  #16  
Old 01-23-2002, 06:21 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks.
You should replace every instance of doformheader with admin_glossary, since this is what you are posting, not glossary. Now up to the second part.
Reply With Quote
  #17  
Old 01-23-2002, 06:36 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Lionel
in doformheader you put glossary. It should be admin_glossary.
You rule, Lionel! That did the trick. I'm still used to simple forms. Now I understand the vB admin ones a whole lot better.
Reply With Quote
  #18  
Old 01-23-2002, 06:36 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

but you should fix your instructions in newthread and newreply templates. You should not replace the smilies code, but add next to it or you disappear smilies.... Great!
now up to last part
Reply With Quote
  #19  
Old 01-23-2002, 06:43 AM
Lucky Lucky is offline
 
Join Date: Dec 2001
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Lionel
thanks.
You should replace every instance of doformheader with admin_glossary, since this is what you are posting, not glossary. Now up to the second part.
Ok.

I have replaced every instance of doformheader with admin_glossary instead of glossary and I am still getting the following:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Any ideas?

BTW:
Which admin_glossary were you using?
The one from the 1st post or the update?
Reply With Quote
  #20  
Old 01-23-2002, 06:43 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on 2.21. Works great. Now we have to poulate it. Who is going to be nice and give us some texts startup boost? :supwink:
Reply With Quote
  #21  
Old 01-23-2002, 06:44 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used the second one. After problems, I downloaded it and never replaced it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10123 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete