nerbert
11-11-2014, 12:55 AM
Does anyone know how vBulletin passes phrases to JavaScript? For now I'm using a php file called with a script tag. Here's a sample of the code:
<?php
require_once('./global.php');
header('Content-type: text/javascript');
header('Pragma:'); // VBIV-8269
header('Cache-control: max-age=31536000');
header('Expires: ' . gmdate("D, d M Y H:i:s", TIMENOW + 31536000) . ' GMT');
define('VB_AREA', 'AdminCP');
define('THIS_SCRIPT', 'phrases');
?>
fmPhrase = {
fm_no_dir : '<?php echo $vbphrase['fm_no_dir']; ?>',
fm_no_file : '<?php echo $vbphrase['fm_no_file']; ?>',
fm_not_mult : '<?php echo $vbphrase['fm_not_mult']; ?>',
fm_not_on_dir : '<?php echo $vbphrase['fm_not_on_dir']; ?>',
fm_if_you_attempt : '<?php echo $vbphrase['fm_if_you_attempt']; ?>',
fm_these_files : '<?php echo $vbphrase['fm_these_files']; ?>',
// etc
}
If it was just a few phrases it could be handled with a short inline script in the head but there are dozens of phrases and settings and it's tiresome and tedious enough to phrase a project without having to add another pair to the phrase object every time.
Could someone point me to the file or function that handles this?
<?php
require_once('./global.php');
header('Content-type: text/javascript');
header('Pragma:'); // VBIV-8269
header('Cache-control: max-age=31536000');
header('Expires: ' . gmdate("D, d M Y H:i:s", TIMENOW + 31536000) . ' GMT');
define('VB_AREA', 'AdminCP');
define('THIS_SCRIPT', 'phrases');
?>
fmPhrase = {
fm_no_dir : '<?php echo $vbphrase['fm_no_dir']; ?>',
fm_no_file : '<?php echo $vbphrase['fm_no_file']; ?>',
fm_not_mult : '<?php echo $vbphrase['fm_not_mult']; ?>',
fm_not_on_dir : '<?php echo $vbphrase['fm_not_on_dir']; ?>',
fm_if_you_attempt : '<?php echo $vbphrase['fm_if_you_attempt']; ?>',
fm_these_files : '<?php echo $vbphrase['fm_these_files']; ?>',
// etc
}
If it was just a few phrases it could be handled with a short inline script in the head but there are dozens of phrases and settings and it's tiresome and tedious enough to phrase a project without having to add another pair to the phrase object every time.
Could someone point me to the file or function that handles this?