vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Random Glossary Term [vBa CMPS module] (https://vborg.vbsupport.ru/showthread.php?t=111900)

RS_Jelle 03-31-2006 10:00 PM

Random Glossary Term [vBa CMPS module]
 
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.

https://vborg.vbsupport.ru/external/2010/10/30.jpg

================================================== ========================
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.

SaN-DeeP 04-01-2006 09:31 PM

this is way to quick addon release :)

louis_chypher 04-20-2006 02:22 PM

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!

RS_Jelle 04-20-2006 03:08 PM

Thanks for reporting this issue, I fixed it ;)

dendrob 04-22-2006 08:29 PM

any way to add a block like this to VBDrupal ?

RS_Jelle 04-26-2006 06:43 PM

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.

Neutral Singh 05-14-2006 02:36 PM

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

jaks 07-03-2006 10:37 PM

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:

RS_Jelle 07-05-2006 08:10 AM

@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 :)

cookiepants 07-25-2006 07:06 AM

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

:D

Megan
http://www.sewingmamas.com/b/


All times are GMT. The time now is 10:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01225 seconds
  • Memory Usage 1,759KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete