Click here to download this example
In the following example we will create a destination page for Vancouver
Create a new file and save it as vancouver.php in the root directory were you install the travel site
paste the following into the file
<?php
require('../config.inc.php');
require('../smarty/Smarty.class.php');
require ($inc_path."/common.php");
$template = "vancouver.html";
$smarty->display($template);
?>
now create a new file called vancouver.html and save it into the templates directory.
if you want to have it in a subdirectory change the following line in the vancouver.php file your created
from
$template = "vancouver.html";
to
$template = "mydirectory/vancouver.html";
You now have a page that you can load by pointing your browser to http://www.yoursite.com/vancouver.php
Now we will add some featured hotels
Open the Vancouver.php file and paste the below lines after the last require line
$Hotels[] = hotelsearch("Vancouver","BC","CA");
if ($Hotels != false){
$smarty->assign('Locations', $Hotels);
}
Now open the template
And paste the following
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr class="hotelheader" bgcolor="#CCCCCC">
<td width="20" height="20" > </td>
<td height="20" align="left"><b>
<!--{$Locations[id].Hotels[hotelid].name|truncate:40}-->
</b></td>
<td align="right" valign="middle" class="sum_text">
<!--{if $Locations[id].Hotels[hotelid].lorate}-->
from:
<!--{assign var="currency" value=$Locations[id].Hotels[hotelid].currency}-->
<!--{$currencysymb[$currency]}-->
<!--{$Locations[id].Hotels[hotelid].lorate}-->
<!--{$Locations[id].Hotels[hotelid].currency}-->
<!--{/if}-->
</td>
<td width="20" height="20" align="right"> </td>
</tr>
</table>
</td></tr>
<tr class="hoteldetail">
<td colspan="4"> <table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td colspan="2" width="40%" class="hoteldetail" valign="top" align="left">
<!--{if $Locations[id].Hotels[hotelid].areaname}-->
Area -
<!--{$Locations[id].Hotels[hotelid].areaname}-->
<!--{/if}-->
<!--{if $Locations[id].Hotels[hotelid].subareaname}-->
:
<!--{$Locations[id].Hotels[hotelid].subareaname}-->
<!--{/if}-->
<!--{if $Locations[id].Hotels[hotelid].areaname OR $Locations[id].Hotels[hotelid].subAreaname}-->
<br />
<!--{/if}-->
<!--{$Locations[id].Hotels[hotelid].streetaddress1}-->
<br />
<!--{$Locations[id].Hotels[hotelid].city}-->,
<!--{state_name StateCode=$Locations[id].Hotels[hotelid].statecode assign="state_name"}-->
<!--{$Locations[id].Hotels[hotelid].countrycode}-->
<!--{$Locations[id].Hotels[hotelid].postalcode}-->
</td>
<td>
<!--{if $Locations[id].Hotels[hotelid].link_overview}-->
<a class="hotellinks" href="<!--{$Locations[id].Hotels[hotelid].link_overview}-->">Details</a> |
<!--{/if}-->
<!--{if $Locations[id].Hotels[hotelid].link_video == "Y"}-->
<a class="hotellinks" href="<!--{$Locations[id].Hotels[hotelid].link_video}-->">Video |
<!--{/if}-->
<!--{if $Locations[id].Hotels[hotelid].link_map}-->
<a class="hotellinks" href="<!--{$Locations[id].Hotels[hotelid].link_map}-->">Map</a>
<!--{/if}-->
</td>
<td align="right" valign="top">
<!--{if $Locations[id].Hotels[hotelid].starsource == A}-->
<!--{include file='caribbean/stars_a.html'}-->
<!---->
<!--{include file='caribbean/stars_t.html'}-->
<!--{/if}-->
<td> </td>
<td align="right">
<a class="hotellinks" href="<!--{$Locations[id].Hotels[hotelid].link_prices}-->"><span class="smalltext"><strong>Check Prices</strong></span></a>
</td>
</tr>
</table>