vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Modifying phrasegroup array from plug-in (https://vborg.vbsupport.ru/showthread.php?t=129022)

mferguson 10-13-2006 07:13 PM

Modifying phrasegroup array from plug-in
 
I'm working on a product that has a custom phrase group and will present menu items in the User CP menu using this phrase group. The phrase group isn't loaded into the global phrase group so I would like to cause it to be added to the phrasegroups used for UserCP using a plugin. In the usercp.php code phrasegroups are loaded as:

PHP Code:

// get special phrase groups
$phrasegroups = array('user''infractionlevel'); 

I've done one test using the following code in usercp.php and it works as expected (my phrases are used in the UserCP menu):

PHP Code:

// get special phrase groups
$phrasegroups = array('user''infractionlevel''my_custom_phrases'); 

Given this I returned the usercp.php to its original form and created a usercp_start hook-based plugin with the following:

PHP Code:

$phrasegroups[] = 'dto_garage'

When using this my phrases are no longer displayed in UserCP (ie - they aren't being found)

I've also tried the following without success:

PHP Code:

$my_array = array('my_custom_phrases');
$phrasegroups array_merge($phrasegroups$my_array); 

Is this one of those issues where there is no way to add to the phrasegroups array during runtime for a specific piece of vB code or am I just not using the proper syntax or hook location?

Thanks for any assistance you can provide!

Mark

Oreamnos 10-24-2006 04:19 AM

Any luck with this? Im having the same problems...

Paul M 10-24-2006 07:31 AM

Phrases are built pretty early in global.php, the only hook I think you could use is init_startup.

Oreamnos 10-24-2006 07:52 AM

Quote:

Originally Posted by Paul M
Phrases are built pretty early in global.php, the only hook I think you could use is init_startup.

thanks, i'll try that and see what happens...

Antivirus 01-08-2007 08:15 PM

Quote:

Originally Posted by Paul M (Post 1103300)
Phrases are built pretty early in global.php, the only hook I think you could use is init_startup.

That works great Paul, thanks.


All times are GMT. The time now is 01:11 AM.

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.01005 seconds
  • Memory Usage 1,724KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete