1.  
  2. // ayarlar
  3. $CFG['forum_id'] = 2; // haber alınacak forum id
  4. $CFG['max_topics'] = 10; // haber sayısı
  5.  
  6. //
  7. // Recent topic (only show normal topic)
  8. //
  9. $sql = 'SELECT topic_title, forum_id, topic_id
  10. FROM ' . TOPICS_TABLE . '
  11. WHERE forum_id = $CFG['forum_id'];
  12. AND topic_status <> 2
  13. AND topic_approved = 1
  14. AND topic_type = 0
  15. ' . $sql_where . '
  16. ORDER BY topic_time DESC';
  17.  
  18. $result = $db->sql_query_limit($sql, $CFG['max_topics']);
  19.  
  20. while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
  21. {
  22. // auto auth
  23. if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
  24. {
  25. $template->assign_block_vars('latest_topics', array(
  26. 'TITLE' => character_limit($row['topic_title'], $CFG['recent_title_limit']),
  27. 'FULL_TITLE' => censor_text($row['topic_title']),
  28. 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'])
  29. )
  30. );
  31. }
  32. }
  33. $db->sql_freeresult($result);
  34.