mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Further layout faffing, nav links for viewtopic (code needs merging with viewforum/posting), moderators for viewtopic
git-svn-id: file:///svn/phpbb/trunk@3063 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
b468fd6e29
commit
c1fc6dce16
8 changed files with 244 additions and 96 deletions
|
@ -80,6 +80,63 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl
|
|||
return $rows;
|
||||
}
|
||||
|
||||
// Create forum navigation links for given forum, create parent
|
||||
// list if currently null, assign basic forum info to template
|
||||
function generate_forum_nav(&$forum_data)
|
||||
{
|
||||
global $db, $user, $template;
|
||||
|
||||
// Get forum parents
|
||||
$forum_parents = array();
|
||||
if ($forum_data['parent_id'] > 0)
|
||||
{
|
||||
if (empty($forum_data['forum_parents']))
|
||||
{
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE left_id < ' . $forum_data['left_id'] . '
|
||||
AND right_id > ' . $forum_data['right_id'] . '
|
||||
ORDER BY left_id ASC';
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_parents[$row['forum_id']] = $row['forum_name'];
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET forum_parents = '" . sql_escape(serialize($forum_parents)) . "'
|
||||
WHERE parent_id = " . $forum_data['parent_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_parents = unserialize($forum_data['forum_parents']);
|
||||
}
|
||||
}
|
||||
|
||||
// Build navigation links
|
||||
foreach ($forum_parents as $parent_forum_id => $parent_name)
|
||||
{
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
'FORUM_NAME' => $parent_name,
|
||||
'U_VIEW_FORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $parent_forum_id
|
||||
));
|
||||
}
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'U_VIEW_FORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id
|
||||
));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'FORUM_ID' => $forum_id,
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_DESC' => strip_tags($forum_data['forum_desc'])
|
||||
));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Obtain list of moderators of each forum
|
||||
function get_moderators(&$forum_moderators, $forum_id = false)
|
||||
{
|
||||
|
|
|
@ -36,15 +36,15 @@ if ( $config['gzip_compress'] )
|
|||
}
|
||||
|
||||
// Generate logged in/logged out status
|
||||
if ( $user->data['user_id'] )
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
$u_login_logout = 'login.'.$phpEx. $SID . '&logout=true';
|
||||
$l_login_logout = $user->lang['Logout'] . ' [ ' . $user->data['username'] . ' ]';
|
||||
$l_login_logout = $user->lang['LOGOUT'] . ' [ ' . $user->data['username'] . ' ]';
|
||||
}
|
||||
else
|
||||
{
|
||||
$u_login_logout = 'login.'.$phpEx . $SID;
|
||||
$l_login_logout = $user->lang['Login'];
|
||||
$l_login_logout = $user->lang['LOGIN'];
|
||||
}
|
||||
|
||||
// Last visit date/time
|
||||
|
@ -248,12 +248,6 @@ if ($user->data['user_id'] != ANONYMOUS)
|
|||
$l_privmsgs_text_unread = $user->lang['No_unread_pm'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_privmsgs_text = $user->lang['Login_check_pm'];
|
||||
$l_privmsgs_text_unread = '';
|
||||
$s_privmsg_new = 0;
|
||||
}
|
||||
|
||||
// Generate HTML required for Mozilla Navigation bar
|
||||
$nav_links_html = '';
|
||||
|
@ -291,12 +285,7 @@ $template->assign_vars(array(
|
|||
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
|
||||
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
|
||||
|
||||
'L_USERNAME' => $user->lang['Username'],
|
||||
'L_PASSWORD' => $user->lang['Password'],
|
||||
'L_LOGIN_LOGOUT' => $l_login_logout,
|
||||
'L_LOGIN' => $user->lang['Login'],
|
||||
'L_LOG_ME_IN' => $user->lang['Log_me_in'],
|
||||
'L_AUTO_LOGIN' => $user->lang['Log_me_in'],
|
||||
'L_INDEX' => $user->lang['Forum_Index'],
|
||||
'L_FAQ' => $user->lang['FAQ'],
|
||||
'L_REGISTER' => $user->lang['Register'],
|
||||
|
@ -305,10 +294,7 @@ $template->assign_vars(array(
|
|||
'L_PRIVATEMSGS' => $user->lang['Private_Messages'],
|
||||
'L_MEMBERLIST' => $user->lang['Memberlist'],
|
||||
'L_USERGROUPS' => $user->lang['Usergroups'],
|
||||
'L_SEARCH_NEW' => $user->lang['Search_new'],
|
||||
'L_SEARCH_SELF' => $user->lang['Search_your_posts'],
|
||||
'L_WHO_IS_ONLINE' => $user->lang['Who_is_Online'],
|
||||
'L_SEARCH_UNANSWERED' => $user->lang['Search_unanswered'],
|
||||
|
||||
'U_PRIVATEMSGS' => 'privmsg.'.$phpEx.$SID.'&folder=inbox',
|
||||
'U_MEMBERLIST' => 'memberlist.'.$phpEx.$SID,
|
||||
|
|
|
@ -47,7 +47,7 @@ if (defined('DEBUG'))
|
|||
|
||||
$template->assign_vars(array(
|
||||
'PHPBB_VERSION' => $config['version'],
|
||||
'ADMIN_LINK' => ($auth->acl_get('a_')) ? '<a href="' . "admin/index.$phpEx?sid=" . $user->data['session_id'] . '">' . $user->lang['Admin_panel'] . '</a><br /><br />' : '',
|
||||
'ADMIN_LINK' => ($auth->acl_get('a_')) ? sprintf($user->lang['ACP'], '<a href="' . "admin/index.$phpEx?sid=" . $user->data['session_id'] . '">', '</a>') . '<br /><br />' : '',
|
||||
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : ''
|
||||
));
|
||||
|
||||
|
|
|
@ -207,6 +207,7 @@ $lang = array_merge($lang, array(
|
|||
'Rules_delete_cannot' => 'You <b>cannot</b> delete your posts in this forum',
|
||||
'Rules_vote_can' => 'You <b>can</b> vote in polls in this forum',
|
||||
'Rules_vote_cannot' => 'You <b>cannot</b> vote in polls in this forum',
|
||||
'ACP' => '[ %sAdministration Control Panel%s ]',
|
||||
'MCP' => '[ %sModerator Control Panel%s ]',
|
||||
'No_topics_post_one' => 'There are no posts in this forum<br />Click on the <b>Post New Topic</b> link on this page to post one',
|
||||
'Stop_watching_forum' => 'Stop watching this forum',
|
||||
|
|
|
@ -2,12 +2,31 @@
|
|||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_FORUM}" title="{FORUM_DESC}">{FORUM_NAME}</a> <br /><span class="gensmall"><!-- IF S_IS_POSTABLE --><b>{L_MODERATORS}: {MODERATORS}</b><!-- ENDIF --><br /><br /><b>{LOGGED_IN_USER_LIST}</b></span></td>
|
||||
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><!-- IF S_IS_POSTABLE -->{MOD_CP}<br /><br /><!-- ENDIF --><br /><b>{PAGINATION}</b></span></td>
|
||||
<td align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_FORUM}" title="{FORUM_DESC}">{FORUM_NAME}</a><br /><!-- IF S_IS_POSTABLE --><span class="gensmall"><b>{L_MODERATORS}: {MODERATORS}</b></span><!-- ENDIF --></td>
|
||||
<td align="right" valign="bottom"><!-- IF S_IS_POSTABLE --><span class="gensmall">{MOD_CP}</span><!-- ENDIF --></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="bottom"><span class="gensmall"><b>{LOGGED_IN_USER_LIST}</b></span></td>
|
||||
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- IF S_HAS_SUBFORUM --><!-- INCLUDE viewforum_subforum.html --><br /><!-- ENDIF -->
|
||||
<!-- if we have subforums output navigational links (for ease of use) and then include the subforum listing, else output the new post image and associated nav links -->
|
||||
<!-- IF S_HAS_SUBFORUM -->
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td class="nav" width="100%" align="left" valign="middle"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a>
|
||||
<!-- BEGIN navlinks -->
|
||||
-> <a class="nav" href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a>
|
||||
<!-- END navlinks -->
|
||||
</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- INCLUDE viewforum_subforum.html -->
|
||||
|
||||
<!-- ELSE -->
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td width="50" align="left" valign="middle"><a href="{U_POST_NEW_TOPIC}"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></a></td>
|
||||
|
@ -16,10 +35,12 @@
|
|||
-> <a class="nav" href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a>
|
||||
<!-- END navlinks -->
|
||||
</span></td>
|
||||
<td class="nav" align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a></span></td>
|
||||
<td class="nav" align="right" valign="bottom" nowrap="nowrap"><!-- IF S_IS_POSTABLE --><span class="gensmall"><a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a></span><!-- ENDIF --></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- if the forum is postable output the viewforum listing -->
|
||||
<!-- IF S_IS_POSTABLE -->
|
||||
<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
|
||||
<tr>
|
||||
|
@ -46,9 +67,9 @@
|
|||
<td class="row1" colspan="8" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td>
|
||||
</tr>
|
||||
<!-- END topicrow -->
|
||||
<tr>
|
||||
<form method="post" action="{S_FORUM_ACTION}"><td class="catBottom" colspan="8" height="28" align="center" valign="middle"><span class="genmed">{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input type="submit" class="liteoption" value="{L_GO}" name="sort" /></span></td></form>
|
||||
</tr>
|
||||
<tr><form method="post" action="{S_FORUM_ACTION}">
|
||||
<td class="catBottom" colspan="8" height="28" align="center" valign="middle"><span class="genmed">{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input type="submit" class="liteoption" value="{L_GO}" name="sort" /></span></td>
|
||||
</form></tr>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
|
@ -68,6 +89,7 @@
|
|||
<td colspan="2"><span class="gensmall">{S_WATCH_FORUM}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
|
@ -75,6 +97,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- IF S_IS_POSTABLE -->
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td align="left" valign="top"><table cellspacing="3" cellpadding="0" border="0">
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<!-- ELSE -->
|
||||
<tr>
|
||||
<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="gen"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a></span><br /><table cellspacing="5" cellpadding="0" border="0"><tr><td><span class="gensmall">{forumrow.FORUM_DESC}</span></td></tr></table><span class="gensmall"><!-- IF forumrow.MODERATORS --><b>{L_MODERATORS}:</b> {forumrow.MODERATORS}<br /><!-- ENDIF --><!-- IF forumrow.SUBFORUMS --><b>{forumrow.L_SUBFORUM}</b> {forumrow.SUBFORUMS}<!-- ENDIF --></span></td>
|
||||
<td class="row1" width="100%" height="50" valign="top"><span class="gen"><a href="{forumrow.U_VIEWFORUM}" class="forumlink">{forumrow.FORUM_NAME}</a></span><br /><table cellspacing="5" cellpadding="0" border="0"><tr><td><span class="gensmall">{forumrow.FORUM_DESC}</span></td></tr></table><span class="gensmall"><!-- IF forumrow.MODERATORS --><b>{L_MODERATORS}:</b> {forumrow.MODERATORS}<br /><!-- ENDIF --><!-- IF forumrow.SUBFORUMS --><br /><b>{forumrow.L_SUBFORUM}</b> {forumrow.SUBFORUMS}<!-- ENDIF --></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" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST}</span></td>
|
||||
|
@ -21,3 +21,24 @@
|
|||
<!-- ENDIF -->
|
||||
<!-- END forumrow -->
|
||||
</table>
|
||||
|
||||
<!-- if the forum is postable then output the post img and associated text, else add a break so the jumpbox isn't squashed right below the forum listing -->
|
||||
<!-- IF S_IS_POSTABLE -->
|
||||
<br />
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td width="50" align="left" valign="middle"><a href="{U_POST_NEW_TOPIC}"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
|
||||
<td class="nav" width="100%" align="left" valign="middle"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
|
||||
<!-- BEGIN navlinks -->
|
||||
-> <a class="nav" href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a>
|
||||
<!-- END navlinks -->
|
||||
</span></td>
|
||||
<td class="nav" align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- ELSE -->
|
||||
|
||||
<br />
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0">
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></span><br /><span class="gensmall">{MOD_CP}</span><br /><br /></td>
|
||||
<td align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></span><br /><span class="gensmall"><b>{L_MODERATORS}: {MODERATORS}</b></span></td>
|
||||
<td align="right" valign="bottom"><span class="gensmall">{MOD_CP}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0">
|
||||
<tr>
|
||||
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a> <a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a></span></td>
|
||||
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
|
||||
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a> <a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a></span></td>
|
||||
<td class="nav" width="100%" align="left" valign="middle"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a><!-- BEGIN navlinks --> -> <a class="nav" href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@ -130,7 +134,7 @@
|
|||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a> <a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a></span></td>
|
||||
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
|
||||
<td class="nav" width="100%" align="left" valign="middle"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a><!-- BEGIN navlinks --> -> <a class="nav" href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></span></td>
|
||||
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -44,15 +44,11 @@ if (isset($_GET['view']) && empty($post_id))
|
|||
{
|
||||
if ($_GET['view'] == 'newest')
|
||||
{
|
||||
if (!empty($_COOKIE[$config['cookie_name'] . '_sid']) || !empty($_GET['sid']))
|
||||
{
|
||||
$session_id = (!empty($_COOKIE[$config['cookie_name'] . '_sid'])) ? $_COOKIE[$config['cookie_name'] . '_sid'] : $_GET['sid'];
|
||||
|
||||
if ($session_id)
|
||||
if ($user->session_id)
|
||||
{
|
||||
$sql = "SELECT p.post_id
|
||||
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
|
||||
WHERE s.session_id = '$session_id'
|
||||
WHERE s.session_id = '$user->session_id'
|
||||
AND u.user_id = s.session_user_id
|
||||
AND p.topic_id = $topic_id
|
||||
AND p.post_approved = 1
|
||||
|
@ -70,7 +66,6 @@ if (isset($_GET['view']) && empty($post_id))
|
|||
$newest_post_id = $post_id;
|
||||
// redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id");
|
||||
}
|
||||
}
|
||||
|
||||
// redirect("index.$phpEx");
|
||||
}
|
||||
|
@ -131,13 +126,18 @@ if ($user->data['user_id'] != ANONYMOUS)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Look at this query ... perhaps a re-think? Perhaps store topic ids rather
|
||||
// than last/first post ids and have a redirect at the top of this page
|
||||
// for latest post, newest post for a given topic_id?
|
||||
|
||||
// This rather complex gaggle of code handles querying for topics but
|
||||
// also allows for direct linking to a post (and the calculation of which
|
||||
// page the post is on and the correct display of viewtopic)
|
||||
$join_sql_table = (!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2 ';
|
||||
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND p.post_approved = " . TRUE . " AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_approved = " . TRUE . " AND p2.post_id <= $post_id";
|
||||
$extra_fields = (!$post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts";
|
||||
$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, f.forum_name, f.forum_status, f.forum_id, f.forum_style ORDER BY p.post_id ASC";
|
||||
$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style ORDER BY p.post_id ASC";
|
||||
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ if ($user->data['user_id'] != ANONYMOUS)
|
|||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_status, f.forum_id, f.forum_style" . $extra_fields . "
|
||||
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style" . $extra_fields . "
|
||||
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
|
||||
WHERE $join_sql
|
||||
AND f.forum_id = t.forum_id
|
||||
|
@ -165,6 +165,9 @@ if (!extract($db->sql_fetchrow($result)))
|
|||
trigger_error('Topic_post_not_exist');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Configure style, language, etc.
|
||||
$user->setup(false, intval($forum_style));
|
||||
$auth->acl($user->data, intval($forum_id));
|
||||
|
@ -184,6 +187,9 @@ if (!$auth->acl_gets('f_read', 'm_', 'a_', intval($forum_id)))
|
|||
}
|
||||
// End auth check
|
||||
|
||||
|
||||
|
||||
|
||||
if (!empty($post_id))
|
||||
{
|
||||
$start = floor(($prev_posts - 1) / $config['posts_per_page']) * $config['posts_per_page'];
|
||||
|
@ -297,9 +303,7 @@ if ($user->data['user_id'] != ANONYMOUS)
|
|||
$rating = '<select name="rating">' . $rating . '</select>';
|
||||
}
|
||||
|
||||
// Was a highlight request part of the URI? Yes, this idea was
|
||||
// taken from vB but we did already have a highlighter in place
|
||||
// in search itself ... it's just been extended a bit!
|
||||
// Was a highlight request part of the URI?
|
||||
$highlight_match = '';
|
||||
if (isset($_GET['highlight']))
|
||||
{
|
||||
|
@ -361,15 +365,67 @@ if (count($orig_word))
|
|||
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Navigation links ... common to several scripts so we need
|
||||
// to look at centralising this ... major issue is variable naming
|
||||
// complicated particularly by viewtopic ...
|
||||
if ($parent_id > 0)
|
||||
{
|
||||
if (empty($forum_parents))
|
||||
{
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE left_id < ' . $left_id . '
|
||||
AND right_id > ' . $right_id . '
|
||||
ORDER BY left_id ASC';
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_parents[$row['forum_id']] = $row['forum_name'];
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET forum_parents = '" . sql_escape(serialize($forum_parents)) . "'
|
||||
WHERE parent_id = " . $parent_id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_parents = unserialize($forum_parents);
|
||||
}
|
||||
}
|
||||
|
||||
// Build navigation links
|
||||
foreach ($forum_parents as $parent_forum_id => $parent_name)
|
||||
{
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
'FORUM_NAME' => $parent_name,
|
||||
'U_VIEW_FORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $parent_forum_id
|
||||
));
|
||||
}
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
'FORUM_NAME' => $forum_name,
|
||||
'U_VIEW_FORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id
|
||||
));
|
||||
|
||||
// Moderators
|
||||
$forum_moderators = array();
|
||||
get_moderators($forum_moderators, $forum_id);
|
||||
|
||||
// Send vars to template
|
||||
$template->assign_vars(array(
|
||||
'FORUM_ID' => $forum_id,
|
||||
'FORUM_NAME' => $forum_name,
|
||||
'FORUM_DESC' => strip_tags($forum_desc),
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'TOPIC_TITLE' => $topic_title,
|
||||
'PAGINATION' => $pagination,
|
||||
'PAGE_NUMBER' => sprintf($user->lang['Page_of'], (floor($start / $config['posts_per_page']) + 1), ceil($topic_replies / $config['posts_per_page'])),
|
||||
'MOD_CP' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? sprintf($user->lang['MCP'], '<a href="modcp.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>') : '',
|
||||
'MODERATORS' => (sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : $user->lang['None'],
|
||||
|
||||
'POST_IMG' => $post_img,
|
||||
'REPLY_IMG' => $reply_img,
|
||||
|
|
Loading…
Add table
Reference in a new issue