PDA

View Full Version : Easy question - vbphrases dont' work


Dionysis
07-12-2005, 04:18 AM
I'm creating a new file and wondering why Vbphrases arn't working while almost all other variables are...

the file is simply:


chdir('/blah/vbulletin');
require_once('./global.php');
require_once('./includes/adminfunctions_template.php');

chdir('/blah/vbulletin/admincp');
require_once('./global.php');


//back end importing done, start grabbing variables and do the script


echo $vbphrase['expand_all_template_groups'];

which returns nothing for the echo.... any ideas?

Guest190829
07-12-2005, 04:24 AM
Phrases are usually put in a template and then parsed by the php automatically, I don't know if you can do it this way, since I never tried.

Dionysis
07-12-2005, 04:35 AM
it should, $vbphrase is just a bigass array. my real problem is more along the lines of this line:

construct_link_code("<b>" . COLLAPSECODE . "</b>", "template.php?$session[sessionurl]do=modify&amp;expandset=$expandset&amp;section=$sectionarr ay[sectionid]", 0, $vbphrase['collapse_all_template_groups']).

and many others in the admincp page i'm trying to create.

Marco van Herwaarden
07-12-2005, 05:57 AM
First of all you shouldn't use both the normal global.php and the adminc/global.php. Only the admin should be enough.

you might need to add the following after all included scripts:
global $vbphrase;

Dionysis
07-12-2005, 06:03 AM
I need to include both global.php's because of the functions i'm running through the script ^_^.

Also, since both are included I removed the "global $vbphrase;" since $vbphrase = init_lang(); is already included in one of the global.php's.

Also, i've tried a "global $vbphrase;" and that still didn't work. In any matter, the script i posted originally should work (i think). still not sure of the problem, why vbphrase isn't working.

Marco van Herwaarden
07-12-2005, 06:11 AM
In which phrasegroup is the phrase you are trying to use? Not all groups are loaded by default.

Dionysis
07-12-2005, 06:48 AM
hrm. good question. which phrasegroup is used in the adminCP?

Marco van Herwaarden
07-12-2005, 08:46 AM
Different ones. Just lookup the phrase you want to use and see which group it belongs to.

Dionysis
07-13-2005, 02:14 AM
ok where do i do that, for example this phrase "$vbphrase['all_template_groups']"
how do i load that into my script?

Dionysis
07-14-2005, 02:33 AM
bueler bueler?

SuprSurfr
07-19-2005, 07:38 PM
2. Add the following phrase to phrasegroup Forum-Related Phrases
varname: prune_after
text: Prune After<dfn>Stetting this to a value > 0 will automatically prune all threads from this forum where the last reply is older then the set amount of days</dfn>

Sorry, Could you explain exactly what to do here? I am new to VB and dont have a clue where to start on this step.


Wooops Wrong area!