2001-02-17 08:37:32 +00:00
|
|
|
<?php
|
2001-04-18 06:30:10 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* index.php
|
|
|
|
* -------------------
|
|
|
|
* begin : Saturday, Feb 13, 2001
|
|
|
|
* copyright : (C) 2001 The phpBB Group
|
|
|
|
* email : support@phpbb.com
|
|
|
|
*
|
2001-02-23 18:13:35 +00:00
|
|
|
* $Id$
|
2001-04-18 06:30:10 +00:00
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2001-08-30 22:20:23 +00:00
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2002-03-18 13:35:43 +00:00
|
|
|
define('IN_PHPBB', true);
|
2002-03-19 12:38:12 +00:00
|
|
|
$phpbb_root_path = './';
|
2001-07-13 16:14:37 +00:00
|
|
|
include($phpbb_root_path . 'extension.inc');
|
|
|
|
include($phpbb_root_path . 'common.'.$phpEx);
|
2001-02-17 08:37:32 +00:00
|
|
|
|
2002-10-04 13:09:10 +00:00
|
|
|
// Get posted/get info
|
2003-01-20 05:12:38 +00:00
|
|
|
$mark_read = (isset($_REQUEST['mark'])) ? $_REQUEST['mark'] : '';
|
2002-08-15 15:45:22 +00:00
|
|
|
|
2001-04-15 14:14:56 +00:00
|
|
|
// Start session management
|
2002-10-20 19:19:07 +00:00
|
|
|
$user->start();
|
|
|
|
$user->setup();
|
|
|
|
$auth->acl($user->data);
|
2002-08-13 16:34:17 +00:00
|
|
|
// End session management
|
2001-08-07 23:01:03 +00:00
|
|
|
|
2002-08-13 16:40:34 +00:00
|
|
|
// Handle marking posts
|
2002-10-01 21:41:57 +00:00
|
|
|
if ($mark_read == 'forums')
|
2001-09-28 23:46:04 +00:00
|
|
|
{
|
2002-10-01 21:41:57 +00:00
|
|
|
if ($userdata['user_id'])
|
2001-09-28 23:46:04 +00:00
|
|
|
{
|
2002-11-27 13:24:46 +00:00
|
|
|
markread('markall');
|
2001-12-05 00:20:56 +00:00
|
|
|
}
|
2001-09-28 23:46:04 +00:00
|
|
|
|
2001-12-05 00:20:56 +00:00
|
|
|
$template->assign_vars(array(
|
2002-07-14 14:45:26 +00:00
|
|
|
'META' => '<meta http-equiv="refresh" content="3;url=' . "index.$phpEx$SID" . '">')
|
2001-12-05 00:20:56 +00:00
|
|
|
);
|
2001-09-28 23:46:04 +00:00
|
|
|
|
2003-03-08 22:10:24 +00:00
|
|
|
$message = $user->lang['Forums_marked_read'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a> ');
|
2003-01-20 05:12:38 +00:00
|
|
|
trigger_error($message);
|
2001-09-28 23:46:04 +00:00
|
|
|
}
|
2002-01-12 17:00:32 +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
|
2002-11-13 21:48:06 +00:00
|
|
|
$total_posts = $config['num_posts'];
|
|
|
|
$total_topics = $config['num_topics'];
|
2002-10-30 00:57:27 +00:00
|
|
|
$total_users = $config['num_users'];
|
|
|
|
$newest_user = $config['newest_username'];
|
|
|
|
$newest_uid = $config['newest_user_id'];
|
2001-05-17 14:48:39 +00:00
|
|
|
|
2002-10-01 21:41:57 +00:00
|
|
|
if ($total_users == 0)
|
2002-08-13 16:40:34 +00:00
|
|
|
{
|
2002-10-20 19:19:07 +00:00
|
|
|
$l_total_user_s = $user->lang['Registered_users_zero_total'];
|
2002-08-13 16:40:34 +00:00
|
|
|
}
|
2002-10-01 21:41:57 +00:00
|
|
|
else if ($total_users == 1)
|
2002-08-13 16:40:34 +00:00
|
|
|
{
|
2002-10-20 19:19:07 +00:00
|
|
|
$l_total_user_s = $user->lang['Registered_user_total'];
|
2002-08-13 16:40:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-20 19:19:07 +00:00
|
|
|
$l_total_user_s = $user->lang['Registered_users_total'];
|
2002-08-13 16:40:34 +00:00
|
|
|
}
|
2001-12-24 16:34:27 +00:00
|
|
|
|
2002-11-07 03:20:33 +00:00
|
|
|
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
2003-01-20 05:12:38 +00:00
|
|
|
display_forums();
|
2002-10-03 02:43:41 +00:00
|
|
|
|
2002-10-01 21:41:57 +00:00
|
|
|
if ($total_posts == 0)
|
|
|
|
{
|
2002-10-20 19:19:07 +00:00
|
|
|
$l_total_post_s = $user->lang['Posted_articles_zero_total'];
|
2002-10-01 21:41:57 +00:00
|
|
|
}
|
|
|
|
else if ($total_posts == 1)
|
|
|
|
{
|
2002-10-20 19:19:07 +00:00
|
|
|
$l_total_post_s = $user->lang['Posted_article_total'];
|
2002-10-01 21:41:57 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-20 19:19:07 +00:00
|
|
|
$l_total_post_s = $user->lang['Posted_articles_total'];
|
2002-10-01 21:41:57 +00:00
|
|
|
}
|
|
|
|
|
2002-11-13 21:48:06 +00:00
|
|
|
if ($total_topics == 0)
|
|
|
|
{
|
|
|
|
$l_total_topic_s = $user->lang['Posted_topics_zero_total'];
|
|
|
|
}
|
|
|
|
else if ($total_topics == 1)
|
|
|
|
{
|
|
|
|
$l_total_topic_s = $user->lang['Posted_topic_total'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$l_total_topic_s = $user->lang['Posted_topics_total'];
|
|
|
|
}
|
|
|
|
|
2003-03-08 22:10:24 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
// Grab group details for legend display
|
|
|
|
$sql = "SELECT group_name, group_colour, group_type
|
2003-03-08 22:10:24 +00:00
|
|
|
FROM " . GROUPS_TABLE . "
|
2003-03-10 17:48:08 +00:00
|
|
|
WHERE group_colour <> ''
|
|
|
|
AND group_display = 1";
|
|
|
|
$result = $db->sql_query($sql, 120);
|
2003-03-08 22:10:24 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
$legend = '';
|
|
|
|
while ($row = $db->sql_fetchrow($result))
|
|
|
|
{
|
|
|
|
$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</span>';
|
|
|
|
}
|
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-03-10 17:48:08 +00:00
|
|
|
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
|
|
|
|
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
|
|
|
|
'NEWEST_USER' => sprintf($user->lang['Newest_user'], "<a href=\"memberlist.$phpEx$SID&mode=viewprofile&u=$newest_uid \">", $newest_user, '</a>'),
|
|
|
|
'LEGEND' => $legend,
|
2002-10-20 19:19:07 +00:00
|
|
|
|
2003-02-17 06:20:41 +00:00
|
|
|
'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'),
|
|
|
|
'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'),
|
|
|
|
'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'),
|
2002-10-01 21:41:57 +00:00
|
|
|
|
|
|
|
'U_MARK_READ' => "index.$phpEx$SID&mark=forums")
|
|
|
|
);
|
2001-07-13 16:14:37 +00:00
|
|
|
|
2003-03-10 17:48:08 +00:00
|
|
|
// Output page
|
2002-10-20 19:19:07 +00:00
|
|
|
$page_title = $user->lang['Index'];
|
2002-07-14 14:45:26 +00:00
|
|
|
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
|
|
|
|
|
|
|
$template->set_filenames(array(
|
2002-10-01 21:41:57 +00:00
|
|
|
'body' => 'index_body.html'
|
|
|
|
));
|
2001-02-22 06:10:12 +00:00
|
|
|
|
2001-07-13 16:14:37 +00:00
|
|
|
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
2001-06-11 00:14:27 +00:00
|
|
|
|
2003-01-13 06:44:16 +00:00
|
|
|
?>
|