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

Includes Within An Include Problem

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-28-2005, 12:40 PM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default Includes Within An Include Problem

Has anyone ever ran into a problem when using the Smarty method for including a file {include file="../../includes/footer.inc"} when there are more PHP includes within the file that is being included? Because Smarty can't parse regular PHP, when I view a page's HTML I see the unparsed PHP code like <?php include("/directory/file2.php"); ?>. Just wondering if anyone had any way to get around this. I can't change all of my includes to smarty style because the code being included is used on many non-xcart pages.
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #2  
Old 02-28-2005, 01:35 PM
 
hooter hooter is offline
 

X-Adept
  
Join Date: Dec 2004
Posts: 519
 

Default

frankdux,

This might help:
http://smarty.php.net/manual/en/language.function.include.php.php
__________________
Blog for X-Cart | Ebay Auction Manager
Reply With Quote
  #3  
Old 03-28-2005, 09:53 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default

I read the Smarty manual page for includes, but it doesn't really offer any means for getting around the problem I am having. I am still getting unparsed PHP code when I have an include within an include. Someone may suggest to not have an include within an include, but I need to, due to the structure of my static/non-Xcart pages. Has anyone ever come up with a work around for this?
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #4  
Old 03-28-2005, 12:47 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

http://smarty.php.net/manual/en/language.function.php.php
Reply With Quote
  #5  
Old 03-28-2005, 01:28 PM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default

I thought that might work because if I can parse regular PHP using code {php}{/php} tags, then I should be able to parse any additional PHP that comes along as a result of the first PHP code. For some reason though, I am getting the following message:

Fatal error: Cannot redeclare my_function() (previously declared in /directory/www/file.php:4) in /directory/www/file.php on line 4 .

It seems to think I am redeclaring one of my own functions but I don't see how that can be. Any ideas?
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
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 02:17 PM.

   

 
X-Cart forums © 2001-2020