This topic is locked

new template files don´t use the ##VARIABLES##

3/28/2006 8:36:34 AM
PHPRunner General questions
rjks author

Hello Runners,
First my thanks for a system which saves time and money, good and improving support and last but not least a collection of PHP Runners who are mor inclined to help each other than hinder.
Now to my question, the introduction of templates was a major improvement in the system which reduded Project time even more. In the Templates it is possible to import external files which are then included in the build run.
My problem is that the PHPRunner variables are being ignored and appear in the built file as ##VARIABLE##
and not as in the standard files. For example if I make a copy of the menu.php in my template here a piece of code.
origional PHPRunner menu.php

<?php

ini_set("display_errors","1");

ini_set("display_startup_errors","1");

session_start();

set_magic_quotes_runtime(0);
include("include/dbcommon.php");

LOGIN##

if(!@$_SESSION["UserID"])

{

header("Location: login.php");

return;

}

/LOGIN##


MULTILANG##include("include/languages.php");##/MULTILANG


This then becomes in the built code

<?php

ini_set("display_errors","1");

ini_set("display_startup_errors","1");

session_start();

set_magic_quotes_runtime(0);
include("include/dbcommon.php");
if(!@$_SESSION["UserID"])

{

header("Location: login.php");

return;

}
include("include/languages.php");
?>


However the same code in an external php file becomes

<?php

ini_set("display_errors","1");

ini_set("display_startup_errors","1");

session_start();

set_magic_quotes_runtime(0);
include("include/dbcommon.php");

LOGIN##

if(!@$_SESSION["UserID"])

{

header("Location: login.php");

return;

}

/LOGIN##


MULTILANG##include("include/languages.php");##/MULTILANG##



?>


This is only an example to show that the PHPRunner Variables are ignored.
Question:

Is it possible to have external files scanned for PHPRunner Variables and to use them?
Question:

If I put my code into the PHPRunner menu.php and use PHPRunner Variables will they be processed?
thanks in advance for any help.
Robert

Admin 3/29/2006

Hi,
Only origional template files are processed in PHPRunner.

You can edit external files manually.

rjks author 3/29/2006

Hi,

Only origional template files are processed in PHPRunner.

You can edit external files manually.


Hi,
QUESTION:
so that means that if I change the origional template files I can use the ##VARIABLES## and ##FUNCTIONS## if I can guess exactly what they do??
i.e. ##TABLES## runs through all available tables and sets ##TABLENAME## ##SHORTTABLENAME## and ##CAPTION## for each cycle.
I can then check my Tablenames i.e. sys_admin and setup a menuautomatically with Group_id?
Thanks in advance
Robert

Admin 3/29/2006

Robert,

so that means that if I change the origional template files I can use the ##VARIABLES## and ##FUNCTIONS## if I can guess exactly what they do??

i.e. ##TABLES## runs through all available tables and sets ##TABLENAME## ##SHORTTABLENAME## and ##CAPTION## for each cycle.
I can then check my Tablenames i.e. sys_admin and setup a menuautomatically with Group_id?



Yes, you can.

I can then check my Tablenames i.e. sys_admin and setup a menuautomatically with Group_id?



I'm not sure that I understand you correctly. Please clarify you question.

rjks author 3/29/2006



I can then check my Tablenames i.e. sys_admin and setup a menuautomatically with Group_id?



I'm not sure that I understand you correctly. Please clarify you question.

[/quote]
Hi again,
I meant that as group_id is saved in the session I can use it in the menu file to set the visibility of my menu.
it works, thanks for the reply.
Robert

Admin 3/29/2006

Robert,
yes, group id is saved in $_SESSION["GroupID"] variable and you can use it for your purposes.