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)
-   -   Problems with php in sidebox (https://forum.x-cart.com/showthread.php?t=51123)

pdstudio 12-03-2009 10:52 AM

Problems with php in sidebox
 
I want to make a new side box on the right with php content, but when I put the php code in the tpl its not working, I was looking for a solution and in the smarty manual I found that with the include_php it must be okay but no. I get always smarty errors.

I put in the home.tpl above the news:
Quote:

{include file="modules/idezetek.tpl"}


and in my idezetek.tpl:
Quote:

{capture name=menu}
<div id="guestwrote">
{include_php file='idezetek.php'}
<div>
{/capture}
{include file="customer/menu_dialog.tpl" title="RСlunk МrtАtok" content=$smarty.capture.menu}


in the idezetek.php:
Quote:

<?php
$idezetek ="idezetek.txt";
$myText = file("$idezetek");
$myTexts = rand(0, sizeof($myText)-1);
$myRandomText=$myText[$myTexts];
echo $myRandomText;
?>


the idezetek.tpl and the idezetek.php is in my skindirectory/modules.

Any idea why its not working?

geckoday 12-05-2009 07:39 AM

Re: Problems with php in sidebox
 
It looks like your include_php is missing the path - should be modules/idezetek.php

If you are still having problems please post the exact error message you are getting so we can have a better idea of what the problem is.

pdstudio 12-05-2009 08:59 AM

Re: Problems with php in sidebox
 
The .php and .tpl are in the same directory in /modules.
I will paste here the code soon.

geckoday 12-05-2009 09:13 AM

Re: Problems with php in sidebox
 
I understand that, but:
Code:

{include_php file='idezetek.php'}
wont look in /modules for your php file.

pdstudio 12-06-2009 01:06 AM

Re: Problems with php in sidebox
 
Okay the problem is away. :)
I used the skin1/modules path and all is okay, without errors and problems, only the main layout was a bit changed when I inserted the box, but its fixed also. Thank you for enlightening my mind :).


All times are GMT -8. The time now is 12:10 AM.

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