Best way to send the content of PHP variables to skin?

Check existing example in /usr/local/directadmin/data/skins/enhanced/user/show_domain.html:

Code:
|$/usr/local/bin/php
<?php
$data = <<<END
|PLUGIN_0_TXT|
END;
if (strlen($data) > 1)
{
echo <<<END
|PLUGIN_0_TXT|<br>
|PLUGIN_1_TXT|<br>
|PLUGIN_5_TXT|<br>
|PLUGIN_7_TXT|<br>
|PLUGIN_9_TXT|
END;
}
?>
DONE|

If it's what you asked for...
 
Hello,
Not exactly.
DA variables are created like this
Code:
|?DA_VAR=strawberry|
So I'd like to do something like this
Code:
$php_var="strawberry";
|?DA_VAR=$php_var|
The reason being that php variables are lost every time you call it in the template, so DA variables should be used in order to avoid doing the same thing in different places on the same page.
 
Last edited:
Did you try something like:

Code:
|$/usr/local/bin/php
<?php
  $php_var="strawberry";
  echo "|?DA_VAR=$php_var|";
?>
DONE|
 
Hello,
Yes, that's the second thing I tried, after putting the statements in a if-then-else block.
The variable will take the value $php_var, not the content of $php_var.
 
Hello,

Unfortunately, no. Scripts are not re-tokenized again.
The scripts are a subset of the tokenzier, so their output doesn't get tokenized again.

If you want to describe what you're trying to do, we may be able to offer other suggestions.

John
 
Hello John,

We want to be able to customize the UI based on variables found in user.conf and domain.conf.

DA provides a limited set of variables that are available in the skin, so we have to use php to import the ones we need.
Currently, if we want to turn on/off features at 3 places on the page, we have to load the script and variables 3 times.

Maybe a solution would be for DA to load everything that is in user.conf and domain.conf as variables?

Olivier
 
Back
Top