I was wanting to add some advertisement to one single page but it shows up in every page.
I created the file test.tpl and added this code in the layout.tpl
Code: Select all
<div>{include file="test.tpl"}</div>Moderator: General Moderators
Code: Select all
<div>{include file="test.tpl"}</div>Code: Select all
$smarty->assing('showAdd',1);
Code: Select all
{if $showAdd eq 1}
{include file="yourAdd.tpl"}
{/if}
Code: Select all
# {if $showAdd eq "index.html"}
# {include file="yourAdd.tpl"}
# {/if}Code: Select all
<table cellpadding="0" cellspacing="0" border="0" width="578" align="center">
<tr>
<td>
<table cellpadding="0" cellspacing="4" border="0">
{foreach name=row_cat_center from=$Rows_Cat_Center item="cat_center_row"}
{if $smarty.foreach.row_cat_center.iteration%2==1 || $smarty.foreach.row_cat_center.first}
<tr> {/if}
<td valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="287" class="box1">
<tr>
<td background="{$T_Images_Tpl}bar2.gif" height="31" width="287" class="boxtit"><a class="category" title="{$cat_center_row.category_title|escape|trim}" href="{$cat_center_row.sef_url}">{$cat_center_row.category_title|escape|trim} ({$cat_center_row.games_count|default:0}) </a></td>
</tr>
<tr>
<td> {if $cat_center_row.games|@count >= 1 }
{foreach name=row_game from=$cat_center_row.games item="game_row"}
<table width="282" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="60" valign="top"><a href="{$game_row.sef_url|trim}" title="{$game_row.game_title|escape|trim}"><img border="0" src="{$Site_Url}libs/phpthumb/phpThumb.php?src={$Game_Images}{$game_row.game_image}&w=60&h=60&iar=1" height="60" width="60" alt="{$game_row.game_title|escape|trim}" /></a></td>
<td valign="top"><span class="boxtext"><a href="{$game_row.sef_url|trim}" title="{$game_row.game_title|escape|trim}">{$game_row.game_title|escape|trim}</a></span><br>
<div class="boxdesc">{$game_row.game_description|escape|trim}</div></td>
</tr>
</table>
{/foreach}
{else}
<table width="282" border="0" cellspacing="5" cellpadding="0">
<tr>
<td><span class="boxdesc">No games in this category.</span></td>
</tr>
</table>
{/if} </td>
</tr>
</table>
</td>
{if $smarty.foreach.row_cat_center.iteration%2==0 || $smarty.foreach.row_cat_center.last} </tr>
{/if}
{/foreach}
</table>
</td>
</tr>
</table>Code: Select all
{if $smarty.server.PHP_SELF eq 'internalpage.html'}
{include file="yourAdd.tpl"}
{/if}
Code: Select all
<?php
// You might need to check this server var to make sure it is the right index
// You can do a var_dump($_SERVER) to see which it should be
$smarty->assign('pagename', strtolower(basename($_SERVER['SCRIPT_NAME'])));
?>