X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   php code, direcly into template? (https://forum.x-cart.com/showthread.php?t=5903)

Owl 01-07-2004 03:10 PM

php code, direcly into template?
 
How should i do if i wanted some php code direcly into my template

Code:

<?php
        $loadavg_array = explode(" ", exec("cat /proc/loadavg"));
        $loadavg = $loadavg_array[2];
        print("Server Load: " . $loadavg . "%");
?>


i want that under the copyright on all my pages, and also other debug code...
but when i try and input as it is now in copyright.tpl it dun't work as i want it to =)

leon 01-07-2004 03:26 PM

Create another php file called myscript.php for example, then insert into the TPL file where you want to see it the following:

{include_php file="myscript.php"}

That worked for me for a news system, a random image (not related to xcart) and a random quote system. :wink:

shan 01-07-2004 03:29 PM

http://smarty.php.net/manual/en/language.function.php.php

Owl 01-07-2004 03:33 PM

ah ok, thx...

Owl 01-07-2004 09:08 PM

http://smarty.php.net/manual/en/variable.php.handling.php

That was a much better url :)
now it works...
all i had to do was change <?php and ?> into {php} and {/php}
very easy =)


All times are GMT -8. The time now is 06:35 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.