Mercurial > hg > vamp-website
comparison forum/Sources/Who.php @ 76:e3e11437ecea website
Add forum code
author | Chris Cannam |
---|---|
date | Sun, 07 Jul 2013 11:25:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
75:72f59aa7e503 | 76:e3e11437ecea |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * Simple Machines Forum (SMF) | |
5 * | |
6 * @package SMF | |
7 * @author Simple Machines http://www.simplemachines.org | |
8 * @copyright 2011 Simple Machines | |
9 * @license http://www.simplemachines.org/about/smf/license.php BSD | |
10 * | |
11 * @version 2.0.2 | |
12 */ | |
13 | |
14 if (!defined('SMF')) | |
15 die('Hacking attempt...'); | |
16 | |
17 /* This file is mainly concerned, or that is to say only concerned, with the | |
18 Who's Online list. It contains only the following functions: | |
19 | |
20 void Who() | |
21 - prepares the who's online data for the Who template. | |
22 - uses the Who template (main sub template.) and language file. | |
23 - requires the who_view permission. | |
24 - is enabled with the who_enabled setting. | |
25 - is accessed via ?action=who. | |
26 | |
27 array determineActions(array urls, string preferred_prefix = false) | |
28 - determine the actions of the members passed in urls. | |
29 - urls should be a single url (string) or an array of arrays, each | |
30 inner array being (serialized request data, id_member). | |
31 - returns an array of descriptions if you passed an array, otherwise | |
32 the string describing their current location. | |
33 | |
34 void Credits(bool in_admin) | |
35 - prepares credit and copyright information for the credits page or the admin page | |
36 - if parameter is true the it will not load the sub template nor the template file | |
37 | |
38 Adding actions to the Who's Online list: | |
39 --------------------------------------------------------------------------- | |
40 Adding actions to this list is actually relatively easy.... | |
41 - for actions anyone should be able to see, just add a string named | |
42 whoall_ACTION. (where ACTION is the action used in index.php.) | |
43 - for actions that have a subaction which should be represented | |
44 differently, use whoall_ACTION_SUBACTION. | |
45 - for actions that include a topic, and should be restricted, use | |
46 whotopic_ACTION. | |
47 - for actions that use a message, by msg or quote, use whopost_ACTION. | |
48 - for administrator-only actions, use whoadmin_ACTION. | |
49 - for actions that should be viewable only with certain permissions, | |
50 use whoallow_ACTION and add a list of possible permissions to the | |
51 $allowedActions array, using ACTION as the key. | |
52 */ | |
53 | |
54 // Who's online, and what are they doing? | |
55 function Who() | |
56 { | |
57 global $context, $scripturl, $user_info, $txt, $modSettings, $memberContext, $smcFunc; | |
58 | |
59 // Permissions, permissions, permissions. | |
60 isAllowedTo('who_view'); | |
61 | |
62 // You can't do anything if this is off. | |
63 if (empty($modSettings['who_enabled'])) | |
64 fatal_lang_error('who_off', false); | |
65 | |
66 // Load the 'Who' template. | |
67 loadTemplate('Who'); | |
68 loadLanguage('Who'); | |
69 | |
70 // Sort out... the column sorting. | |
71 $sort_methods = array( | |
72 'user' => 'mem.real_name', | |
73 'time' => 'lo.log_time' | |
74 ); | |
75 | |
76 $show_methods = array( | |
77 'members' => '(lo.id_member != 0)', | |
78 'guests' => '(lo.id_member = 0)', | |
79 'all' => '1=1', | |
80 ); | |
81 | |
82 // Store the sort methods and the show types for use in the template. | |
83 $context['sort_methods'] = array( | |
84 'user' => $txt['who_user'], | |
85 'time' => $txt['who_time'], | |
86 ); | |
87 $context['show_methods'] = array( | |
88 'all' => $txt['who_show_all'], | |
89 'members' => $txt['who_show_members_only'], | |
90 'guests' => $txt['who_show_guests_only'], | |
91 ); | |
92 | |
93 // Can they see spiders too? | |
94 if (!empty($modSettings['show_spider_online']) && ($modSettings['show_spider_online'] == 2 || allowedTo('admin_forum')) && !empty($modSettings['spider_name_cache'])) | |
95 { | |
96 $show_methods['spiders'] = '(lo.id_member = 0 AND lo.id_spider > 0)'; | |
97 $show_methods['guests'] = '(lo.id_member = 0 AND lo.id_spider = 0)'; | |
98 $context['show_methods']['spiders'] = $txt['who_show_spiders_only']; | |
99 } | |
100 elseif (empty($modSettings['show_spider_online']) && isset($_SESSION['who_online_filter']) && $_SESSION['who_online_filter'] == 'spiders') | |
101 unset($_SESSION['who_online_filter']); | |
102 | |
103 // Does the user prefer a different sort direction? | |
104 if (isset($_REQUEST['sort']) && isset($sort_methods[$_REQUEST['sort']])) | |
105 { | |
106 $context['sort_by'] = $_SESSION['who_online_sort_by'] = $_REQUEST['sort']; | |
107 $sort_method = $sort_methods[$_REQUEST['sort']]; | |
108 } | |
109 // Did we set a preferred sort order earlier in the session? | |
110 elseif (isset($_SESSION['who_online_sort_by'])) | |
111 { | |
112 $context['sort_by'] = $_SESSION['who_online_sort_by']; | |
113 $sort_method = $sort_methods[$_SESSION['who_online_sort_by']]; | |
114 } | |
115 // Default to last time online. | |
116 else | |
117 { | |
118 $context['sort_by'] = $_SESSION['who_online_sort_by'] = 'time'; | |
119 $sort_method = 'lo.log_time'; | |
120 } | |
121 | |
122 $context['sort_direction'] = isset($_REQUEST['asc']) || (isset($_REQUEST['sort_dir']) && $_REQUEST['sort_dir'] == 'asc') ? 'up' : 'down'; | |
123 | |
124 $conditions = array(); | |
125 if (!allowedTo('moderate_forum')) | |
126 $conditions[] = '(IFNULL(mem.show_online, 1) = 1)'; | |
127 | |
128 // Fallback to top filter? | |
129 if (isset($_REQUEST['submit_top']) && isset($_REQUEST['show_top'])) | |
130 $_REQUEST['show'] = $_REQUEST['show_top']; | |
131 // Does the user wish to apply a filter? | |
132 if (isset($_REQUEST['show']) && isset($show_methods[$_REQUEST['show']])) | |
133 { | |
134 $context['show_by'] = $_SESSION['who_online_filter'] = $_REQUEST['show']; | |
135 $conditions[] = $show_methods[$_REQUEST['show']]; | |
136 } | |
137 // Perhaps we saved a filter earlier in the session? | |
138 elseif (isset($_SESSION['who_online_filter'])) | |
139 { | |
140 $context['show_by'] = $_SESSION['who_online_filter']; | |
141 $conditions[] = $show_methods[$_SESSION['who_online_filter']]; | |
142 } | |
143 else | |
144 $context['show_by'] = $_SESSION['who_online_filter'] = 'all'; | |
145 | |
146 // Get the total amount of members online. | |
147 $request = $smcFunc['db_query']('', ' | |
148 SELECT COUNT(*) | |
149 FROM {db_prefix}log_online AS lo | |
150 LEFT JOIN {db_prefix}members AS mem ON (lo.id_member = mem.id_member)' . (!empty($conditions) ? ' | |
151 WHERE ' . implode(' AND ', $conditions) : ''), | |
152 array( | |
153 ) | |
154 ); | |
155 list ($totalMembers) = $smcFunc['db_fetch_row']($request); | |
156 $smcFunc['db_free_result']($request); | |
157 | |
158 // Prepare some page index variables. | |
159 $context['page_index'] = constructPageIndex($scripturl . '?action=who;sort=' . $context['sort_by'] . ($context['sort_direction'] == 'up' ? ';asc' : '') . ';show=' . $context['show_by'], $_REQUEST['start'], $totalMembers, $modSettings['defaultMaxMembers']); | |
160 $context['start'] = $_REQUEST['start']; | |
161 | |
162 // Look for people online, provided they don't mind if you see they are. | |
163 $request = $smcFunc['db_query']('', ' | |
164 SELECT | |
165 lo.log_time, lo.id_member, lo.url, INET_NTOA(lo.ip) AS ip, mem.real_name, | |
166 lo.session, mg.online_color, IFNULL(mem.show_online, 1) AS show_online, | |
167 lo.id_spider | |
168 FROM {db_prefix}log_online AS lo | |
169 LEFT JOIN {db_prefix}members AS mem ON (lo.id_member = mem.id_member) | |
170 LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:regular_member} THEN mem.id_post_group ELSE mem.id_group END)' . (!empty($conditions) ? ' | |
171 WHERE ' . implode(' AND ', $conditions) : '') . ' | |
172 ORDER BY {raw:sort_method} {raw:sort_direction} | |
173 LIMIT {int:offset}, {int:limit}', | |
174 array( | |
175 'regular_member' => 0, | |
176 'sort_method' => $sort_method, | |
177 'sort_direction' => $context['sort_direction'] == 'up' ? 'ASC' : 'DESC', | |
178 'offset' => $context['start'], | |
179 'limit' => $modSettings['defaultMaxMembers'], | |
180 ) | |
181 ); | |
182 $context['members'] = array(); | |
183 $member_ids = array(); | |
184 $url_data = array(); | |
185 while ($row = $smcFunc['db_fetch_assoc']($request)) | |
186 { | |
187 $actions = @unserialize($row['url']); | |
188 if ($actions === false) | |
189 continue; | |
190 | |
191 // Send the information to the template. | |
192 $context['members'][$row['session']] = array( | |
193 'id' => $row['id_member'], | |
194 'ip' => allowedTo('moderate_forum') ? $row['ip'] : '', | |
195 // It is *going* to be today or yesterday, so why keep that information in there? | |
196 'time' => strtr(timeformat($row['log_time']), array($txt['today'] => '', $txt['yesterday'] => '')), | |
197 'timestamp' => forum_time(true, $row['log_time']), | |
198 'query' => $actions, | |
199 'is_hidden' => $row['show_online'] == 0, | |
200 'id_spider' => $row['id_spider'], | |
201 'color' => empty($row['online_color']) ? '' : $row['online_color'] | |
202 ); | |
203 | |
204 $url_data[$row['session']] = array($row['url'], $row['id_member']); | |
205 $member_ids[] = $row['id_member']; | |
206 } | |
207 $smcFunc['db_free_result']($request); | |
208 | |
209 // Load the user data for these members. | |
210 loadMemberData($member_ids); | |
211 | |
212 // Load up the guest user. | |
213 $memberContext[0] = array( | |
214 'id' => 0, | |
215 'name' => $txt['guest_title'], | |
216 'group' => $txt['guest_title'], | |
217 'href' => '', | |
218 'link' => $txt['guest_title'], | |
219 'email' => $txt['guest_title'], | |
220 'is_guest' => true | |
221 ); | |
222 | |
223 // Are we showing spiders? | |
224 $spiderContext = array(); | |
225 if (!empty($modSettings['show_spider_online']) && ($modSettings['show_spider_online'] == 2 || allowedTo('admin_forum')) && !empty($modSettings['spider_name_cache'])) | |
226 { | |
227 foreach (unserialize($modSettings['spider_name_cache']) as $id => $name) | |
228 $spiderContext[$id] = array( | |
229 'id' => 0, | |
230 'name' => $name, | |
231 'group' => $txt['spiders'], | |
232 'href' => '', | |
233 'link' => $name, | |
234 'email' => $name, | |
235 'is_guest' => true | |
236 ); | |
237 } | |
238 | |
239 $url_data = determineActions($url_data); | |
240 | |
241 // Setup the linktree and page title (do it down here because the language files are now loaded..) | |
242 $context['page_title'] = $txt['who_title']; | |
243 $context['linktree'][] = array( | |
244 'url' => $scripturl . '?action=who', | |
245 'name' => $txt['who_title'] | |
246 ); | |
247 | |
248 // Put it in the context variables. | |
249 foreach ($context['members'] as $i => $member) | |
250 { | |
251 if ($member['id'] != 0) | |
252 $member['id'] = loadMemberContext($member['id']) ? $member['id'] : 0; | |
253 | |
254 // Keep the IP that came from the database. | |
255 $memberContext[$member['id']]['ip'] = $member['ip']; | |
256 $context['members'][$i]['action'] = isset($url_data[$i]) ? $url_data[$i] : $txt['who_hidden']; | |
257 if ($member['id'] == 0 && isset($spiderContext[$member['id_spider']])) | |
258 $context['members'][$i] += $spiderContext[$member['id_spider']]; | |
259 else | |
260 $context['members'][$i] += $memberContext[$member['id']]; | |
261 } | |
262 | |
263 // Some people can't send personal messages... | |
264 $context['can_send_pm'] = allowedTo('pm_send'); | |
265 | |
266 // any profile fields disabled? | |
267 $context['disabled_fields'] = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array(); | |
268 | |
269 } | |
270 | |
271 function determineActions($urls, $preferred_prefix = false) | |
272 { | |
273 global $txt, $user_info, $modSettings, $smcFunc, $context; | |
274 | |
275 if (!allowedTo('who_view')) | |
276 return array(); | |
277 loadLanguage('Who'); | |
278 | |
279 // Actions that require a specific permission level. | |
280 $allowedActions = array( | |
281 'admin' => array('moderate_forum', 'manage_membergroups', 'manage_bans', 'admin_forum', 'manage_permissions', 'send_mail', 'manage_attachments', 'manage_smileys', 'manage_boards', 'edit_news'), | |
282 'ban' => array('manage_bans'), | |
283 'boardrecount' => array('admin_forum'), | |
284 'calendar' => array('calendar_view'), | |
285 'editnews' => array('edit_news'), | |
286 'mailing' => array('send_mail'), | |
287 'maintain' => array('admin_forum'), | |
288 'manageattachments' => array('manage_attachments'), | |
289 'manageboards' => array('manage_boards'), | |
290 'mlist' => array('view_mlist'), | |
291 'moderate' => array('access_mod_center', 'moderate_forum', 'manage_membergroups'), | |
292 'optimizetables' => array('admin_forum'), | |
293 'repairboards' => array('admin_forum'), | |
294 'search' => array('search_posts'), | |
295 'search2' => array('search_posts'), | |
296 'setcensor' => array('moderate_forum'), | |
297 'setreserve' => array('moderate_forum'), | |
298 'stats' => array('view_stats'), | |
299 'viewErrorLog' => array('admin_forum'), | |
300 'viewmembers' => array('moderate_forum'), | |
301 ); | |
302 | |
303 if (!is_array($urls)) | |
304 $url_list = array(array($urls, $user_info['id'])); | |
305 else | |
306 $url_list = $urls; | |
307 | |
308 // These are done to later query these in large chunks. (instead of one by one.) | |
309 $topic_ids = array(); | |
310 $profile_ids = array(); | |
311 $board_ids = array(); | |
312 | |
313 $data = array(); | |
314 foreach ($url_list as $k => $url) | |
315 { | |
316 // Get the request parameters.. | |
317 $actions = @unserialize($url[0]); | |
318 if ($actions === false) | |
319 continue; | |
320 | |
321 // If it's the admin or moderation center, and there is an area set, use that instead. | |
322 if (isset($actions['action']) && ($actions['action'] == 'admin' || $actions['action'] == 'moderate') && isset($actions['area'])) | |
323 $actions['action'] = $actions['area']; | |
324 | |
325 // Check if there was no action or the action is display. | |
326 if (!isset($actions['action']) || $actions['action'] == 'display') | |
327 { | |
328 // It's a topic! Must be! | |
329 if (isset($actions['topic'])) | |
330 { | |
331 // Assume they can't view it, and queue it up for later. | |
332 $data[$k] = $txt['who_hidden']; | |
333 $topic_ids[(int) $actions['topic']][$k] = $txt['who_topic']; | |
334 } | |
335 // It's a board! | |
336 elseif (isset($actions['board'])) | |
337 { | |
338 // Hide first, show later. | |
339 $data[$k] = $txt['who_hidden']; | |
340 $board_ids[$actions['board']][$k] = $txt['who_board']; | |
341 } | |
342 // It's the board index!! It must be! | |
343 else | |
344 $data[$k] = $txt['who_index']; | |
345 } | |
346 // Probably an error or some goon? | |
347 elseif ($actions['action'] == '') | |
348 $data[$k] = $txt['who_index']; | |
349 // Some other normal action...? | |
350 else | |
351 { | |
352 // Viewing/editing a profile. | |
353 if ($actions['action'] == 'profile') | |
354 { | |
355 // Whose? Their own? | |
356 if (empty($actions['u'])) | |
357 $actions['u'] = $url[1]; | |
358 | |
359 $data[$k] = $txt['who_hidden']; | |
360 $profile_ids[(int) $actions['u']][$k] = $actions['action'] == 'profile' ? $txt['who_viewprofile'] : $txt['who_profile']; | |
361 } | |
362 elseif (($actions['action'] == 'post' || $actions['action'] == 'post2') && empty($actions['topic']) && isset($actions['board'])) | |
363 { | |
364 $data[$k] = $txt['who_hidden']; | |
365 $board_ids[(int) $actions['board']][$k] = isset($actions['poll']) ? $txt['who_poll'] : $txt['who_post']; | |
366 } | |
367 // A subaction anyone can view... if the language string is there, show it. | |
368 elseif (isset($actions['sa']) && isset($txt['whoall_' . $actions['action'] . '_' . $actions['sa']])) | |
369 $data[$k] = $preferred_prefix && isset($txt[$preferred_prefix . $actions['action'] . '_' . $actions['sa']]) ? $txt[$preferred_prefix . $actions['action'] . '_' . $actions['sa']] : $txt['whoall_' . $actions['action'] . '_' . $actions['sa']]; | |
370 // An action any old fellow can look at. (if ['whoall_' . $action] exists, we know everyone can see it.) | |
371 elseif (isset($txt['whoall_' . $actions['action']])) | |
372 $data[$k] = $preferred_prefix && isset($txt[$preferred_prefix . $actions['action']]) ? $txt[$preferred_prefix . $actions['action']] : $txt['whoall_' . $actions['action']]; | |
373 // Viewable if and only if they can see the board... | |
374 elseif (isset($txt['whotopic_' . $actions['action']])) | |
375 { | |
376 // Find out what topic they are accessing. | |
377 $topic = (int) (isset($actions['topic']) ? $actions['topic'] : (isset($actions['from']) ? $actions['from'] : 0)); | |
378 | |
379 $data[$k] = $txt['who_hidden']; | |
380 $topic_ids[$topic][$k] = $txt['whotopic_' . $actions['action']]; | |
381 } | |
382 elseif (isset($txt['whopost_' . $actions['action']])) | |
383 { | |
384 // Find out what message they are accessing. | |
385 $msgid = (int) (isset($actions['msg']) ? $actions['msg'] : (isset($actions['quote']) ? $actions['quote'] : 0)); | |
386 | |
387 $result = $smcFunc['db_query']('', ' | |
388 SELECT m.id_topic, m.subject | |
389 FROM {db_prefix}messages AS m | |
390 INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board) | |
391 INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic' . ($modSettings['postmod_active'] ? ' AND t.approved = {int:is_approved}' : '') . ') | |
392 WHERE m.id_msg = {int:id_msg} | |
393 AND {query_see_board}' . ($modSettings['postmod_active'] ? ' | |
394 AND m.approved = {int:is_approved}' : '') . ' | |
395 LIMIT 1', | |
396 array( | |
397 'is_approved' => 1, | |
398 'id_msg' => $msgid, | |
399 ) | |
400 ); | |
401 list ($id_topic, $subject) = $smcFunc['db_fetch_row']($result); | |
402 $data[$k] = sprintf($txt['whopost_' . $actions['action']], $id_topic, $subject); | |
403 $smcFunc['db_free_result']($result); | |
404 | |
405 if (empty($id_topic)) | |
406 $data[$k] = $txt['who_hidden']; | |
407 } | |
408 // Viewable only by administrators.. (if it starts with whoadmin, it's admin only!) | |
409 elseif (allowedTo('moderate_forum') && isset($txt['whoadmin_' . $actions['action']])) | |
410 $data[$k] = $txt['whoadmin_' . $actions['action']]; | |
411 // Viewable by permission level. | |
412 elseif (isset($allowedActions[$actions['action']])) | |
413 { | |
414 if (allowedTo($allowedActions[$actions['action']])) | |
415 $data[$k] = $txt['whoallow_' . $actions['action']]; | |
416 else | |
417 $data[$k] = $txt['who_hidden']; | |
418 } | |
419 // Unlisted or unknown action. | |
420 else | |
421 $data[$k] = $txt['who_unknown']; | |
422 } | |
423 | |
424 // Maybe the action is integrated into another system? | |
425 if (count($integrate_actions = call_integration_hook('integrate_whos_online', array($actions))) > 0) | |
426 { | |
427 foreach ($integrate_actions as $integrate_action) | |
428 { | |
429 if (!empty($integrate_action)) | |
430 { | |
431 $data[$k] = $integrate_action; | |
432 break; | |
433 } | |
434 } | |
435 } | |
436 } | |
437 | |
438 // Load topic names. | |
439 if (!empty($topic_ids)) | |
440 { | |
441 $result = $smcFunc['db_query']('', ' | |
442 SELECT t.id_topic, m.subject | |
443 FROM {db_prefix}topics AS t | |
444 INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board) | |
445 INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg) | |
446 WHERE {query_see_board} | |
447 AND t.id_topic IN ({array_int:topic_list})' . ($modSettings['postmod_active'] ? ' | |
448 AND t.approved = {int:is_approved}' : '') . ' | |
449 LIMIT {int:limit}', | |
450 array( | |
451 'topic_list' => array_keys($topic_ids), | |
452 'is_approved' => 1, | |
453 'limit' => count($topic_ids), | |
454 ) | |
455 ); | |
456 while ($row = $smcFunc['db_fetch_assoc']($result)) | |
457 { | |
458 // Show the topic's subject for each of the actions. | |
459 foreach ($topic_ids[$row['id_topic']] as $k => $session_text) | |
460 $data[$k] = sprintf($session_text, $row['id_topic'], censorText($row['subject'])); | |
461 } | |
462 $smcFunc['db_free_result']($result); | |
463 } | |
464 | |
465 // Load board names. | |
466 if (!empty($board_ids)) | |
467 { | |
468 $result = $smcFunc['db_query']('', ' | |
469 SELECT b.id_board, b.name | |
470 FROM {db_prefix}boards AS b | |
471 WHERE {query_see_board} | |
472 AND b.id_board IN ({array_int:board_list}) | |
473 LIMIT ' . count($board_ids), | |
474 array( | |
475 'board_list' => array_keys($board_ids), | |
476 ) | |
477 ); | |
478 while ($row = $smcFunc['db_fetch_assoc']($result)) | |
479 { | |
480 // Put the board name into the string for each member... | |
481 foreach ($board_ids[$row['id_board']] as $k => $session_text) | |
482 $data[$k] = sprintf($session_text, $row['id_board'], $row['name']); | |
483 } | |
484 $smcFunc['db_free_result']($result); | |
485 } | |
486 | |
487 // Load member names for the profile. | |
488 if (!empty($profile_ids) && (allowedTo('profile_view_any') || allowedTo('profile_view_own'))) | |
489 { | |
490 $result = $smcFunc['db_query']('', ' | |
491 SELECT id_member, real_name | |
492 FROM {db_prefix}members | |
493 WHERE id_member IN ({array_int:member_list}) | |
494 LIMIT ' . count($profile_ids), | |
495 array( | |
496 'member_list' => array_keys($profile_ids), | |
497 ) | |
498 ); | |
499 while ($row = $smcFunc['db_fetch_assoc']($result)) | |
500 { | |
501 // If they aren't allowed to view this person's profile, skip it. | |
502 if (!allowedTo('profile_view_any') && $user_info['id'] != $row['id_member']) | |
503 continue; | |
504 | |
505 // Set their action on each - session/text to sprintf. | |
506 foreach ($profile_ids[$row['id_member']] as $k => $session_text) | |
507 $data[$k] = sprintf($session_text, $row['id_member'], $row['real_name']); | |
508 } | |
509 $smcFunc['db_free_result']($result); | |
510 } | |
511 | |
512 if (!is_array($urls)) | |
513 return isset($data[0]) ? $data[0] : false; | |
514 else | |
515 return $data; | |
516 } | |
517 | |
518 function Credits($in_admin = false) | |
519 { | |
520 global $context, $modSettings, $forum_copyright, $forum_version, $boardurl, $txt, $user_info; | |
521 | |
522 // Don't blink. Don't even blink. Blink and you're dead. | |
523 loadLanguage('Who'); | |
524 | |
525 $context['credits'] = array( | |
526 array( | |
527 'pretext' => $txt['credits_intro'], | |
528 'title' => $txt['credits_team'], | |
529 'groups' => array( | |
530 array( | |
531 'title' => $txt['credits_groups_ps'], | |
532 'members' => array( | |
533 'Michael "Oldiesmann" Eshom', | |
534 'Amacythe', | |
535 'Jeremy "SleePy" Darwood', | |
536 'Justin "metallica48423" O\'Leary', | |
537 ), | |
538 ), | |
539 array( | |
540 'title' => $txt['credits_groups_dev'], | |
541 'members' => array( | |
542 'Norv', | |
543 'Aaron van Geffen', | |
544 'Antechinus', | |
545 'Bjoern "Bloc" Kristiansen', | |
546 'Hendrik Jan "Compuart" Visser', | |
547 'Juan "JayBachatero" Hernandez', | |
548 'Karl "RegularExpression" Benson', | |
549 $user_info['is_admin'] ? 'Matt "Grudge" Wolf': 'Grudge', | |
550 'Michael "Thantos" Miller', | |
551 'Selman "[SiNaN]" Eser', | |
552 'Theodore "Orstio" Hildebrandt', | |
553 'Thorsten "TE" Eurich', | |
554 'winrules', | |
555 ), | |
556 ), | |
557 array( | |
558 'title' => $txt['credits_groups_support'], | |
559 'members' => array( | |
560 'JimM', | |
561 'Adish "(F.L.A.M.E.R)" Patel', | |
562 'Aleksi "Lex" Kilpinen', | |
563 'Ben Scott', | |
564 'Bigguy', | |
565 'CapadY', | |
566 'Chas Large', | |
567 'Duncan85', | |
568 'Eliana Tamerin', | |
569 'Fiery', | |
570 'gbsothere', | |
571 'Harro', | |
572 'Huw', | |
573 'Jan-Olof "Owdy" Eriksson', | |
574 'Jeremy "jerm" Strike', | |
575 'Jessica "Miss All Sunday" Gonzales', | |
576 'K@', | |
577 'Kevin "greyknight17" Hou', | |
578 'KGIII', | |
579 'Kill Em All', | |
580 'Mattitude', | |
581 'Mashby', | |
582 'Mick G.', | |
583 'Michele "Illori" Davis', | |
584 'MrPhil', | |
585 'Nick "Fizzy" Dyer', | |
586 'Nick "Ha²"', | |
587 'Paul_Pauline', | |
588 'Piro "Sarge" Dhima', | |
589 'Rumbaar', | |
590 'Pitti', | |
591 'RedOne', | |
592 'S-Ace', | |
593 'Wade "sησω" Poulsen', | |
594 'xenovanis', | |
595 ), | |
596 ), | |
597 array( | |
598 'title' => $txt['credits_groups_customize'], | |
599 'members' => array( | |
600 'Brad "IchBin™" Grow', | |
601 'ディン1031', | |
602 'Brannon "B" Hall', | |
603 'Bryan "Runic" Deakin', | |
604 'Bulakbol', | |
605 'Colin "Shadow82x" Blaber', | |
606 'Daniel15', | |
607 'Eren Yasarkurt', | |
608 'Gary M. Gadsdon', | |
609 'Jason "JBlaze" Clemons', | |
610 'Jerry', | |
611 'Jonathan "vbgamer45" Valentin', | |
612 'Kays', | |
613 'Killer Possum', | |
614 'Kirby', | |
615 'Matt "SlammedDime" Zuba', | |
616 'Matthew "Labradoodle-360" Kerle', | |
617 'Nibogo', | |
618 'Niko', | |
619 'Peter "Arantor" Spicer', | |
620 'snork13', | |
621 'Spuds', | |
622 'Steven "Fustrate" Hoffman', | |
623 'Joey "Tyrsson" Smith', | |
624 ), | |
625 ), | |
626 array( | |
627 'title' => $txt['credits_groups_docs'], | |
628 'members' => array( | |
629 'Joshua "groundup" Dickerson', | |
630 'AngellinaBelle', | |
631 'Daniel Diehl', | |
632 'Dannii Willis', | |
633 'emanuele', | |
634 'Graeme Spence', | |
635 'Jack "akabugeyes" Thorsen', | |
636 'Jade Elizabeth Trainor', | |
637 'Peter Duggan', | |
638 ), | |
639 ), | |
640 array( | |
641 'title' => $txt['credits_groups_marketing'], | |
642 'members' => array( | |
643 'Kindred', | |
644 'Marcus "cσσкιє мσηѕтєя" Forsberg', | |
645 'Ralph "[n3rve]" Otowo', | |
646 'rickC', | |
647 'Tony Reid', | |
648 ), | |
649 ), | |
650 array( | |
651 'title' => $txt['credits_groups_internationalizers'], | |
652 'members' => array( | |
653 'Relyana', | |
654 'Akyhne', | |
655 'GravuTrad', | |
656 ), | |
657 ), | |
658 array( | |
659 'title' => $txt['credits_groups_servers'], | |
660 'members' => array( | |
661 'Derek Schwab', | |
662 'Liroy "CoreISP" van Hoewijk', | |
663 ), | |
664 ), | |
665 ), | |
666 ), | |
667 ); | |
668 | |
669 // Give the translators some credit for their hard work. | |
670 if (!empty($txt['translation_credits'])) | |
671 $context['credits'][] = array( | |
672 'title' => $txt['credits_groups_translation'], | |
673 'groups' => array( | |
674 array( | |
675 'title' => $txt['credits_groups_translation'], | |
676 'members' => $txt['translation_credits'], | |
677 ), | |
678 ), | |
679 ); | |
680 | |
681 $context['credits'][] = array( | |
682 'title' => $txt['credits_special'], | |
683 'posttext' => $txt['credits_anyone'], | |
684 'groups' => array( | |
685 array( | |
686 'title' => $txt['credits_groups_consultants'], | |
687 'members' => array( | |
688 'Brett Flannigan', | |
689 'Mark Rose', | |
690 'René-Gilles "Nao 尚" Deberdt', | |
691 ), | |
692 ), | |
693 array( | |
694 'title' => $txt['credits_groups_beta'], | |
695 'members' => array( | |
696 $txt['credits_beta_message'], | |
697 ), | |
698 ), | |
699 array( | |
700 'title' => $txt['credits_groups_translators'], | |
701 'members' => array( | |
702 $txt['credits_translators_message'], | |
703 ), | |
704 ), | |
705 array( | |
706 'title' => $txt['credits_groups_founder'], | |
707 'members' => array( | |
708 'Unknown W. "[Unknown]" Brackets', | |
709 ), | |
710 ), | |
711 array( | |
712 'title' => $txt['credits_groups_orignal_pm'], | |
713 'members' => array( | |
714 'Jeff Lewis', | |
715 'Joseph Fung', | |
716 'David Recordon', | |
717 ), | |
718 ), | |
719 ), | |
720 ); | |
721 | |
722 $context['copyrights'] = array( | |
723 'smf' => sprintf($forum_copyright, $forum_version), | |
724 | |
725 /* Modification Authors: You may add a copyright statement to this array for your mods. | |
726 Copyright statements should be in the form of a value only without a array key. I.E.: | |
727 'Some Mod by Thantos © 2010', | |
728 $txt['some_mod_copyright'], | |
729 */ | |
730 'mods' => array( | |
731 ), | |
732 ); | |
733 | |
734 if (!$in_admin) | |
735 { | |
736 loadTemplate('Who'); | |
737 $context['sub_template'] = 'credits'; | |
738 $context['robot_no_index'] = true; | |
739 $context['page_title'] = $txt['credits']; | |
740 } | |
741 } | |
742 | |
743 ?> |