2001-02-17 08:37:32 +00:00
|
|
|
<?php
|
2001-06-07 07:56:45 +00:00
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* -------------------
|
|
|
|
* begin : Saturday, Feb 13, 2001
|
|
|
|
* copyright : (C) 2001 The phpBB Group
|
|
|
|
* email : support@phpbb.com
|
|
|
|
*
|
2001-05-07 23:04:16 +00:00
|
|
|
* $Id$
|
2001-06-07 07:56:45 +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.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2001-02-23 20:34:43 +00:00
|
|
|
include('extension.inc');
|
2001-02-24 00:31:58 +00:00
|
|
|
include('common.'.$phpEx);
|
2001-02-17 08:37:32 +00:00
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
$pagetype = "viewforum";
|
|
|
|
$page_title = "View Forum - $forum_name";
|
|
|
|
|
2001-04-15 14:14:56 +00:00
|
|
|
//
|
|
|
|
// Obtain which forum id is required
|
|
|
|
//
|
|
|
|
if(!isset($HTTP_GET_VARS['forum']) && !isset($HTTP_POST_VARS['forum'])) // For backward compatibility
|
|
|
|
{
|
|
|
|
$forum_id = ($HTTP_GET_VARS[POST_FORUM_URL]) ? $HTTP_GET_VARS[POST_FORUM_URL] : $HTTP_POST_VARS[POST_FORUM_URL];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$forum_id = ($HTTP_GET_VARS['forum']) ? $HTTP_GET_VARS['forum'] : $HTTP_POST_VARS['forum'];
|
|
|
|
}
|
|
|
|
|
2001-05-26 12:47:27 +00:00
|
|
|
$start = (isset($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : 0;
|
|
|
|
|
2001-05-16 20:07:23 +00:00
|
|
|
//
|
|
|
|
// Start session management
|
|
|
|
//
|
|
|
|
$userdata = session_pagestart($user_ip, $forum_id, $session_length);
|
|
|
|
init_userprefs($userdata);
|
|
|
|
//
|
|
|
|
// End session management
|
|
|
|
//
|
|
|
|
|
2001-04-15 14:14:56 +00:00
|
|
|
//
|
2001-05-03 22:10:23 +00:00
|
|
|
// Check if the user has actually sent a forum ID with his/her request
|
2001-02-23 23:39:42 +00:00
|
|
|
// If not give them a nice error page.
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
2001-02-23 20:34:43 +00:00
|
|
|
if(isset($forum_id))
|
|
|
|
{
|
2001-06-05 13:34:23 +00:00
|
|
|
/*
|
2001-06-07 07:56:45 +00:00
|
|
|
$sql = "SELECT f.forum_name, f.forum_topics, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_votecreate, f.auth_vote, u.username, u.user_id
|
|
|
|
FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa
|
2001-06-05 13:34:23 +00:00
|
|
|
WHERE f.forum_id = $forum_id
|
2001-06-07 07:56:45 +00:00
|
|
|
AND aa.auth_mod = 1
|
|
|
|
AND aa.forum_id = f.forum_id
|
|
|
|
AND ug.group_id = aa.group_id
|
2001-06-05 13:34:23 +00:00
|
|
|
AND u.user_id = ug.user_id";
|
|
|
|
*/
|
2001-06-07 07:56:45 +00:00
|
|
|
$sql = "SELECT f.forum_name, f.forum_topics, u.username, u.user_id, fa.*
|
|
|
|
FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa, ".AUTH_FORUMS_TABLE." fa
|
2001-05-31 23:14:15 +00:00
|
|
|
WHERE f.forum_id = $forum_id
|
|
|
|
AND fa.forum_id = f.forum_id
|
2001-06-07 07:56:45 +00:00
|
|
|
AND aa.auth_mod = 1
|
|
|
|
AND aa.forum_id = f.forum_id
|
|
|
|
AND ug.group_id = aa.group_id
|
2001-05-31 23:14:15 +00:00
|
|
|
AND u.user_id = ug.user_id";
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
2001-06-07 07:56:45 +00:00
|
|
|
else
|
2001-02-23 20:34:43 +00:00
|
|
|
{
|
2001-04-15 17:32:12 +00:00
|
|
|
error_die(GENERAL_ERROR, "You have reached this page in error, please go back and try again");
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!$result = $db->sql_query($sql))
|
|
|
|
{
|
2001-04-15 17:32:12 +00:00
|
|
|
error_die(SQL_QUERY, "Couldn't obtain forums information.", __LINE__, __FILE__);
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
2001-06-07 07:56:45 +00:00
|
|
|
// If the query doesn't return any rows this
|
2001-05-03 22:10:23 +00:00
|
|
|
// isn't a valid forum. Inform the user.
|
2001-06-07 07:56:45 +00:00
|
|
|
if(!$total_rows = $db->sql_numrows($result))
|
2001-05-03 22:10:23 +00:00
|
|
|
{
|
|
|
|
error_die(GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again.");
|
|
|
|
}
|
2001-02-23 23:39:42 +00:00
|
|
|
|
2001-05-30 20:21:42 +00:00
|
|
|
$forum_row = $db->sql_fetchrowset($result);
|
|
|
|
if(!$forum_row)
|
|
|
|
{
|
|
|
|
error_die(SQL_QUERY, "Couldn't obtain rowset.", __LINE__, __FILE__);
|
|
|
|
}
|
2001-05-13 16:02:30 +00:00
|
|
|
|
|
|
|
//
|
2001-05-16 20:07:23 +00:00
|
|
|
// Start auth check
|
2001-05-13 16:02:30 +00:00
|
|
|
//
|
2001-05-31 23:14:15 +00:00
|
|
|
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row[0]);
|
2001-05-26 12:47:27 +00:00
|
|
|
|
2001-06-01 13:44:12 +00:00
|
|
|
if(!$is_auth['auth_read'] || !$is_auth['auth_view'])
|
2001-05-30 20:21:42 +00:00
|
|
|
{
|
|
|
|
//
|
|
|
|
// Ooopss, user is not authed
|
|
|
|
// to read this forum ...
|
|
|
|
//
|
|
|
|
include('includes/page_header.'.$phpEx);
|
2001-06-07 07:56:45 +00:00
|
|
|
|
2001-06-12 13:34:27 +00:00
|
|
|
$msg = $lang['Sorry_auth'] . $is_auth['auth_read_type'] . $lang['can_read'] . $lang['this_forum'];
|
2001-03-02 18:19:18 +00:00
|
|
|
|
2001-05-30 20:21:42 +00:00
|
|
|
$template->set_filenames(array(
|
|
|
|
"reg_header" => "error_body.tpl"
|
|
|
|
));
|
|
|
|
$template->assign_vars(array(
|
|
|
|
"ERROR_MESSAGE" => $msg
|
|
|
|
));
|
|
|
|
$template->pparse("reg_header");
|
2001-03-02 18:19:18 +00:00
|
|
|
|
2001-05-30 20:21:42 +00:00
|
|
|
include('includes/page_tail.'.$phpEx);
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
2001-05-30 20:21:42 +00:00
|
|
|
//
|
|
|
|
// End of auth check
|
|
|
|
//
|
2001-02-23 23:39:42 +00:00
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$forum_name = stripslashes($forum_row[0]['forum_name']);
|
2001-05-16 20:07:23 +00:00
|
|
|
if(empty($HTTP_POST_VARS['postdays']))
|
|
|
|
{
|
|
|
|
$topics_count = $forum_row[0]['forum_topics'];
|
|
|
|
}
|
2001-05-07 23:04:16 +00:00
|
|
|
|
2001-03-02 06:32:50 +00:00
|
|
|
for($x = 0; $x < $db->sql_numrows($result); $x++)
|
|
|
|
{
|
2001-05-03 22:10:23 +00:00
|
|
|
if($x > 0)
|
|
|
|
$forum_moderators .= ", ";
|
2001-06-07 07:56:45 +00:00
|
|
|
|
2001-06-12 13:34:27 +00:00
|
|
|
$forum_moderators .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_row[$x]['user_id']) . "\">" . $forum_row[$x]['username'] . "</a>";
|
2001-03-02 06:32:50 +00:00
|
|
|
}
|
2001-03-09 23:33:06 +00:00
|
|
|
|
2001-05-16 20:07:23 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Generate a 'Show posts in previous x days'
|
2001-06-07 07:56:45 +00:00
|
|
|
// select box. If the postdays var is POSTed
|
|
|
|
// then get it's value, find the number of topics
|
|
|
|
// with dates newer than it (to properly handle
|
2001-05-16 20:07:23 +00:00
|
|
|
// pagination) and alter the main query
|
|
|
|
//
|
2001-06-12 13:34:27 +00:00
|
|
|
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
|
|
|
|
$previous_days_text = array($lang['All_Topics'], "1 " . $lang['Day'], "7 " . $lang['Days'], "2 " . $lang['Weeks'], "1 " . $lang['Month'], "3 ". $lang['Months'], "6 " . $lang['Months'], "1 " . $lang['Year']);
|
2001-05-16 20:07:23 +00:00
|
|
|
|
2001-05-26 13:06:39 +00:00
|
|
|
if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
|
2001-02-23 20:34:43 +00:00
|
|
|
{
|
2001-05-16 20:07:23 +00:00
|
|
|
|
2001-05-26 13:06:39 +00:00
|
|
|
$post_days = (!empty($HTTP_POST_VARS['postdays'])) ? $HTTP_POST_VARS['postdays'] : $HTTP_GET_VARS['postdays'];
|
|
|
|
$min_post_time = time() - ($post_days * 86400);
|
2001-05-16 20:07:23 +00:00
|
|
|
|
2001-06-07 07:56:45 +00:00
|
|
|
$sql = "SELECT COUNT(*) AS forum_topics
|
|
|
|
FROM ".TOPICS_TABLE."
|
|
|
|
WHERE forum_id = $forum_id
|
2001-05-16 20:07:23 +00:00
|
|
|
AND topic_time > $min_post_time";
|
|
|
|
|
|
|
|
if(!$result = $db->sql_query($sql))
|
|
|
|
{
|
|
|
|
error_die(SQL_QUERY, "Couldn't obtain limited topics count information.", __LINE__, __FILE__);
|
|
|
|
}
|
2001-05-26 13:06:39 +00:00
|
|
|
$topics_count = $db->sql_fetchfield("forum_topics", -1, $result);
|
2001-05-16 20:07:23 +00:00
|
|
|
|
|
|
|
$limit_posts_time = "AND t.topic_time > $min_post_time ";
|
2001-05-26 13:06:39 +00:00
|
|
|
|
|
|
|
if(!empty($HTTP_POST_VARS['postdays']))
|
|
|
|
{
|
|
|
|
$start = 0;
|
|
|
|
}
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
2001-05-16 20:07:23 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
$limit_posts_time = "";
|
2001-05-26 13:06:39 +00:00
|
|
|
$post_days = 0;
|
2001-05-16 20:07:23 +00:00
|
|
|
}
|
|
|
|
|
2001-05-26 13:06:39 +00:00
|
|
|
$select_post_days = "<select name=\"postdays\">";
|
2001-05-16 20:07:23 +00:00
|
|
|
for($i = 0; $i < count($previous_days); $i++)
|
|
|
|
{
|
2001-05-26 13:06:39 +00:00
|
|
|
$selected = ($post_days == $previous_days[$i]) ? " selected" : "";
|
2001-05-26 12:47:27 +00:00
|
|
|
$select_post_days .= "<option value=\"".$previous_days[$i]."\"$selected>".$previous_days_text[$i]."</option>";
|
2001-05-16 20:07:23 +00:00
|
|
|
}
|
|
|
|
$select_post_days .= "</select>";
|
2001-02-23 20:34:43 +00:00
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
//
|
|
|
|
// Grab all the basic data for
|
|
|
|
// this forum
|
|
|
|
//
|
2001-06-11 00:58:08 +00:00
|
|
|
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
|
2001-05-13 16:02:30 +00:00
|
|
|
FROM ".TOPICS_TABLE." t, ".USERS_TABLE." u, ".POSTS_TABLE." p, ".USERS_TABLE." u2
|
|
|
|
WHERE t.forum_id = $forum_id
|
2001-06-07 07:56:45 +00:00
|
|
|
AND t.topic_poster = u.user_id
|
|
|
|
AND p.post_id = t.topic_last_post_id
|
|
|
|
AND p.poster_id = u2.user_id
|
|
|
|
AND t.topic_type <> ".GLOB_ANNOUNCE."
|
2001-05-16 20:07:23 +00:00
|
|
|
$limit_posts_time
|
2001-06-07 07:56:45 +00:00
|
|
|
ORDER BY t.topic_type DESC, p.post_time DESC
|
2001-05-03 22:10:23 +00:00
|
|
|
LIMIT $start, ".$board_config['topics_per_page'];
|
2001-06-11 00:58:08 +00:00
|
|
|
|
2001-02-23 20:34:43 +00:00
|
|
|
if(!$t_result = $db->sql_query($sql))
|
|
|
|
{
|
2001-04-15 17:32:12 +00:00
|
|
|
error_die(SQL_QUERY, "Couldn't obtain topic information.", __LINE__, __FILE__);
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
2001-05-03 22:10:23 +00:00
|
|
|
$total_topics = $db->sql_numrows($t_result);
|
|
|
|
|
|
|
|
//
|
2001-06-07 07:56:45 +00:00
|
|
|
// Post URL generation for
|
2001-05-03 22:10:23 +00:00
|
|
|
// templating vars
|
|
|
|
//
|
2001-05-06 16:16:22 +00:00
|
|
|
$post_new_topic_url = append_sid("posting.".$phpEx."?mode=newtopic&".POST_FORUM_URL."=$forum_id");
|
2001-05-03 22:10:23 +00:00
|
|
|
$template->assign_vars(array(
|
2001-05-16 20:07:23 +00:00
|
|
|
"U_POST_NEW_TOPIC" => $post_new_topic_url,
|
|
|
|
"S_SELECT_POST_DAYS" => $select_post_days,
|
|
|
|
"S_POST_DAYS_ACTION" => append_sid("viewforum.$phpEx?".POST_FORUM_URL."=".$forum_id."&start=$start")));
|
2001-02-23 20:34:43 +00:00
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
2001-05-17 14:48:39 +00:00
|
|
|
// Dump out the page header and
|
|
|
|
// load viewforum template
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
|
|
|
include('includes/page_header.'.$phpEx);
|
|
|
|
|
2001-05-17 14:48:39 +00:00
|
|
|
$template->set_filenames(array(
|
|
|
|
"body" => "viewforum_body.tpl",
|
|
|
|
"jumpbox" => "jumpbox.tpl")
|
|
|
|
);
|
|
|
|
$jumpbox = make_jumpbox();
|
|
|
|
$template->assign_vars(array(
|
|
|
|
"JUMPBOX_LIST" => $jumpbox,
|
|
|
|
"SELECT_NAME" => POST_FORUM_URL)
|
|
|
|
);
|
|
|
|
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
|
|
|
|
$template->assign_vars(array(
|
|
|
|
"FORUM_ID" => $forum_id,
|
|
|
|
"FORUM_NAME" => $forum_name,
|
|
|
|
"MODERATORS" => $forum_moderators,
|
|
|
|
"USERS_BROWSING" => $users_browsing)
|
|
|
|
);
|
|
|
|
//
|
|
|
|
// End header
|
|
|
|
//
|
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
|
|
|
// Okay, lets dump out the page ...
|
|
|
|
//
|
2001-02-23 20:34:43 +00:00
|
|
|
if($total_topics)
|
|
|
|
{
|
2001-05-03 22:10:23 +00:00
|
|
|
$topic_rowset = $db->sql_fetchrowset($t_result);
|
2001-06-05 21:15:19 +00:00
|
|
|
/*
|
|
|
|
//
|
|
|
|
// This code allows for individual topic
|
|
|
|
// read tracking, on small, low volume sites
|
|
|
|
// it'll probably work very well. However, for
|
|
|
|
// busy sites the use of a text field in the DB
|
|
|
|
// combined with the additional UPDATE's required
|
|
|
|
// in viewtopic may be unacceptable. So, by default
|
|
|
|
// this code is off, however you may want to play
|
|
|
|
// ...
|
|
|
|
//
|
|
|
|
// psoTFX
|
|
|
|
//
|
|
|
|
if($userdata['user_id'] != ANONYMOUS)
|
|
|
|
{
|
|
|
|
$unread_topic_list = unserialize($userdata['user_topics_unvisited']);
|
|
|
|
|
|
|
|
$last_update_time = (isset($unread_topic_list['lastupdate'])) ? $unread_topic_list['lastupdate'] : $userdata['session_last_visit'];
|
|
|
|
|
|
|
|
for($x = 0; $x < $total_topics; $x++)
|
|
|
|
{
|
|
|
|
if($topic_rowset[$x]['topic_time'] > $last_update_time)
|
|
|
|
{
|
|
|
|
$unread_topic_list[$forum_id][$topic_rowset[$x]['topic_id']] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$unread_topic_list['lastupdate'] = time();
|
|
|
|
|
2001-06-07 07:56:45 +00:00
|
|
|
$sql = "UPDATE " . USERS_TABLE . "
|
|
|
|
SET user_topics_unvisited = '" . serialize($unread_topic_list) . "'
|
2001-06-05 21:15:19 +00:00
|
|
|
WHERE user_id = " . $userdata['user_id'];
|
|
|
|
if(!$s_topic_times = $db->sql_query($sql))
|
|
|
|
{
|
|
|
|
error_die(SQL_QUERY, "Could not update user topics list.", __LINE__, __FILE__);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
for($x = 0; $x < $total_topics; $x++)
|
|
|
|
{
|
2001-05-13 16:02:30 +00:00
|
|
|
$topic_title = stripslashes($topic_rowset[$x]['topic_title']);
|
2001-06-07 07:56:45 +00:00
|
|
|
|
|
|
|
$topic_type = $topic_rowset[$x]['topic_type'];
|
|
|
|
|
|
|
|
if($topic_type == ANNOUCE)
|
|
|
|
{
|
|
|
|
$topic_type = $lang['Annoucement'] . " ";
|
|
|
|
}
|
|
|
|
else if($topic_type == STICKY)
|
|
|
|
{
|
|
|
|
$topic_type = $lang['Sticky'] . " ";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$topic_type = "";
|
|
|
|
}
|
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$topic_id = $topic_rowset[$x]['topic_id'];
|
2001-06-05 21:15:19 +00:00
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$replies = $topic_rowset[$x]['topic_replies'];
|
2001-05-03 22:10:23 +00:00
|
|
|
if($replies > $board_config['posts_per_page'])
|
|
|
|
{
|
2001-06-12 13:34:27 +00:00
|
|
|
$goto_page = " (<img src=\"".$images['posticon']."\">" . $lang['Goto_page'] .": ";
|
2001-05-03 22:10:23 +00:00
|
|
|
$times = 1;
|
|
|
|
for($i = 0; $i < ($replies + 1); $i += $board_config['posts_per_page'])
|
|
|
|
{
|
2001-06-07 07:56:45 +00:00
|
|
|
if($times > 4)
|
2001-05-03 22:10:23 +00:00
|
|
|
{
|
2001-06-07 07:56:45 +00:00
|
|
|
if(($i + $board_config['posts_per_page']) >= ($replies + 1))
|
2001-05-03 22:10:23 +00:00
|
|
|
{
|
2001-05-06 16:16:22 +00:00
|
|
|
$goto_page.=" ... <a href=\"".append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i")."\">$times</a>";
|
2001-05-03 22:10:23 +00:00
|
|
|
}
|
|
|
|
}
|
2001-06-07 07:56:45 +00:00
|
|
|
else
|
2001-05-03 22:10:23 +00:00
|
|
|
{
|
|
|
|
if($times != 1)
|
|
|
|
{
|
|
|
|
$goto_page.= ", ";
|
|
|
|
}
|
2001-05-06 16:16:22 +00:00
|
|
|
$goto_page.= "<a href=\"".append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i")."\">$times</a>";
|
2001-05-03 22:10:23 +00:00
|
|
|
}
|
|
|
|
$times++;
|
|
|
|
}
|
|
|
|
$goto_page.= ")";
|
|
|
|
}
|
2001-06-07 07:56:45 +00:00
|
|
|
else
|
2001-05-03 22:10:23 +00:00
|
|
|
{
|
|
|
|
$goto_page = "";
|
|
|
|
}
|
|
|
|
|
2001-06-05 21:15:19 +00:00
|
|
|
// if($userdata['user_id'] != ANONYMOUS)
|
|
|
|
// {
|
|
|
|
// $folder_image = (isset($unread_topic_list[$forum_id][$topic_id])) ? "<img src=\"".$images['new_folder']."\">" : "<img src=\"".$images['folder']."\">";
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
if($userdata['session_start'] == $userdata['session_time'])
|
|
|
|
{
|
|
|
|
$folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_last_visit']) ? "<img src=\"".$images['new_folder']."\">" : "<img src=\"".$images['folder']."\">";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$folder_image = ($topic_rowset[$x]['post_time'] > $userdata['session_time'] - 300) ? "<img src=\"".$images['new_folder']."\">" : "<img src=\"".$images['folder']."\">";
|
|
|
|
}
|
|
|
|
// }
|
2001-06-07 07:56:45 +00:00
|
|
|
|
2001-05-06 16:16:22 +00:00
|
|
|
$view_topic_url = append_sid("viewtopic.".$phpEx."?".POST_TOPIC_URL."=".$topic_id."&".$replies);
|
2001-05-03 22:10:23 +00:00
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$topic_poster = stripslashes($topic_rowset[$x]['username']);
|
|
|
|
$topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$topic_rowset[$x]['user_id']);
|
2001-05-03 22:10:23 +00:00
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$x]['post_time'], $board_config['default_timezone']);
|
2001-06-11 00:58:08 +00:00
|
|
|
|
|
|
|
if($topic_rowset[$x]['id2'] == ANONYMOUS && $topic_rowset[$x]['post_username'] != '')
|
|
|
|
{
|
|
|
|
$last_post_user = $topic_rowset[$x]['post_username'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$last_post_user = $topic_rowset[$x]['user2'];
|
|
|
|
}
|
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$last_post_profile_url = append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$topic_rowset[$x]['id2']);
|
2001-05-03 22:10:23 +00:00
|
|
|
|
2001-05-13 16:02:30 +00:00
|
|
|
$views = $topic_rowset[$x]['topic_views'];
|
2001-05-03 22:10:23 +00:00
|
|
|
|
|
|
|
$template->assign_block_vars("topicrow", array(
|
|
|
|
"FORUM_ID" => $forum_id,
|
|
|
|
"TOPIC_ID" => $topic_id,
|
2001-06-07 07:56:45 +00:00
|
|
|
"FOLDER" => $folder_image,
|
2001-05-03 22:10:23 +00:00
|
|
|
"TOPIC_POSTER" => $topic_poster,
|
|
|
|
"GOTO_PAGE" => $goto_page,
|
|
|
|
"REPLIES" => $replies,
|
|
|
|
"TOPIC_TITLE" => $topic_title,
|
2001-06-07 07:56:45 +00:00
|
|
|
"TOPIC_TYPE" => $topic_type,
|
2001-05-03 22:10:23 +00:00
|
|
|
"VIEWS" => $views,
|
|
|
|
"LAST_POST_TIME" => $last_post_time,
|
|
|
|
"LAST_POST_USER" => $last_post_user,
|
|
|
|
|
|
|
|
"U_VIEW_TOPIC" => $view_topic_url,
|
2001-05-26 13:06:39 +00:00
|
|
|
"U_LAST_POST_USER_PROFILE" => $last_post_profile_url,
|
|
|
|
"U_TOPIC_POSTER_PROFILE" => $topic_poster_profile_url)
|
2001-05-07 23:04:16 +00:00
|
|
|
);
|
2001-05-03 22:10:23 +00:00
|
|
|
}
|
2001-05-07 23:04:16 +00:00
|
|
|
|
2001-05-31 15:39:59 +00:00
|
|
|
$s_auth_can = "";
|
|
|
|
$s_auth_can .= "You " . (($is_auth['auth_read']) ? "<b>can</b>" : "<b>cannot</b>" ) . " read posts in this forum<br>";
|
|
|
|
$s_auth_can .= "You " . (($is_auth['auth_post']) ? "<b>can</b>" : "<b>cannot</b>") . " add new topics to this forum<br>";
|
|
|
|
$s_auth_can .= "You " . (($is_auth['auth_reply']) ? "<b>can</b>" : "<b>cannot</b>") . " reply to posts in this forum<br>";
|
|
|
|
$s_auth_can .= "You " . (($is_auth['auth_edit']) ? "<b>can</b>" : "<b>cannot</b>") . " edit your posts in this forum<br>";
|
|
|
|
$s_auth_can .= "You " . (($is_auth['auth_delete']) ? "<b>can</b>" : "<b>cannot</b>") . " delete your posts in this forum<br>";
|
|
|
|
$s_auth_can .= ($is_auth['auth_mod']) ? "You are a moderator of this forum<br>" : "";
|
2001-05-31 23:14:15 +00:00
|
|
|
$s_auth_can .= ($userdata['user_level'] == ADMIN) ? "You are a board admin<br>" : "";
|
2001-05-31 15:39:59 +00:00
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
$template->assign_vars(array(
|
2001-05-28 15:25:23 +00:00
|
|
|
"PAGINATION" => generate_pagination("viewforum.$phpEx?".POST_FORUM_URL."=$forum_id&postdays=$post_days", $topics_count, $board_config['topics_per_page'], $start),
|
|
|
|
"ON_PAGE" => (floor($start/$board_config['topics_per_page'])+1),
|
2001-06-07 07:56:45 +00:00
|
|
|
"TOTAL_PAGES" => ceil($topics_count/$board_config['topics_per_page']),
|
2001-05-31 15:39:59 +00:00
|
|
|
|
|
|
|
"S_AUTH_LIST" => $s_auth_can,
|
2001-06-07 07:56:45 +00:00
|
|
|
|
2001-05-28 15:25:23 +00:00
|
|
|
"L_OF" => $lang['of'],
|
|
|
|
"L_PAGE" => $lang['Page'],
|
|
|
|
"L_GOTO_PAGE" => $lang['Goto_page'])
|
2001-05-07 23:04:16 +00:00
|
|
|
);
|
2001-05-17 14:48:39 +00:00
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
$template->pparse("body");
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-05-26 12:47:27 +00:00
|
|
|
//
|
|
|
|
// This will be present in the templates
|
|
|
|
// at some future point when if...else
|
|
|
|
// constructs are available
|
|
|
|
//
|
2001-04-15 17:32:12 +00:00
|
|
|
error_die(NO_POSTS);
|
2001-02-23 20:34:43 +00:00
|
|
|
}
|
2001-06-07 07:56:45 +00:00
|
|
|
|
2001-03-09 23:33:06 +00:00
|
|
|
include('includes/page_tail.'.$phpEx);
|
2001-02-17 08:37:32 +00:00
|
|
|
|
2001-04-15 17:32:12 +00:00
|
|
|
?>
|