Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Problems with php in sidebox

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-03-2009, 10:52 AM
  pdstudio's Avatar 
pdstudio pdstudio is offline
 

Member
  
Join Date: Dec 2009
Location: Hungary / Sopron
Posts: 28
 

Exclamation 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?
__________________
X-Cart 4.4.4
http://matricamagnes.hu/
Reply With Quote
  #2  
Old 12-05-2009, 07:39 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default 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.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 12-05-2009, 08:59 AM
  pdstudio's Avatar 
pdstudio pdstudio is offline
 

Member
  
Join Date: Dec 2009
Location: Hungary / Sopron
Posts: 28
 

Default Re: Problems with php in sidebox

The .php and .tpl are in the same directory in /modules.
I will paste here the code soon.
__________________
X-Cart 4.4.4
http://matricamagnes.hu/
Reply With Quote
  #4  
Old 12-05-2009, 09:13 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Problems with php in sidebox

I understand that, but:
Code:
{include_php file='idezetek.php'}
wont look in /modules for your php file.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #5  
Old 12-06-2009, 01:06 AM
  pdstudio's Avatar 
pdstudio pdstudio is offline
 

Member
  
Join Date: Dec 2009
Location: Hungary / Sopron
Posts: 28
 

Default 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 .
__________________
X-Cart 4.4.4
http://matricamagnes.hu/
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:00 AM.

   

 
X-Cart forums © 2001-2020