Gönderen Konu: SimplePortal Rastgele Konular Modifikasyonu  (Okunma sayısı 2312 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı D®agon

  • Ezberletmez Öğretir
  • Administrator
  • Süper Mega üye
  • *******
  • İleti: 11650
  • +524/-0
  • Cinsiyet: Bay
    • Arif Hocam
SimplePortal Rastgele Konular Modifikasyonu
« : 17 Ekim 2014, 15:43:59 »
[img width=500 height=299]http://www.uyanangenclik.com/gallery/1_17_10_14_3_43_34.jpeg[/img]

Öncelikle yeni blok oluşturun.

PHP İçerik olarak aşağıdaki kodları uygulayın.

[code]global $smcFunc, $scripturl;

$boards = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41);

$request = $smcFunc['db_query']('', '
SELECT t.id_topic, m.subject
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
WHERE t.id_board IN ({array_int:boards})
ORDER BY RAND()
        LIMIT 15',

array(
'boards' => $boards,
)
);
$topics = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$topics[$row['id_topic']] = $row['subject'];
$smcFunc['db_free_result']($request);

echo '<ul>';
foreach ($topics as $id_topic => $subject)
echo '<li><a href="', $scripturl, '?topic=', $id_topic, '.0">', $subject, '</a></li>';
echo '</ul>';[/code]

 

Voiser