2015-12-30, 07:01 PM
I'm not sure if it's the right section. Please let me know if it is not.
I've added some custom information from the database in global.php file.
What I have added:
Then I edited the header template. I've added:
When I try to save the template it says:
If I delete my custom vars, the template is saved as expected.
I've found some threads about the same error, but none of them could solve my specific problem.
Thanks in advane.
I've added some custom information from the database in global.php file.
What I have added:
$dona = $db->simple_select('donaciones', 'SUM(amount) AS amount', "amount - comision > 0");
$donaAmount = 0;
$donaTarget = 15;
$donaPercent = 0;
$donata = $db->fetch_array($dona);
$donaAmount = $donata['amount'];
$db->free_result($dona);
$donaPercent = $donaPercent != 0?round(($donaAmount*100)/$donaPercent):0;
$donaAmount = round($donaAmount,2);
if ($donaPercent > 100){
$donaPercent = 100;
}
Then I edited the header template. I've added:
<div style="display: inline; position: relative; top: -9px;">Objetivo: ${$donaTarget} USD - Cantidad: ${$donaAmount} - Porcentaje: ${$donaPercent}</div>
When I try to save the template it says:
A potential security issue was found in the template.
If I delete my custom vars, the template is saved as expected.
I've found some threads about the same error, but none of them could solve my specific problem.
Thanks in advane.