Log in

View Full Version : include and vbphrases


pmfp
04-14-2006, 12:55 PM
Hi everyone!

I have a problem with include's and phrases. It has been recreated in the files test.php and includes/test_include.php.

The problem is that the code is executed and the template fetched, but the phrase is not being printed. The nature of the real script means that I cannot use another plugin to insert the code, so that is out of the question.
Any ideas on how to do this properly?

test.php:
<?php

error_reporting(E_ALL & ~E_NOTICE);

define('THIS_SCRIPT', 'db_update');
$phrasegroups = array('test_phrases');

include('includes/test_include.php');

require_once('./global.php');

did_it();
?>
includes/test_include.php:

<?php

function did_it() {
$varvar = "set";

eval('print_output("' . fetch_template('test_splitter') . '");');
}
?>
test_splitter template:
<tr>
<td width="310" valign="top" class="thead">
<if condition="$varvar==set">$vbphrase[test_hello_world]</if>
</td>
<td valign="top" class="thead"></td>
</tr>

peterska2
04-14-2006, 01:39 PM
Have you actaully created the phrase group and phrases?

If the phrase [test_hello_world] does not exist in a phrase group called "test phrases" then it won't call anything.

pmfp
04-15-2006, 06:05 PM
Yes, and they work if the eval is not done in a function.

M :cross-eyed:

Paul M
04-15-2006, 08:50 PM
add a global $vbulletin into the function.

pmfp
04-16-2006, 07:47 PM
Already there, doesn't work.

M

However, global $vbphrase works! :banana:

Thanks!

Martin