Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Random Glossary Term [vBa CMPS module] Details »»
Random Glossary Term [vBa CMPS module]
Version: 1.0.1, by RS_Jelle RS_Jelle is offline
Developer Last Online: May 2016 Show Printable Version Email this Page

Version: 3.5.x Rating:
Released: 03-31-2006 Last Update: 04-19-2006 Installs: 26
Template Edits
Additional Files  
No support by the author.

This vBadvanced CMPS module displays a random term of Mindestic GlosPro.

I tested it on vBulletin 3.5.4 with vBadvanced CMPS 2.1.0 and vBGlossary Basics 1.1.0.

It adds one query to a vBa page and it's fully phrased and 100% W3C XHTML 1.0 compliant.



================================================== ========================
Installation
================================================== ========================
  • Upload all files from the "upload" directory into your forum directory.
  • Create a new template called "adv_portal_glossary_random_term" with the following content:

    HTML Code:
    <tr>
    	<td class="alt1">
    		<div align="center">
    			<a href="$vboptions[bburl]/glossary.php?$session[sessionurl]do=viewglossary&amp;term=$glossary_module_term_id"><img src="$vboptions[bburl]/images/question-mark.gif" border="0" alt="$vbphrase[glossary]" title="$glossary_module_term_name" /></a>
    			<br /><a href="$vboptions[bburl]/glossary.php?$session[sessionurl]do=viewglossary&amp;term=$glossary_module_term_id"><strong>$glossary_module_term_name</strong></a>
    		</div>
    	</td>
    </tr>
    <tr>
    	<td class="alt2">
    		<div align="center">
    			<span class="smallfont"><a href="$vboptions[bburl]/glossary.php?$session[sessionurl]">[$vbphrase[glossary]]</a></span>
    		</div>
    	</td>
    </tr>
  • Create a new vBa CMPS PHP file module (AdminCP => vBa CMPS => Add Module => [PHP File]) with the following info:
    - Title: Random Term (or choose another one)
    - File to Include: glossary_random_term.php
    - Identifier: glossaryrandomterm (or choose another one)
    - Templates Used: adv_portal_glossary_random_term

================================================== ========================
Requirements
================================================== ========================
  • vBulletin 3.5.x or 3.6.x
  • vBadvanced CMPS
  • vBGlossary Basics (now called Mindestic GlosPro)

================================================== ========================
History
================================================== ========================
- 1.0.0: Initial release
- 1.0.1: Fixed a little bug

The question mark graphic is made by Norke (Yannick De Smet).

If you use this add-on, please click install to say thanks and to receive updates.

Show Your Support

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

Comments
  #2  
Old 04-01-2006, 09:31 PM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is way to quick addon release
Reply With Quote
  #3  
Old 04-20-2006, 02:22 PM
louis_chypher's Avatar
louis_chypher louis_chypher is offline
 
Join Date: Mar 2006
Location: Boise, Idaho
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had to change the adv_portal_glossary_random_term template to:
Code:
<tr>
	<td class="alt1">
		<div align="center">
			<a href="$vboptions[bburl]/glossary.php?$session[sessionurl]do=viewglossary&amp;term=$glossary_module_term_id"><img src="$vboptions[bburl]/images/question-mark.gif" border="0" alt="$vbphrase[glossary]" title="$glossary_module_term_name" /></a>
			<br /><a href="$vboptions[bburl]/glossary.php?$session[sessionurl]do=viewglossary&amp;term=$glossary_module_term_id"><strong>$glossary_module_term_name</strong></a>
		</div>
	</td>
</tr>
<tr>
	<td class="alt2">
		<div align="center">
			<span class="smallfont"><a href="$vboptions[bburl]/glossary.php?$session[sessionurl]">[$vbphrase[glossary]]</a></span>
		</div>
	</td>
</tr>
In order to get the path to correctly reflect the locations of My files.

Oh, Thanks!
Reply With Quote
  #4  
Old 04-20-2006, 03:08 PM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for reporting this issue, I fixed it
Reply With Quote
  #5  
Old 04-22-2006, 08:29 PM
dendrob dendrob is offline
 
Join Date: Mar 2006
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any way to add a block like this to VBDrupal ?
Reply With Quote
  #6  
Old 04-26-2006, 06:43 PM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dendrob
any way to add a block like this to VBDrupal ?
I'm sorry, but this isn't possible. I'm only using vBadvanced CMPS (and testing a bit with vbPortal), but I don't use vBDrupal.
Reply With Quote
  #7  
Old 05-14-2006, 02:36 PM
Neutral Singh's Avatar
Neutral Singh Neutral Singh is offline
 
Join Date: Sep 2004
Location: Sikh Philosophy Network
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi I was trying to add glossary description as well in the module. so i edited the module php file as follows:

Code:
<?php

if (($permissions['glossarypermissions'] & $vbulletin->bf_ugp_glossarypermissions['canviewglossary']) AND $vbulletin->options['vbglossaryactive'])
{
	$glossary_module_content = '';

	$glossary_content_query = $db->query_read("SELECT glossaryid, glossaryname, glossarydescription
						FROM " . TABLE_PREFIX . "glossary
						WHERE glossaryvalid = 1
						ORDER BY RAND()
						LIMIT 1
	");

	$glossary_content_fetcharray = $db->fetch_array($glossary_content_query);

	$glossary_module_term_id = $glossary_content_fetcharray['glossaryid'];
	$glossary_module_term_name = $glossary_content_fetcharray['glossaryname'];
	$glossary_module_description = $glossary_content_fetcharray['glossarydescription'];

	$db->free_result($glossary_content_query);
}

eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_glossary_random_term') . '";');

?>
Now, although the glossary description is also showing up it is also showing some garbage html along with it, how do i remove that garbage... thanks for the module.

Just have a look at top right side at my website: http://www.sikhphilosophy.net

Thanks
Reply With Quote
  #8  
Old 07-03-2006, 10:37 PM
jaks jaks is offline
 
Join Date: Dec 2004
Location: Toronto
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd love to have the description with the html being parsed aswell but I would need it limited to a certain number of words.:cross-eyed:
Reply With Quote
  #9  
Old 07-05-2006, 08:10 AM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Neutral Singh: Instead of your extra code, use this:
PHP Code:
$glossary_module_description strip_bbcode($glossary_content_fetcharray['glossarydescription'], falsefalsefalse); 
And to use this function, you need functions.php (put it in the beginning of the if statement):
PHP Code:
require_once('./includes/functions.php'); 
@jaks: Have a look at Neutral Singh's post and this post. Then just put the $glossary_module_description variable where you want it in the template.
To limit the number of characters, add this after the strip_bbcode line:
PHP Code:
$glossary_module_description substr($glossary_module_description,0,20); 
Change the 20 to the amount of characters you want
Reply With Quote
  #10  
Old 07-25-2006, 07:06 AM
cookiepants cookiepants is offline
 
Join Date: Jul 2006
Location: Nor Cal
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works perfect for us, thanks! It also helped me learn vBadvanced coding a little bit



Megan
http://www.sewingmamas.com/b/
Reply With Quote
Reply

Thread Tools

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 08:13 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.07687 seconds
  • Memory Usage 2,304KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)bbcode_html
  • (3)bbcode_php
  • (1)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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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