View Single Post
  #2  
Old 08-13-2010, 11:29 AM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: Creating pages with PHP instead of just HTML

Hello, you need to do several things for this to work.

In the x-cart root you need to add your php files that contain the logic. No display code should be in there.
In the php file, you should also have some lines of code similar to this:

Code:
<?php # # $Id: fileName.php,v 2.0 2010/04/04 07:34:02 pdma Exp $ # #Make sure the server knows its legit require "./auth.php"; #### PUT YOUR CODE BETWEEN THIS LINE ####### #### AND THIS LINE ##### #Make the $main smarty variable to #customThing #This is needed for home_main.tpl $smarty->assign("main","customThing"); #Output all variables possible to home.tpl func_display("customer/home.tpl",$smarty); ?>


Then in skin1/customer/home_main.tpl you will need to add something like this (A good spot is after the {elseif $main eq "subscriptions"} code)
Code:
{elseif $main eq "customThing"} {include file="customer/yourDisplayFile.tpl"}

Then you need to make that file and put your design in it. Remember, the design is using smarty and smarty variables. If you need to use {php} tags in the tpl, then you did something wrong.

The design will be where the rest of the actual content is. If you need to not show stuff on that page that is, for example, shown on the welcome page then you need to do a little more modification.
You may also change the func_display("customer/home.tpl",$smarty); to a different .tpl file with an entirely new design.
__________________
- Shane Munroe
Reply With Quote