Back to vBulletin 3 Articles

Add And Use Custom Phrase Type.
by deathemperor 30 May 2006

How to add

Simple, just use these 2 lines in your install code, it will add a new phrase type with phrasegroup_name = tm_phrase, phrasegroup_title = trademanager and productid as trademanager.

PHP Code:
    require_once(DIR '/includes/adminfunctions_language.php');
    
add_phrase_type('tm_phrase''Trade Manager''trademanager'); 
The function reads

PHP Code:
/**
* Allows plugins etc. to add a phrasetype easily
*
* @param    string    Phrasetype name
* @param    string    Phrasetype title
* @param    string    Product ID
*
* @return    mixed    If insert succeeds, returns inserted phrasetypeid
*/
function add_phrase_type($phrasegroup_name$phrasegroup_title$productid 'vbulletin'

How to use

In your script, after:

PHP Code:
// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
include this this line
PHP Code:
// get special phrase groups
$phrasegroups = array('tm_phrase'); 
tm_phrase is the phrasegroup_name that you added as above.

Now you can use the phrases from "Trade Manager" phrase group to your script.

How this helps ?
I can think of these for now:
- Prevent spamming the global phrases, make it getting bigger and bigger.
- Easier to manage. Because it's your own custom phrases
- Make your product more like a product :P.

Notice
- These phrases can only use to replace global phrase. Meaning, instead of create all of them and put to Global phrase, you put it in your own group. So if you want to use them for Permissions, Error Messages, etc. you simply can't.

Correct me if I missed something.

Have fun.

wiritten by deathemperor @ http://www.holvn.org

Similar Mods

Phrase Type Manager vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024