SimplePortal Son Konular - Son Mesajlar - en çok ileti gönderenler Modifikasyonu

0 Üye ve 3 Ziyaretçi konuyu incelemekte.

Çevrimdışı D®agon

  • Ezberletmez Öğretir
  • *******
  • Join Date: Mar 2008
  • Yer: Ankara
  • 11650
  • +524/-0
  • Cinsiyet: Bay
    • Arif Hocam
SimplePortal  ile son iletiler, son konular, en çok ileti gönderenler ve Takvimi bir arada gösterebilirsiniz.

[img width=300 height=200]http://www.uyanangenclik.com/gallery/1_04_05_15_1_15_05.jpeg[/img]

Aşağıdaki kodlar ile PHP Blok oluşturabilirsiniz.

[code]$blocks = array(
array(
'label' => 'Son İletiler',
'type' => 'sp_recent',
'parameters' => array('display' => 1),
),
array(
'label' => 'Son Konular',
'type' => 'sp_recent',
'parameters' => array('type' => 1, 'display' => 1),
),
array(
'label' => 'En Çok İleti Gönderenler',
'type' => 'sp_topPoster',
'parameters' => array(),
),
array(
'label' => 'Takvim',
'type' => 'sp_calendar',
'parameters' => array(),
),
);

global $txt;

$button_list = array();
foreach ($blocks as $id => $block)
{
$txt['sp_bib_label_' . $id] = $block['label'];

$button_list[] = array(
'text' => 'sp_bib_label_' . $id,
'image' => '',
'lang' => true,
'url' => '#sp_bib_' . $id . '" id="sp_bib_button_' . $id . '" onclick="sp_bib_change(' . $id . '); return false;',
);
}

$button_list[0]['active'] = true;

echo '
<div style="overflow: auto;">
', template_button_strip($button_list), '
</div>';

foreach ($blocks as $id => $block)
{
echo '
<div id="sp_bib_', $id, '"', $id != 0 ? ' style="display: none;"' : '', '>';

$block['type']($block['parameters'], 0);

echo '
</div>';
}

echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function sp_bib_change(id)
{
for (var i = 0; i < ', count($blocks), '; i++)
{
document.getElementById(\'sp_bib_\' + i).style.display = i == id ? \'\' : \'none\';
document.getElementById(\'sp_bib_button_\' + i).className = \'button_strip_\' + i + (i == id ? \' active\' : \'\');
}
}
// ]]></script>';[/code]