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
|
|
|
|
2003-05-02 15:50:11 +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);
|
2003-05-02 15:50:11 +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
|
|
|
{
|
2003-04-26 01:17:40 +00:00
|
|
|
if ($userdata['user_id'] != ANONYMOUS)
|
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
|
|
|
|
2003-04-26 01:17:40 +00:00
|
|
|
meta_refresh(3, "index.$phpEx$SID");
|
2001-09-28 23:46:04 +00:00
|
|
|
|
2003-04-26 01:17:40 +00:00
|
|
|
$message = $user->lang['FORUMS_MARKED'] . '<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
|
|
|
{
|
2003-05-03 23:58:45 +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
|
|
|
{
|
2003-05-03 23:58:45 +00:00
|
|
|
$l_total_user_s = $user->lang['REGISTERED_USER_TOTAL'];
|
2002-08-13 16:40:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-05-03 23:58:45 +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)
|
|
|
|
{
|
2003-05-03 23:58:45 +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)
|
|
|
|
{
|
2003-05-03 23:58:45 +00:00
|
|
|
$l_total_post_s = $user->lang['POSTED_ARTICLE_TOTAL'];
|
2002-10-01 21:41:57 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-05-03 23:58:45 +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)
|
|
|
|
{
|
2003-05-03 23:58:45 +00:00
|
|
|
$l_total_topic_s = $user->lang['POSTED_TOPICS_ZERO_TOTAL'];
|
2002-11-13 21:48:06 +00:00
|
|
|
}
|
|
|
|
else if ($total_topics == 1)
|
|
|
|
{
|
2003-05-03 23:58:45 +00:00
|
|
|
$l_total_topic_s = $user->lang['POSTED_TOPIC_TOTAL'];
|
2002-11-13 21:48:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-05-03 23:58:45 +00:00
|
|
|
$l_total_topic_s = $user->lang['POSTED_TOPICS_TOTAL'];
|
2002-11-13 21:48:06 +00:00
|
|
|
}
|
|
|
|
|
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";
|
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))
|
|
|
|
{
|
|
|
|
$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</span>';
|
|
|
|
}
|
2003-05-20 23:57:08 +00:00
|
|
|
$db->sql_freeresult($result);
|
|
|
|
|
|
|
|
|
|
|
|
// Generate birthday list if required ...
|
|
|
|
$birthday_list = '';
|
|
|
|
if ($config['load_birthdays'])
|
|
|
|
{
|
|
|
|
$now = getdate();
|
|
|
|
$sql = 'SELECT user_id, username, user_colour, user_birthday
|
|
|
|
FROM ' . USERS_TABLE . "
|
|
|
|
WHERE user_birthday LIKE '" . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . "%'";
|
|
|
|
$result = $db->sql_query($sql);
|
|
|
|
|
|
|
|
while ($row = $db->sql_fetchrow($result))
|
|
|
|
{
|
|
|
|
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';
|
|
|
|
$birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . " href=\"memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>';
|
|
|
|
|
|
|
|
if ($age = (int)substr($row['user_birthday'], -4))
|
|
|
|
{
|
|
|
|
$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-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),
|
2003-05-03 23:58:45 +00:00
|
|
|
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "<a href=\"memberlist.$phpEx$SID&mode=viewprofile&u=$newest_uid \">", $newest_user, '</a>'),
|
2003-03-10 17:48:08 +00:00
|
|
|
'LEGEND' => $legend,
|
2003-05-26 23:53:34 +00:00
|
|
|
'BIRTHDAY_LIST' => $birthday_list,
|
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
|
|
|
|
2003-05-20 23:57:08 +00:00
|
|
|
'S_LOGIN_ACTION' => "ucp.php?$SID&mode=login",
|
|
|
|
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
2003-03-20 02:28:30 +00:00
|
|
|
|
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
|
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
|
|
|
?>
|