2001-02-17 08:37:32 +00:00
|
|
|
<?php
|
2005-04-09 12:26:45 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
* @version $Id$
|
|
|
|
* @copyright (c) 2005 phpBB Group
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
|
|
*
|
|
|
|
*/
|
2001-08-30 22:20:23 +00:00
|
|
|
|
2005-04-09 12:26:45 +00:00
|
|
|
/**
|
2006-05-05 17:56:33 +00:00
|
|
|
* @ignore
|
2005-04-09 12:26:45 +00:00
|
|
|
*/
|
2002-03-18 13:35:43 +00:00
|
|
|
define('IN_PHPBB', true);
|
2002-03-19 12:38:12 +00:00
|
|
|
$phpbb_root_path = './';
|
2003-09-07 13:46:51 +00:00
|
|
|
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
2006-06-06 20:53:46 +00:00
|
|
|
include($phpbb_root_path . 'common.' . $phpEx);
|
2005-10-02 18:47:06 +00:00
|
|
|
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
2001-02-17 08:37:32 +00:00
|
|
|
|
2001-04-15 14:14:56 +00:00
|
|
|
// Start session management
|
2005-10-02 18:47:06 +00:00
|
|
|
$user->session_begin();
|
2002-10-20 19:19:07 +00:00
|
|
|
$auth->acl($user->data);
|
2006-05-12 16:05:07 +00:00
|
|
|
$user->setup('viewforum');
|
2003-05-02 15:50:11 +00:00
|
|
|
|
2004-10-08 10:59:23 +00:00
|
|
|
display_forums('', $config['load_moderators']);
|
2003-11-05 18:49:01 +00:00
|
|
|
|
2002-10-01 21:41:57 +00:00
|
|
|
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
|
2006-06-06 20:53:46 +00:00
|
|
|
$total_posts = $config['num_posts'];
|
|
|
|
$total_topics = $config['num_topics'];
|
|
|
|
$total_users = $config['num_users'];
|
|
|
|
$newest_user = $config['newest_username'];
|
|
|
|
$newest_uid = $config['newest_user_id'];
|
2001-05-17 14:48:39 +00:00
|
|
|
|
2003-11-05 18:49:01 +00:00
|
|
|
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
|
|
|
|
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
|
|
|
|
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
|
2003-03-08 22:10:24 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
// Grab group details for legend display
|
2004-09-01 15:55:41 +00:00
|
|
|
$sql = 'SELECT group_id, group_name, group_colour, group_type
|
|
|
|
FROM ' . GROUPS_TABLE . '
|
2005-05-31 18:54:00 +00:00
|
|
|
WHERE group_legend = 1
|
2006-06-10 14:20:55 +00:00
|
|
|
AND group_type <> ' . GROUP_HIDDEN . '
|
|
|
|
ORDER BY group_name ASC';
|
2003-03-10 18:22:12 +00:00
|
|
|
$result = $db->sql_query($sql);
|
2003-03-08 22:10:24 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
$legend = '';
|
|
|
|
while ($row = $db->sql_fetchrow($result))
|
|
|
|
{
|
2006-06-06 20:53:46 +00:00
|
|
|
$legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
|
2003-03-10 17:48:08 +00:00
|
|
|
}
|
2003-05-20 23:57:08 +00:00
|
|
|
$db->sql_freeresult($result);
|
|
|
|
|
|
|
|
// Generate birthday list if required ...
|
|
|
|
$birthday_list = '';
|
|
|
|
if ($config['load_birthdays'])
|
|
|
|
{
|
2006-09-17 22:02:28 +00:00
|
|
|
$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600);
|
2004-09-01 15:55:41 +00:00
|
|
|
$sql = 'SELECT user_id, username, user_colour, user_birthday
|
|
|
|
FROM ' . USERS_TABLE . "
|
2006-06-06 20:53:46 +00:00
|
|
|
WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
|
2005-03-21 22:43:07 +00:00
|
|
|
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
2003-05-20 23:57:08 +00:00
|
|
|
$result = $db->sql_query($sql);
|
|
|
|
|
|
|
|
while ($row = $db->sql_fetchrow($result))
|
|
|
|
{
|
|
|
|
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';
|
2006-06-06 20:53:46 +00:00
|
|
|
$birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '">' . $row['username'] . '</a>';
|
2004-09-01 15:55:41 +00:00
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
if ($age = (int) substr($row['user_birthday'], -4))
|
2003-05-20 23:57:08 +00:00
|
|
|
{
|
|
|
|
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$db->sql_freeresult($result);
|
|
|
|
}
|
2003-03-08 22:10:24 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
// Assign index specific vars
|
2002-10-01 21:41:57 +00:00
|
|
|
$template->assign_vars(array(
|
2003-11-05 18:49:01 +00:00
|
|
|
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
|
|
|
|
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
|
|
|
|
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
|
2006-06-06 20:53:46 +00:00
|
|
|
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $newest_uid) . '">', $newest_user, '</a>'),
|
2004-09-01 15:55:41 +00:00
|
|
|
'LEGEND' => $legend,
|
|
|
|
'BIRTHDAY_LIST' => $birthday_list,
|
2002-10-20 19:19:07 +00:00
|
|
|
|
2006-09-14 14:57:29 +00:00
|
|
|
'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'),
|
|
|
|
'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
|
|
|
|
'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
|
2006-08-05 15:49:28 +00:00
|
|
|
'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
|
2002-10-01 21:41:57 +00:00
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
|
2004-09-01 15:55:41 +00:00
|
|
|
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
2003-03-20 02:28:30 +00:00
|
|
|
|
2006-06-06 20:53:46 +00:00
|
|
|
'U_MARK_FORUMS' => append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums'),
|
|
|
|
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
|
2002-10-01 21:41:57 +00:00
|
|
|
);
|
2001-07-13 16:14:37 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
// Output page
|
2003-05-03 23:58:45 +00:00
|
|
|
page_header($user->lang['INDEX']);
|
2003-05-02 15:50:11 +00:00
|
|
|
|
2002-07-14 14:45:26 +00:00
|
|
|
$template->set_filenames(array(
|
2003-05-02 15:50:11 +00:00
|
|
|
'body' => 'index_body.html')
|
|
|
|
);
|
|
|
|
|
2003-05-03 23:58:45 +00:00
|
|
|
page_footer();
|
2001-06-11 00:14:27 +00:00
|
|
|
|
2003-01-13 06:44:16 +00:00
|
|
|
?>
|