PDA

View Full Version : Show Phrase Variable Names


Andreas
11 Jun 2009, 18:43
Sometimes it might be handy to see phrase variable names instead of text on frontend pages - this little plug-in does that for you (with some exceptions like error/redirect messages and dynamically loaded phrasegroups).

style_fetch

if ($vbulletin->debug)
{
foreach ($vbphrase AS $key => $phrase)
{
$vbphrase["$key"] = "*$key*";
}
}

HolyKiller
11 Jun 2012, 08:02
Any way how to do this on vB 4.x ?

Thx

kh99
12 Jun 2012, 23:20
Try using hook global_bootstrap_complete (use style_fetch, see below) and add:

global $vbulletin, $vbphrase;


to the beginning of the code.

HolyKiller
13 Jun 2012, 11:59
THANKS!!! It's working now ! :]

EDIT: With that hook you suggested not all of the phrase varnames are shown, anyway style_fetch hook will do the trick on th ewhole forum.


So, to have all info at one place ...

1] Edit config.cfg and add following line
$config['Misc']['debug'] = true;

2] Create new plugin
Hook Location: style_fetch
Code:

global $vbulletin, $vbphrase;
if ($vbulletin->debug)
{
foreach ($vbphrase AS $key => $phrase)
{
$vbphrase["$key"] = "*$key*";
}
}

Refresh forum (it can take a while)


Credits to Andreas and kh99 :]