1 | <?php |
||
9 | class CInterface |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * Sample function to integrate with a phpbb installation and lend some |
||
14 | * information on the authorized user. |
||
15 | * |
||
16 | * @param string $path is the install path of PHPBB. |
||
17 | * @return array with details of user. |
||
18 | */ |
||
19 | public function getSessionDetails($path) |
||
50 | |||
51 | |||
52 | |||
53 | /** |
||
54 | * Get latest topics. |
||
55 | * |
||
56 | * @param int $max items to return. |
||
57 | * @return array |
||
58 | */ |
||
59 | /* |
||
60 | public function LatestTopics($max=3) { |
||
61 | global $auth, $db; |
||
62 | |||
63 | // Create arrays |
||
64 | $topics = array(); |
||
65 | |||
66 | // Get forums that current user has read rights to. |
||
67 | $forums = array_unique(array_keys($auth->acl_getf('f_read', true))); |
||
68 | |||
69 | // Get active topics. |
||
70 | $sql="SELECT * |
||
71 | FROM " . TOPICS_TABLE . " |
||
72 | WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . " |
||
73 | ORDER BY topic_last_post_time DESC"; |
||
74 | $result = $db->sql_query_limit($sql, $max); |
||
75 | while ($r = $db->sql_fetchrow($result)) { |
||
76 | $topics[] = $r; |
||
77 | } |
||
78 | $db->sql_freeresult($result); |
||
79 | |||
80 | $items = array(); |
||
81 | foreach($topics as $t) { |
||
82 | // Get folder img, topic status/type related information |
||
83 | //$topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']); |
||
84 | //$unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) |
||
85 | ? true |
||
86 | : false; |
||
87 | //topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type); |
||
88 | // href = $phpbb_root_path |
||
89 | . 'viewtopic.php?f=' |
||
90 | . $t['forum_id'] |
||
91 | . '&t=' |
||
92 | . $t['topic_id'] |
||
93 | . '&p=' |
||
94 | . $t['topic_last_post_id'] |
||
95 | . '#p' |
||
96 | . $t['topic_last_post_id']; |
||
97 | $item['forum_id'] = $t['forum_id']; |
||
98 | $item['topic_id'] = $t['topic_id']; |
||
99 | $item['topic_last_post_id'] = $t['topic_last_post_id']; |
||
100 | $item['topic_title'] = $t['topic_title']; |
||
101 | $items[] = $item; |
||
102 | } |
||
103 | |||
104 | return($items); |
||
105 | } |
||
106 | */ |
||
107 | } |
||
108 |