Kodu Sadece Tek Sayfada Kullanmak
-
arkadaşlar aşağıda ki kodu index.template.php dosyasına koydum smfde yan menü için yan menü bütün sayfalarda çıkıyor. ben sadece ana sayfada çıkmasını istiyorum..
function template_rp_inner_above()
{
echo '<br style="line-height: 0.1em;" />
<table style="width: 100%;" cellpadding="0" cellspacing="0">
<tr>
<td style="vertical-align: top;">';
}
function template_rp_inner_below()
{
global $boarddir;
echo '
</td>
<td style="vertical-align: top;">
<div class="cat_bar">
<h3 class="catbg">Son İletiler</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">';
require_once($boarddir . '/SSI.php');
$items = ssi_recentPosts(10, null, null, 'array');
$items[count($items) - 1]['is_last'] = true;
foreach ($items as $item)
echo '
<a href="', $item['href'], '">', $item['subject'], '</a> <span class="smalltext">', !empty($txt['by']) ? $txt['by'] : 'Gönderen:', ' ', $item['poster']['link'], $item['new'] ? '' : ' <a href="' . $scripturl . '?topic=' . $item['topic'] . '.msg' . $item['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . (!empty($txt['new']) ? $txt['new'] : 'Yeni') . '" border="0" /></a>', '<br />[', $item['time'], ']</span><br />', empty($item['is_last']) ? '<hr />' : '';
echo '
</div>
<span class="botslice"><span></span></span>
</div>
</td>
</tr>
</table>';
}
?>birde source/subs.php doyasına kod ekledim:
$context['meta_keywords'] = !empty($modSettings['meta_keywords']) ? $smcFunc['htmlspecialchars']($modSettings['meta_keywords']) : '';
$temp_layers = $context['template_layers'];
$context['template_layers'] = array();
foreach ($temp_layers as $layer)
{
$context['template_layers'][] = $layer;
if ($layer == 'body')
$context['template_layers'][] = 'rp_inner';
} -
if koy başlarına sadece index.php açıkken gösterilsinler
-
index.template.php de değil, burda hepsinde çıkar.. kullandıgın temanın klasorundeki BoardIndex.template.php ye koyarsan sadece ana sayfada çıkar.
-
tşkler kodda ufak defek değişikliklerle halletim.
