Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 412 lines (368 sloc) 12.625 kb
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
1 <?php
2 /**
3 *
4 * @package Icy Phoenix
5 * @version $Id$
6 * @copyright (c) 2008 Icy Phoenix
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 *
9 */
10
11 /**
12 *
13 * @Icy Phoenix is based on phpBB
14 * @copyright (c) 2008 phpBB Group
15 *
16 */
17
06ce0f8 Luca Libralato Brand new version...
authored
18 define('IN_ICYPHOENIX', true);
19 if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
20 if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
21 include(IP_ROOT_PATH . 'common.' . PHP_EXT);
31548c4 Luca Libralato Added the possibility to disable Mobile Style detection and fixed some b...
authored
22 include_once(IP_ROOT_PATH . 'includes/functions_online.' . PHP_EXT);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
23 // Mighty Gorgon - HTTP AGENTS - BEGIN
dbcd6a4 Luca Libralato Added a function to generate topics pagination and integrated where need...
authored
24 include_once(IP_ROOT_PATH . 'includes/functions_mg_http.' . PHP_EXT);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
25 // Mighty Gorgon - HTTP AGENTS - END
26
27 // Start session management
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
28 $user->session_begin();
d164727 Luca Libralato First implementation of the new permissions system in CMS.
authored
29 $auth->acl($user->data);
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
30 $user->setup();
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
31 // End session management
32
33 // Viewonline pagination... to be coded...
34 /*
35 $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
36 $start = ($start < 0) ? 0 : $start;
37
38 $show_all = isset($_GET['show_all']) ? true : false;
39 */
40
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
41 $cms_page['page_id'] = 'viewonline';
42 $cms_page['page_nav'] = (!empty($cms_config_layouts[$cms_page['page_id']]['page_nav']) ? true : false);
43 $cms_page['global_blocks'] = (!empty($cms_config_layouts[$cms_page['page_id']]['global_blocks']) ? true : false);
44 $cms_auth_level = (isset($cms_config_layouts[$cms_page['page_id']]['view']) ? $cms_config_layouts[$cms_page['page_id']]['view'] : AUTH_ALL);
45 check_page_auth($cms_page['page_id'], $cms_auth_level);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
46
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
47 make_jumpbox(CMS_PAGE_VIEWFORUM);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
48
49 $template->assign_vars(array(
50 // Start add - Fully integrated shoutbox MOD
06ce0f8 Luca Libralato Brand new version...
authored
51 'U_SHOUTBOX' => append_sid('shoutbox.' . PHP_EXT),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
52 'L_SHOUTBOX' => $lang['Shoutbox'],
06ce0f8 Luca Libralato Brand new version...
authored
53 'U_SHOUTBOX_MAX' => append_sid('shoutbox_max.' . PHP_EXT),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
54 // End add - Fully integrated shoutbox MOD
55
56 'L_WHOSONLINE' => $lang['Who_is_Online'],
57 // Start Advanced IP Tools Pack MOD
58 'L_WHOIS' => $lang['Whois'],
59 'L_IP' => $lang['IP'],
60 'L_BROWSER' => $lang['Browser'],
61 // End Advanced IP Tools Pack MOD
62 'L_LAST_SEEN' => $lang['Last_Seen'],
63 'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
64 'L_USERNAME' => $lang['Username'],
65 'L_FORUM_LOCATION' => $lang['Forum_Location'],
66 'L_LAST_UPDATE' => $lang['Last_updated']
67 )
68 );
69
70 // Forum info
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
71 $forum_types = array(FORUM_CAT, FORUM_POST, FORUM_LINK);
72 $forums_array = get_forums_ids($forum_types, true, false);
73 foreach ($forums_array as $forum)
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
74 {
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
75 $forum_data[$forum['forum_id']] = $forum['forum_name'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
76 }
77
78 // Get auth data
79 $is_auth_ary = array();
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
80 $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $user->data);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
81
82 // Viewonline pagination... to be coded...
83 /*
84 if ($show_all)
85 {
86 $sql_limit = '';
87 }
88 else
89 {
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
90 $sql_limit = 'LIMIT ' . $start . ', ' . $config['topics_per_page'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
91 }
92 */
93
94 // Get user list
31548c4 Luca Libralato Added the possibility to disable Mobile Style detection and fixed some b...
authored
95 $online_users = get_online_users(false, true, '');
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
96
97 $guest_users = 0;
98 $registered_users = 0;
99 $hidden_users = 0;
100
101 $reg_counter = 0;
102 $guest_counter = 0;
103 $prev_user = 0;
31548c4 Luca Libralato Added the possibility to disable Mobile Style detection and fixed some b...
authored
104 $session_ip_array = array();
105 foreach ($online_users as $row)
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
106 {
107 $view_online = false;
108 $is_auth_view = false;
109 $forum_id = false;
110 $topic_id = false;
111 // Mighty Gorgon - HTTP AGENTS - BEGIN
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
112 $user_os = get_user_os($row['session_browser']);
113 $user_browser = get_user_browser($row['session_browser']);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
114 // Mighty Gorgon - HTTP AGENTS - END
115
116 if ($row['session_logged_in'])
117 {
118 $user_id = $row['user_id'];
119
120 if ($user_id != $prev_user)
121 {
841b23a Luca Libralato New beta candidate... with many many changes and new features respect to...
authored
122 $username = colorize_username($row['user_id'], $row['username'], $row['user_color'], $row['user_active']);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
123
124 if (!$row['user_allow_viewonline'])
125 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
126 $view_online = (($user->data['user_level'] == ADMIN) || ($user->data['user_id'] == $user_id)) ? true : false;
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
127 $hidden_users++;
128 $username = '<i>' . $username . '</i>';
129 }
130 else
131 {
132 $view_online = true;
133 $registered_users++;
134 }
135
136 $which_counter = 'reg_counter';
137 $which_row = 'reg_user_row';
138 $prev_user = $user_id;
139 }
140 }
141 else
142 {
31548c4 Luca Libralato Added the possibility to disable Mobile Style detection and fixed some b...
authored
143 // Skip multiple sessions for one user
144 if (!empty($row['session_ip']) && !in_array($row['session_ip'], $session_ip_array))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
145 {
31548c4 Luca Libralato Added the possibility to disable Mobile Style detection and fixed some b...
authored
146 $session_ip_array[] = $row['session_ip'];
147
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
148 // MG BOTS Parsing - BEGIN
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
149 $bot_name_tmp = bots_parse($row['session_ip'], $config['bots_color'], $row['session_browser']);
150 if ($bot_name_tmp['name'] != false)
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
151 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
152 $username = $bot_name_tmp['name'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
153 }
154 else
155 {
156 $username = '<b>' . $lang['Guest'] . '</b>';
157 }
158 // MG BOTS Parsing - END
159 $view_online = true;
160 $guest_users++;
161 $which_counter = 'guest_counter';
162 $which_row = 'guest_user_row';
163 }
164 }
165
166 if ($view_online)
167 {
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
168 if ((strpos($row['session_page'], CMS_PAGE_VIEWFORUM) !== false) || (strpos($row['session_page'], CMS_PAGE_VIEWTOPIC) !== false))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
169 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
170 if (!empty($row['session_forum_id']))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
171 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
172 $forum_id = $row['session_forum_id'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
173 $is_auth_view = ($is_auth_ary[$forum_id]['auth_read'] != false) ? true : false;
174 }
175
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
176 if (!empty($row['session_topic_id']))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
177 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
178 $topic_id = $row['session_topic_id'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
179 }
180 }
181
182 if (!empty($topic_id))
183 {
184 // Topic info
185 $sql_tt = "SELECT topic_title, forum_id FROM " . TOPICS_TABLE . " WHERE topic_id='" . $topic_id . "'";
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
186 $result_tt = $db->sql_query($sql_tt);
187 $topic_title = $db->sql_fetchrow($result_tt);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
188 if ($is_auth_ary[$topic_title['forum_id']]['auth_read'] != false)
189 {
190 $location['lang'] = $forum_data[$topic_title['forum_id']] . '&nbsp;&raquo;&nbsp;' . $topic_title['topic_title'];
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
191 $location['url'] = CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $topic_title['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $topic_id;
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
192 }
193 else
194 {
195 $location['lang'] = $lang['Forum_index'];
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
196 $location['url'] = CMS_PAGE_FORUM;
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
197 }
198 }
199 else
200 {
201 if (!empty($forum_id) && $is_auth_view)
202 //if (!empty($forum_id))
203 {
204 $location['lang'] = $forum_data[$forum_id];
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
205 $location['url'] = CMS_PAGE_VIEWFORUM . '?' . POST_FORUM_URL . '=' . $forum_id;
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
206 }
207 else
208 {
209 $location = get_online_page($row['session_page']);
210 }
211 }
212
06ce0f8 Luca Libralato Brand new version...
authored
213 $location['url'] = append_sid(IP_ROOT_PATH . $location['url']);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
214
215 $row_class = ($$which_counter % 2) ? $theme['td_class1'] : $theme['td_class2'];
216
217 // Start Advanced IP Tools Pack MOD
218 $mode = htmlspecialchars($_GET['mode']);
219
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
220 $test_ip = request_get_var('ip', '');
221 if ((($user->data['user_level'] == ADMIN) || ($user->data['user_level'] == MOD)) && ($mode == 'lookup') && isset($_GET['ip']) && ($row['session_ip'] == $test_ip))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
222 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
223 $ip = gethostbyaddr($row['session_ip']);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
224 }
225 else
226 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
227 $ip = $row['session_ip'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
228 $mode = 'ip';
229 }
230 // End Advanced IP Tools Pack MOD
231 $template->assign_block_vars("$which_row", array(
232 // Start Advanced IP Tools Pack MOD
233 'IP' => htmlspecialchars($ip),
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
234 'USER_AGENT' => htmlspecialchars($row['session_browser']) . '<br />' . htmlspecialchars($row['session_page']),
235 'U_HOSTNAME_LOOKUP' => ($mode != 'lookup') ? append_sid(CMS_PAGE_VIEWONLINE . '?mode=lookup&amp;ip=' . htmlspecialchars(urlencode($row['session_ip']))) : append_sid(CMS_PAGE_VIEWONLINE . '?mode=ip&amp;ip=' . htmlspecialchars(urlencode($row['session_ip']))),
236 'U_WHOIS' => 'http://whois.sc/' . htmlspecialchars(urlencode($row['session_ip'])),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
237 // End Advanced IP Tools Pack MOD
238
239 'ROW_CLASS' => $row_class,
240 'USERNAME' => $username,
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
241 'LASTUPDATE' => create_date_ip($config['default_dateformat'], $row['session_time'], $config['board_timezone']),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
242 'FORUM_LOCATION' => $location['lang'],
243 // Mighty Gorgon - HTTP AGENTS - BEGIN
244 'USER_OS_IMG' => $user_os['img'],
245 'USER_BROWSER_IMG' => $user_browser['img'],
246 // Mighty Gorgon - HTTP AGENTS - END
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
247 'U_USER_PROFILE' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $user_id),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
248 'U_FORUM_LOCATION' => $location['url']
249 )
250 );
251 // Start Advanced IP Tools Pack MOD
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
252 $ip_display_auth = ip_display_auth($user->data, false);
20b89a5 Luca Libralato Some fixes and enhancements:
authored
253 if (!empty($ip_display_auth))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
254 {
20b89a5 Luca Libralato Some fixes and enhancements:
authored
255 $template->assign_block_vars($which_row . '.switch_display_ips', array());
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
256 }
257 // End Advanced IP Tools Pack MOD
258
259 $$which_counter++;
260 }
261 }
262
263 if($registered_users == 0)
264 {
265 $l_r_user_s = $lang['Reg_users_zero_online'];
266 }
267 elseif($registered_users == 1)
268 {
269 $l_r_user_s = $lang['Reg_user_online'];
270 }
271 else
272 {
273 $l_r_user_s = $lang['Reg_users_online'];
274 }
275
276 if($hidden_users == 0)
277 {
278 $l_h_user_s = $lang['Hidden_users_zero_online'];
279 }
280 elseif($hidden_users == 1)
281 {
282 $l_h_user_s = $lang['Hidden_user_online'];
283 }
284 else
285 {
286 $l_h_user_s = $lang['Hidden_users_online'];
287 }
288
289 if($guest_users == 0)
290 {
291 $l_g_user_s = $lang['Guest_users_zero_online'];
292 }
293 elseif($guest_users == 1)
294 {
295 $l_g_user_s = $lang['Guest_user_online'];
296 }
297 else
298 {
299 $l_g_user_s = $lang['Guest_users_online'];
300 }
301
302 $template->assign_vars(array(
303 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users),
304 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_users)
305 )
306 );
307
308 if ($registered_users + $hidden_users == 0)
309 {
310 $template->assign_vars(array(
311 'L_NO_REGISTERED_USERS_BROWSING' => $lang['No_users_browsing']
312 )
313 );
314 }
315
316 if ($guest_users == 0)
317 {
318 $template->assign_vars(array(
319 'L_NO_GUESTS_BROWSING' => $lang['No_users_browsing']
320 )
321 );
322 }
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
323 if ($config['online_shoutbox'] == 1)
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
324 {
9dea0d4 Luca Libralato New Icy Phoenix structure.
authored
325 $template->assign_vars(array('S_SHOUTBOX' => true));
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
326 }
327
328 // Recent Topics - BEGIN
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
329 if ($config['online_last_msgs'] == 1)
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
330 {
331 $template->assign_block_vars('switch_show_recent', array());
332
333 $except_forums = build_exclusion_forums_list();
334
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
335 if(!empty($config['last_msgs_x']))
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
336 {
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
337 $except_forums .= ',' . $config['last_msgs_x'];
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
338 }
339
340 $except_forums = str_replace(' ', '', $except_forums);
341
841b23a Luca Libralato New beta candidate... with many many changes and new features respect to...
authored
342 $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, f.forum_name
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
343 FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . FORUMS_TABLE . " AS f
344 WHERE t.forum_id NOT IN (" . $except_forums . ")
345 AND t.topic_status <> 2
346 AND p.post_id = t.topic_last_post_id
347 AND p.poster_id = u.user_id
348 AND f.forum_id = t.forum_id
349 ORDER BY p.post_id DESC
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
350 LIMIT " . intval($config['last_msgs_n']);
351 $result = $db->sql_query($sql);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
352 $number_recent_topics = $db->sql_numrows($result);
353 $recent_topic_row = array();
354 while($row = $db->sql_fetchrow($result))
355 {
356 $recent_topic_row[] = $row;
357 }
358 for($i = 0; $i < $number_recent_topics; $i++)
359 {
360 $template->assign_block_vars('switch_show_recent.recent_topic_row', array(
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
361 'U_FORUM' => append_sid(CMS_PAGE_VIEWFORUM . '?' . POST_FORUM_URL . '=' . $recent_topic_row[$i]['forum_id']),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
362 'L_FORUM' => $recent_topic_row[$i]['forum_name'],
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
363 'U_TITLE' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#p' .$recent_topic_row[$i]['post_id'],
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
364 'L_TITLE' => $recent_topic_row[$i]['topic_title'],
841b23a Luca Libralato New beta candidate... with many many changes and new features respect to...
authored
365 'U_POSTER' => colorize_username($recent_topic_row[$i]['user_id'], $recent_topic_row[$i]['username'], $recent_topic_row[$i]['user_color'], $recent_topic_row[$i]['user_active']),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
366 'S_POSTER' => $recent_topic_row[$i]['username'],
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
367 'S_POSTTIME' => create_date_ip($config['default_dateformat'], $recent_topic_row[$i]['post_time'], $config['board_timezone'])
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
368 )
369 );
370 }
371
372 // Last Seen - BEGIN
5c8be12 Luca Libralato Fixed some bugs hunted by Andrea75
authored
373 $sql = "SELECT username, user_id, user_active, user_color, user_lastvisit, user_level, user_allow_viewonline
841b23a Luca Libralato New beta candidate... with many many changes and new features respect to...
authored
374 FROM " . USERS_TABLE . "
5c8be12 Luca Libralato Fixed some bugs hunted by Andrea75
authored
375 WHERE user_id <> " . ANONYMOUS . "
376 ORDER BY user_lastvisit DESC
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
377 LIMIT " . intval($config['last_msgs_n']);
378 $result = $db->sql_query($sql);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
379 $number_last_seen = $db->sql_numrows($result);
380 $last_seen_row = array();
381 while($row = $db->sql_fetchrow($result)) { $last_seen_row[] = $row; }
382 for($i = 0; $i < $number_last_seen; $i++)
383 {
841b23a Luca Libralato New beta candidate... with many many changes and new features respect to...
authored
384 $username = colorize_username($last_seen_row[$i]['user_id'], $last_seen_row[$i]['username'], $last_seen_row[$i]['user_color'], $last_seen_row[$i]['user_active']);
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
385 $username_text = $last_seen_row[$i]['username'];
386 if($last_seen_row[$i]['user_allow_viewonline'] != 1)
387 {
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
388 if($user->data['user_level'] == ADMIN)
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
389 {
390 $username = '<i>' . $username . '</i>';
391 }
392 else
393 {
394 $username = '<i>' . $lang['Hidde_last_logon'] . '</i>';
395 }
396 }
397
398 $template->assign_block_vars('switch_show_recent.last_seen_row', array(
09f38bc Luca Libralato Another milestone almost achieved for new Icy Phoenix version: user/sess...
authored
399 'U_LSEEN_LINK' => ($last_seen_row[$i]['user_allow_viewonline']) ? $username : (($user->data[user_level] == ADMIN) ? '<i>' . $username . '</i>' : $username),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
400 'L_LSEEN_USERNAME' => $username_text,
5c8be12 Luca Libralato Fixed some bugs hunted by Andrea75
authored
401 'L_LSEEN_TIME' => create_date_ip($config['default_dateformat'], $last_seen_row[$i]['user_lastvisit'], $config['board_timezone']),
402 //'L_LSEEN_TIME' => gmdate("d.m.Y - H:i", $last_seen_row[$i]['user_lastvisit']),
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
403 )
404 );
405 }
406 // Last Seen - END
407 }
408 // Recent Topics - END
409
2d81429 Luca Libralato New Icy Phoenix version based on some new core functions.php
authored
410 full_page_generation('viewonline_body.tpl', $lang['Who_is_Online'], '', '');
d07f25e Luca Libralato git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46c49...
authored
411
412 ?>
Something went wrong with that request. Please try again.