mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Subforums update take #1
git-svn-id: file:///svn/phpbb/trunk@3010 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e9e9716acc
commit
7cda8ec239
8 changed files with 398 additions and 673 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* display_forums.php
|
* functions_display.php
|
||||||
* ------------------
|
* ------------------
|
||||||
* begin : Saturday, Feb 13, 2001
|
* begin : Saturday, Feb 13, 2001
|
||||||
* copyright : (C) 2001 The phpBB Group
|
* copyright : (C) 2001 The phpBB Group
|
||||||
|
@ -19,6 +19,22 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
function display_forums($left_id=0, $right_id=0)
|
||||||
|
{
|
||||||
|
global $db, $template, $auth;
|
||||||
|
|
||||||
|
$where_sql = ($left_id && $right_id) ? " WHERE left_id > $left_id AND left_id < $right_id" : '';
|
||||||
|
$sql = 'SELECT * FROM ' . FORUMS_TABLE . $where_sql . ' ORDER BY left_id ASC';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$cat_header =
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($forum_rows as $row)
|
foreach ($forum_rows as $row)
|
||||||
{
|
{
|
||||||
extract($row);
|
extract($row);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
function sql_addslashes($msg)
|
function sql_escape($msg)
|
||||||
{
|
{
|
||||||
return str_replace("'", "''", str_replace('\\', '\\\\', $msg));
|
return str_replace("'", "''", str_replace('\\', '\\\\', $msg));
|
||||||
}
|
}
|
||||||
|
@ -80,79 +80,6 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
function forum_nav_links(&$forum_id, &$forum_data)
|
|
||||||
{
|
|
||||||
global $SID, $template, $phpEx, $auth;
|
|
||||||
|
|
||||||
$type = 'parent';
|
|
||||||
$forum_rows = array();
|
|
||||||
|
|
||||||
if (!($forum_branch = get_forum_branch($forum_id)))
|
|
||||||
{
|
|
||||||
trigger_error($user->lang['Forum_not_exist']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$s_has_subforums = FALSE;
|
|
||||||
foreach ($forum_branch as $row)
|
|
||||||
{
|
|
||||||
if ($type == 'parent')
|
|
||||||
{
|
|
||||||
$link = ($row['forum_status'] == ITEM_CATEGORY) ? 'index.' . $phpEx . $SID . '&c=' . $row['forum_id'] : 'viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'];
|
|
||||||
|
|
||||||
$template->assign_block_vars('navlinks', array(
|
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
|
||||||
'U_VIEW_FORUM' => $link
|
|
||||||
));
|
|
||||||
|
|
||||||
if ($row['forum_id'] == $forum_id)
|
|
||||||
{
|
|
||||||
$branch_root_id = 0;
|
|
||||||
$forum_data = $row;
|
|
||||||
$type = 'child';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($row['parent_id'] == $forum_data['forum_id'])
|
|
||||||
{
|
|
||||||
// Root-level forum
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$parent_id = $row['forum_id'];
|
|
||||||
|
|
||||||
if ($row['forum_status'] == ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$branch_root_id = $row['forum_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$s_has_subforums = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($row['parent_id'] == $branch_root_id)
|
|
||||||
{
|
|
||||||
// Forum directly under a category
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$parent_id = $row['forum_id'];
|
|
||||||
|
|
||||||
if ($row['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$s_has_subforums = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($row['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
// Subforum
|
|
||||||
if ($auth->acl_get('f_list', $row['forum_id']))
|
|
||||||
{
|
|
||||||
$subforums[$parent_id][] = $row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $s_has_subforums;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Obtain list of moderators of each forum
|
// Obtain list of moderators of each forum
|
||||||
// First users, then groups ... broken into two queries
|
// First users, then groups ... broken into two queries
|
||||||
// We could cache this ... certainly into a DB table. Would
|
// We could cache this ... certainly into a DB table. Would
|
||||||
|
@ -167,7 +94,14 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||||
{
|
{
|
||||||
global $SID, $db, $acl_options, $phpEx;
|
global $SID, $db, $acl_options, $phpEx;
|
||||||
|
|
||||||
$forum_sql = ( $forum_id ) ? 'AND m.forum_id = ' . $forum_id : '';
|
if (is_array($forum_id))
|
||||||
|
{
|
||||||
|
$forum_sql = 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$forum_sql = ( $forum_id ) ? 'AND a.forum_id = ' . $forum_id : '';
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
$sql = "SELECT m.forum_id, u.user_id, u.username, g.group_id, g.group_name
|
$sql = "SELECT m.forum_id, u.user_id, u.username, g.group_id, g.group_name
|
||||||
FROM phpbb_moderators m
|
FROM phpbb_moderators m
|
||||||
|
@ -182,12 +116,12 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||||
$forum_moderators[$row['forum_id']][] = ( !empty($row['user_id']) ) ? '<a href="profile.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'] . '">' . $row['username'] . '</a>' : '<a href="groupcp.' . $phpEx . $SID . '&g=' . $row['group_id'] . '">' . $row['group_name'] . '</a>';
|
$forum_moderators[$row['forum_id']][] = ( !empty($row['user_id']) ) ? '<a href="profile.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'] . '">' . $row['username'] . '</a>' : '<a href="groupcp.' . $phpEx . $SID . '&g=' . $row['group_id'] . '">' . $row['group_name'] . '</a>';
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
$sql = "SELECT au.forum_id, u.user_id, u.username
|
$sql = "SELECT a.forum_id, u.user_id, u.username
|
||||||
FROM " . ACL_OPTIONS_TABLE . " o, " . ACL_USERS_TABLE . " au, " . USERS_TABLE . " u
|
FROM " . ACL_OPTIONS_TABLE . " o, " . ACL_USERS_TABLE . " a, " . USERS_TABLE . " u
|
||||||
WHERE au.auth_option_id = o.auth_option_id
|
WHERE a.auth_option_id = o.auth_option_id
|
||||||
AND au.user_id = u.user_id
|
AND a.user_id = u.user_id
|
||||||
AND o.auth_value = 'm_'
|
AND o.auth_value = 'm_'
|
||||||
AND au.auth_allow_deny = 1
|
AND a.auth_allow_deny = 1
|
||||||
$forum_sql";
|
$forum_sql";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -196,12 +130,12 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||||
$forum_moderators[$row['forum_id']][] = '<a href="profile.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'] . '">' . $row['username'] . '</a>';
|
$forum_moderators[$row['forum_id']][] = '<a href="profile.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'] . '">' . $row['username'] . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT ag.forum_id, g.group_name, g.group_id
|
$sql = "SELECT a.forum_id, g.group_name, g.group_id
|
||||||
FROM " . ACL_OPTIONS_TABLE . " o, " . ACL_GROUPS_TABLE . " ag, " . GROUPS_TABLE . " g
|
FROM " . ACL_OPTIONS_TABLE . " o, " . ACL_GROUPS_TABLE . " a, " . GROUPS_TABLE . " g
|
||||||
WHERE ag.auth_option_id = o.auth_option_id
|
WHERE a.auth_option_id = o.auth_option_id
|
||||||
AND ag.group_id = g.group_id
|
AND a.group_id = g.group_id
|
||||||
AND o.auth_value = 'm_'
|
AND o.auth_value = 'm_'
|
||||||
AND ag.auth_allow_deny = 1
|
AND a.auth_allow_deny = 1
|
||||||
AND g.group_type <> " . GROUP_HIDDEN . "
|
AND g.group_type <> " . GROUP_HIDDEN . "
|
||||||
$forum_sql";
|
$forum_sql";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
|
@ -99,7 +99,7 @@ class session
|
||||||
if ($u_ip == $s_ip)
|
if ($u_ip == $s_ip)
|
||||||
{
|
{
|
||||||
// Only update session DB a minute or so after last update or if page changes
|
// Only update session DB a minute or so after last update or if page changes
|
||||||
if (($current_time - $this->data['session_time'] > 60 || $this->data['session_page'] != $user_page) && $update)
|
if (($current_time - $this->data['session_time'] > 60 || $this->data['session_page'] != $this->page) && $update)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE " . SESSIONS_TABLE . "
|
$sql = "UPDATE " . SESSIONS_TABLE . "
|
||||||
SET session_time = $current_time, session_page = '$this->page'
|
SET session_time = $current_time, session_page = '$this->page'
|
||||||
|
|
107
phpBB/index.php
107
phpBB/index.php
|
@ -112,98 +112,14 @@ if ($cat_id == 0)
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . FORUMS_TABLE . ' ORDER BY left_id';
|
$sql = 'SELECT * FROM ' . FORUMS_TABLE . ' ORDER BY left_id';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$is_nav = TRUE;
|
|
||||||
|
|
||||||
if (!$auth->acl_get('f_list', $cat_id))
|
|
||||||
{
|
|
||||||
// TODO: Deal with hidden categories
|
|
||||||
message_die(ERROR, $user->lang['Category_not_exist']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: make sure that categories post count is set to 0
|
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||||
$sql = 'SELECT SUM(forum_posts) AS total
|
display_forums(array(
|
||||||
FROM ' . FORUMS_TABLE . '
|
'forum_id' => 0,
|
||||||
WHERE post_count_inc = 1';
|
'left_id' => 0,
|
||||||
|
'right_id' => 0
|
||||||
$result = $db->sql_query($sql);
|
));
|
||||||
$total_posts = $db->sql_fetchfield('total', 0, $result);
|
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT left_id, right_id, parent_id FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $cat_id);
|
|
||||||
$catrow = $db->sql_fetchrow($result);
|
|
||||||
|
|
||||||
switch (SQL_LAYER)
|
|
||||||
{
|
|
||||||
case 'oracle':
|
|
||||||
$sql = 'SELECT f.*, u.username
|
|
||||||
FROM ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . 'u
|
|
||||||
WHERE (f.left_id BETWEEN ' . $catrow['left_id'] . ' AND ' . $catrow['right_id'] . '
|
|
||||||
OR ' . $catrow['left_id'] . ' BETWEEN f.left_id AND f.right_id)
|
|
||||||
AND f.forum_last_poster_id = u.user_id(+)
|
|
||||||
ORDER BY left_id';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$sql = 'SELECT f.*, u.username
|
|
||||||
FROM ' . FORUMS_TABLE . ' f
|
|
||||||
LEFT JOIN ' . USERS_TABLE . ' u ON f.forum_last_poster_id = u.user_id
|
|
||||||
WHERE f.left_id BETWEEN ' . $catrow['left_id'] . ' AND ' . $catrow['right_id'] . '
|
|
||||||
OR ' . $catrow['left_id'] . ' BETWEEN f.left_id AND f.right_id
|
|
||||||
ORDER BY f.left_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (!$cat_id && $row['post_count_inc'])
|
|
||||||
{
|
|
||||||
$total_posts += $row['forum_posts'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($row['forum_id'] == $cat_id)
|
|
||||||
{
|
|
||||||
$nav_forums[] = $row;
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$is_nav = FALSE;
|
|
||||||
}
|
|
||||||
elseif ($is_nav)
|
|
||||||
{
|
|
||||||
$nav_forums[] = $row;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($row['parent_id'] == $cat_id)
|
|
||||||
{
|
|
||||||
// Root-level forum
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$parent_id = $row['forum_id'];
|
|
||||||
|
|
||||||
if (!$cat_id && $row['forum_status'] == ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$branch_root_id = $row['forum_id'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($row['parent_id'] == $branch_root_id)
|
|
||||||
{
|
|
||||||
// Forum directly under a category
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$parent_id = $row['forum_id'];
|
|
||||||
}
|
|
||||||
elseif ($row['display_on_index'] && $row['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
// Subforum, store it for direct linking
|
|
||||||
if ($auth->acl_get('f_list', $row['forum_id']))
|
|
||||||
{
|
|
||||||
$subforums[$parent_id][] = $row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$root_id = ($cat_id) ? $catrow['parent_id'] : 0;
|
|
||||||
include($phpbb_root_path . 'includes/forums_display.' . $phpEx);
|
|
||||||
|
|
||||||
if ($total_posts == 0)
|
if ($total_posts == 0)
|
||||||
{
|
{
|
||||||
|
@ -227,17 +143,6 @@ $template->assign_vars(array(
|
||||||
'FORUM_NEW_IMG' => $user->img('forum_new', $user->lang['New_posts']),
|
'FORUM_NEW_IMG' => $user->img('forum_new', $user->lang['New_posts']),
|
||||||
'FORUM_LOCKED_IMG' => $user->img('forum_locked', $user->lang['No_new_posts_locked']),
|
'FORUM_LOCKED_IMG' => $user->img('forum_locked', $user->lang['No_new_posts_locked']),
|
||||||
|
|
||||||
'L_FORUM' => $user->lang['Forum'],
|
|
||||||
'L_TOPICS' => $user->lang['Topics'],
|
|
||||||
'L_REPLIES' => $user->lang['Replies'],
|
|
||||||
'L_VIEWS' => $user->lang['Views'],
|
|
||||||
'L_POSTS' => $user->lang['Posts'],
|
|
||||||
'L_LASTPOST' => $user->lang['Last_Post'],
|
|
||||||
'L_MODERATORS' => $user->lang['Moderators'],
|
|
||||||
'L_NO_NEW_POSTS' => $user->lang['No_new_posts'],
|
|
||||||
'L_NEW_POSTS' => $user->lang['New_posts'],
|
|
||||||
'L_NO_NEW_POSTS_LOCKED' => $user->lang['No_new_posts_locked'],
|
|
||||||
'L_NEW_POSTS_LOCKED' => $user->lang['New_posts_locked'],
|
|
||||||
'L_ONLINE_EXPLAIN' => $user->lang['Online_explain'],
|
'L_ONLINE_EXPLAIN' => $user->lang['Online_explain'],
|
||||||
|
|
||||||
'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
|
'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
|
||||||
|
|
|
@ -29,22 +29,7 @@
|
||||||
<td class="catLeft" colspan="3" height="28"><span class="cattitle"><a href="{forumrow.U_VIEWCAT}" class="cattitle">{forumrow.CAT_NAME}</a></span></td>
|
<td class="catLeft" colspan="3" height="28"><span class="cattitle"><a href="{forumrow.U_VIEWCAT}" class="cattitle">{forumrow.CAT_NAME}</a></span></td>
|
||||||
<td class="rowpic" colspan="4" align="right"> </td>
|
<td class="rowpic" colspan="4" align="right"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ELSE -->
|
||||||
<!-- IF forumrow.S_IS_ROOTFORUM -->
|
|
||||||
<tr>
|
|
||||||
<td class="row1" colspan="2" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
|
||||||
<td class="row1" width="100%" height="50"><span class="forumlink"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{forumrow.FORUM_DESC}</span><br />
|
|
||||||
<!-- IF forumrow.SUBFORUMS -->
|
|
||||||
<span class="gensmall"><b>{forumrow.L_SUBFORUM}</b> {forumrow.SUBFORUMS}</span>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
</td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.TOPICS}</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.POSTS}</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST}</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.MODERATORS}</span></td>
|
|
||||||
</tr>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF forumrow.S_IS_FORUM -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="spaceRow" width="8"></td>
|
<td class="spaceRow" width="8"></td>
|
||||||
<td class="row1" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
<td class="row1" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
||||||
|
@ -59,18 +44,6 @@
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.MODERATORS}</span></td>
|
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.MODERATORS}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF forumrow.S_IS_SUBCAT -->
|
|
||||||
<tr>
|
|
||||||
<td class="spaceRow" width="8"></td>
|
|
||||||
<td class="row1" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
|
||||||
<td class="row1" width="100%" height="50"><span class="forumlink"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{forumrow.FORUM_DESC}</span><br />
|
|
||||||
<!-- IF forumrow.SUBFORUMS -->
|
|
||||||
<span class="gensmall"><b>{forumrow.L_SUBFORUM}</b> {forumrow.SUBFORUMS}</span>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
</td>
|
|
||||||
<td class="row2" colspan="4"> </td>
|
|
||||||
</tr>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- BEGINELSE -->
|
<!-- BEGINELSE -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="7" height="28" align="center"><span class="gen">{L_NO_FORUMS}</span></td>
|
<td class="row1" colspan="7" height="28" align="center"><span class="gen">{L_NO_FORUMS}</span></td>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
|
|
||||||
<!-- IF S_HAS_SUBFORUM -->
|
|
||||||
<!-- INCLUDE viewforum_subforum.html -->
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a> <br /><span class="gensmall"> [ <a href="{U_VIEW_MODERATORS}">{L_VIEW_MODERATORS}</a> ] <span class="gensmall">{MOD_CP}</span><br /><br /><b>{LOGGED_IN_USER_LIST}</b></span></td>
|
<td colspan="2" align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a> <br /><span class="gensmall">
|
||||||
|
<!-- IF S_IS_POSTABLE -->
|
||||||
|
[ <a href="{U_VIEW_MODERATORS}">{L_VIEW_MODERATORS}</a> ] {MOD_CP}<br />
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<br /><b>{LOGGED_IN_USER_LIST}</b></span></td>
|
||||||
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
|
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -20,6 +20,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<!-- IF S_HAS_SUBFORUM -->
|
||||||
|
<!-- INCLUDE viewforum_subforum.html -->
|
||||||
|
<br /><br />
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF S_IS_POSTABLE -->
|
||||||
<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
|
<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="thCornerL" colspan="3" height="25" align="center" nowrap="nowrap"> {L_TOPICS} </th>
|
<th class="thCornerL" colspan="3" height="25" align="center" nowrap="nowrap"> {L_TOPICS} </th>
|
||||||
|
@ -108,5 +114,6 @@
|
||||||
<td align="right"><span class="gensmall">{S_AUTH_LIST}</span></td>
|
<td align="right"><span class="gensmall">{S_AUTH_LIST}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
<!-- INCLUDE overall_footer.html -->
|
|
@ -1,33 +1,19 @@
|
||||||
<table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0">
|
<table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="thCornerL" colspan="3" height="25" nowrap="nowrap"> {L_SUBFORUM} </th>
|
<th class="thCornerL" colspan="2" height="25" nowrap="nowrap"> {L_FORUM} </th>
|
||||||
<th class="thTop" width="50" nowrap="nowrap"> {L_TOPICS} </th>
|
<th class="thTop" width="50" nowrap="nowrap"> {L_TOPICS} </th>
|
||||||
<th class="thTop" width="50" nowrap="nowrap"> {L_POSTS} </th>
|
<th class="thTop" width="50" nowrap="nowrap"> {L_POSTS} </th>
|
||||||
<th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
|
<th class="thTop" nowrap="nowrap"> {L_LASTPOST} </th>
|
||||||
|
<th class="thCornerR"> {L_MODERATORS} </th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGIN forumrow -->
|
<!-- BEGIN forumrow -->
|
||||||
<!-- IF forumrow.S_IS_CAT -->
|
<!-- IF forumrow.S_IS_CAT -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="catLeft" colspan="3" height="28"><span class="cattitle"><a href="{forumrow.U_VIEWCAT}" class="cattitle">{forumrow.CAT_NAME}</a></span></td>
|
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{forumrow.U_VIEWFORUM}" class="cattitle">{forumrow.FORUM_NAME}</a></span></td>
|
||||||
<td class="rowpic" colspan="3" align="right"> </td>
|
<td class="rowpic" colspan="4" align="right"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ELSE -->
|
||||||
<!-- IF forumrow.S_IS_ROOTFORUM -->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="2" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
|
||||||
<td class="row1" width="100%" height="50"><span class="forumlink"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{forumrow.FORUM_DESC}</span><br />
|
|
||||||
<!-- IF forumrow.SUBFORUMS -->
|
|
||||||
<span class="gensmall"><b>{forumrow.L_SUBFORUM}</b> {forumrow.SUBFORUMS}</span>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
</td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.TOPICS}</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.POSTS}</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST}</span></td>
|
|
||||||
</tr>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF forumrow.S_IS_FORUM -->
|
|
||||||
<tr>
|
|
||||||
<td class="spaceRow" width="8"></td>
|
|
||||||
<td class="row1" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
<td class="row1" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
||||||
<td class="row1" width="100%" height="50"><span class="forumlink"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{forumrow.FORUM_DESC}</span><br />
|
<td class="row1" width="100%" height="50"><span class="forumlink"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{forumrow.FORUM_DESC}</span><br />
|
||||||
<!-- IF forumrow.SUBFORUMS -->
|
<!-- IF forumrow.SUBFORUMS -->
|
||||||
|
@ -37,18 +23,7 @@
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.TOPICS}</span></td>
|
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.TOPICS}</span></td>
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.POSTS}</span></td>
|
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.POSTS}</span></td>
|
||||||
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST}</span></td>
|
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST}</span></td>
|
||||||
</tr>
|
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.MODERATORS}</span></td>
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF forumrow.S_IS_SUBCAT -->
|
|
||||||
<tr>
|
|
||||||
<td class="spaceRow" width="8"></td>
|
|
||||||
<td class="row1" width="50" height="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
|
|
||||||
<td class="row1" width="100%" height="50"><span class="forumlink"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{forumrow.FORUM_DESC}</span><br />
|
|
||||||
<!-- IF forumrow.SUBFORUMS -->
|
|
||||||
<span class="gensmall"><b>{forumrow.L_SUBFORUM}</b> {forumrow.SUBFORUMS}</span>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
</td>
|
|
||||||
<td class="row2" colspan="3"> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- END forumrow -->
|
<!-- END forumrow -->
|
||||||
|
|
|
@ -22,14 +22,6 @@
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './';
|
$phpbb_root_path = './';
|
||||||
include($phpbb_root_path . 'extension.inc');
|
include($phpbb_root_path . 'extension.inc');
|
||||||
|
|
||||||
if (preg_match('/^c([0-9]+)$/', $_POST['f'], $m))
|
|
||||||
{
|
|
||||||
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
|
|
||||||
header($header_location . "index.$phpEx?sid=" . $_GET['sid'] . '&c=' . $m[1]);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
|
||||||
// Start initial var setup
|
// Start initial var setup
|
||||||
|
@ -108,7 +100,7 @@ if ($forum_data['parent_id'] > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||||
SET forum_parents = '" . sql_addslashes(serialize($forum_parents)) . "'
|
SET forum_parents = '" . sql_escape(serialize($forum_parents)) . "'
|
||||||
WHERE parent_id = " . $forum_data['parent_id'];
|
WHERE parent_id = " . $forum_data['parent_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
@ -131,90 +123,13 @@ $template->assign_block_vars('navlinks', array(
|
||||||
'U_VIEW_FORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id
|
'U_VIEW_FORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
// Get forum children
|
'FORUM_ID' => $forum_id,
|
||||||
if ($forum_data['left_id'] != $forum_data['right_id'] - 1)
|
'FORUM_NAME' => $forum_data['forum_name']
|
||||||
{
|
|
||||||
$sql = 'SELECT *
|
|
||||||
FROM ' . FORUMS_TABLE . '
|
|
||||||
WHERE left_id > ' . $forum_data['left_id'] . ' AND left_id < ' . $forum_data['right_id'] . '
|
|
||||||
ORDER BY left_id ASC';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$type = 'parent';
|
|
||||||
$forum_rows = array();
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if ($type == 'parent')
|
|
||||||
{
|
|
||||||
|
|
||||||
if ($row['forum_status'] == ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$link = 'index.' . $phpEx . $SID . '&c=' . $row['forum_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$link = 'viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_block_vars('navlinks', array(
|
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
|
||||||
'U_VIEW_FORUM' => $link
|
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($row['forum_id'] == $forum_id)
|
if ($forum_data['forum_postable'])
|
||||||
{
|
{
|
||||||
$branch_root_id = 0;
|
|
||||||
$forum_data = $row;
|
|
||||||
$type = 'child';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*/
|
|
||||||
if ($row['parent_id'] == $forum_data['forum_id'])
|
|
||||||
{
|
|
||||||
// Root-level forum
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$parent_id = $row['forum_id'];
|
|
||||||
|
|
||||||
if ($row['forum_status'] == ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$branch_root_id = $row['forum_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$s_has_subforums = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($row['parent_id'] == $branch_root_id)
|
|
||||||
{
|
|
||||||
// Forum directly under a category
|
|
||||||
$forum_rows[] = $row;
|
|
||||||
$parent_id = $row['forum_id'];
|
|
||||||
|
|
||||||
if ($row['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
$s_has_subforums = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($row['forum_status'] != ITEM_CATEGORY)
|
|
||||||
{
|
|
||||||
// Subforum
|
|
||||||
if ($auth->acl_get('f_list', $row['forum_id']))
|
|
||||||
{
|
|
||||||
$subforums[$parent_id][] = $row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
$db->sql_freeresult();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Topic read tracking cookie info
|
// Topic read tracking cookie info
|
||||||
$mark_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_t'])) : array();
|
$mark_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_t'])) : array();
|
||||||
$mark_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_f'])) : array();
|
$mark_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_f'])) : array();
|
||||||
|
@ -331,8 +246,7 @@ $post_alt = (intval($forum_data['forum_status']) == ITEM_LOCKED) ? 'Forum_locked
|
||||||
|
|
||||||
// Basic pagewide vars
|
// Basic pagewide vars
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'FORUM_ID' => $forum_id,
|
'S_IS_POSTABLE' => TRUE,
|
||||||
'FORUM_NAME' => $forum_data['forum_name'],
|
|
||||||
'POST_IMG' => (intval($forum_data['forum_status']) == ITEM_LOCKED) ? $user->img('post_locked', $post_alt) : $user->img('post_new', $post_alt),
|
'POST_IMG' => (intval($forum_data['forum_status']) == ITEM_LOCKED) ? $user->img('post_locked', $post_alt) : $user->img('post_new', $post_alt),
|
||||||
'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&f=$forum_id&topicdays=$topic_days", $topics_count, $config['topics_per_page'], $start),
|
'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&f=$forum_id&topicdays=$topic_days", $topics_count, $config['topics_per_page'], $start),
|
||||||
'PAGE_NUMBER' => sprintf($user->lang['Page_of'], (floor( $start / $config['topics_per_page'] ) + 1), ceil( $topics_count / $config['topics_per_page'] )),
|
'PAGE_NUMBER' => sprintf($user->lang['Page_of'], (floor( $start / $config['topics_per_page'] ) + 1), ceil( $topics_count / $config['topics_per_page'] )),
|
||||||
|
@ -592,6 +506,7 @@ if ($user->data['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
setcookie($config['cookie_name'] . '_t', serialize($mark_topics), 0, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
|
setcookie($config['cookie_name'] . '_t', serialize($mark_topics), 0, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Dump out the page header and load viewforum template
|
// Dump out the page header and load viewforum template
|
||||||
$page_title = $user->lang['View_forum'] . ' - ' . $forum_data['forum_name'];
|
$page_title = $user->lang['View_forum'] . ' - ' . $forum_data['forum_name'];
|
||||||
|
@ -609,8 +524,8 @@ if ($forum_data['left_id'] != $forum_data['right_id'] - 1)
|
||||||
'L_SUBFORUM' => (count($forum_rows) == 1) ? $user->lang['Subforum'] : $user->lang['Subforums']
|
'L_SUBFORUM' => (count($forum_rows) == 1) ? $user->lang['Subforum'] : $user->lang['Subforums']
|
||||||
));
|
));
|
||||||
|
|
||||||
$root_id = $forum_id;
|
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||||
include($phpbb_root_path . 'includes/forums_display.' . $phpEx);
|
display_forums($forum_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue