Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('IN_PHPBB', true);
- $phpbb_root_path = './forum/'; // Path to phpbb folder
- $phpEx = substr(strrchr(__FILE__, '.'), 1);
- include($phpbb_root_path . 'common.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- // Start session management
- $user->session_begin();
- $auth->acl($user->data);
- // Grab user preferences
- $user->setup();
- /*** phpBB3 - Last Active Topics System ***/
- //Show last x topics
- define('TOPICS_LIMIT',10);
- // Create arrays
- $topics = array();
- // Get forums that current user has read rights to.
- $forums = '2';
- // Get active topics.
- $sql="SELECT *
- FROM " . TOPICS_TABLE . "
- WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
- ORDER BY topic_last_post_time DESC";
- $result = $db->sql_query_limit($sql,TOPICS_LIMIT);
- while ($r = $db->sql_fetchrow($result)):
- $topics[] = $r;
- endwhile;
- $db->sql_freeresult($result);
- ?>
- <div id="recent_topics">
- <table class="recent-topic-table">
- <tbody><tr>
- <td class="recent-topic-table-header" colspan="5" align="center" valign="middle">Annoucement</td>
- </tr>
- <?php
- foreach ($topics as $t):
- // Get folder img, topic status/type related information
- $topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']);
- $unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) ? true : false;
- $folder_img = $folder_alt = $topic_type = '';
- topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type);
- // output the link
- ?>
- <tr>
- <td align="center">
- <img style="vertical-align: text-bottom" src="<?php echo $user->img($folder_img, $folder_alt, false, '', 'src');?>" title="<?php echo $user->lang[$folder_alt];?>" alt="<?php echo $user->lang[$folder_alt];?>" />
- </td>
- <td>
- <a href="<?php echo $phpbb_root_path . 'viewtopic.php?f=' . $t['forum_id'] . '&t=' . $t['topic_id'] . '&p=' . $t['topic_last_post_id'] . '#p' . $t['topic_last_post_id'];?>">
- <?php echo html_entity_decode($t['topic_title']);?>
- </a>
- </td>
- <td align="right">
- <p class="topicdetails"><?php echo html_entity_decode($t['topic_last_post_time']);?></p>
- </td>
- </tr>
- <?php
- endforeach;
- ?>
- </tbody></table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement