mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Subforums handling part 2, new files.
git-svn-id: file:///svn/phpbb/trunk@2914 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
268d936f46
commit
2d99854ce8
2 changed files with 223 additions and 0 deletions
168
phpBB/includes/forums_display.php
Normal file
168
phpBB/includes/forums_display.php
Normal file
|
@ -0,0 +1,168 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* display_forums.php
|
||||
* ------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
foreach ($forum_rows as $row)
|
||||
{
|
||||
extract($row);
|
||||
if ($parent_id == $root_id)
|
||||
{
|
||||
if ($forum_status == ITEM_CATEGORY)
|
||||
{
|
||||
$stored_cat = $row;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($stored_cat);
|
||||
}
|
||||
}
|
||||
elseif (!empty($stored_cat))
|
||||
{
|
||||
$template->assign_block_vars('forumrow', array(
|
||||
'S_IS_CAT' => TRUE,
|
||||
'CAT_ID' => $stored_cat['forum_id'],
|
||||
'CAT_NAME' => $stored_cat['forum_name'],
|
||||
'U_VIEWCAT' => 'index.' . $phpEx . $SID . '&c=' . $stored_cat['forum_id']
|
||||
));
|
||||
unset($stored_cat);
|
||||
}
|
||||
|
||||
if ($acl->get_acl($forum_id, 'forum', 'list'))
|
||||
{
|
||||
switch ($forum_status)
|
||||
{
|
||||
case ITEM_CATEGORY:
|
||||
$folder_image = $theme['forum_locked'];
|
||||
$folder_alt = $lang['Category'];
|
||||
break;
|
||||
|
||||
case ITEM_LOCKED:
|
||||
$folder_image = $theme['forum_locked'];
|
||||
$folder_alt = $lang['Forum_locked'];
|
||||
break;
|
||||
|
||||
default:
|
||||
$unread_topics = false;
|
||||
if ($userdata['user_id'] && $forum_last_post_time > $userdata['user_lastvisit'])
|
||||
{
|
||||
$unread_topics = true;
|
||||
if (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']))
|
||||
{
|
||||
if ($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time)
|
||||
{
|
||||
$unread_topics = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id]))
|
||||
{
|
||||
if ($mark_forums[$forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$forum_id]))
|
||||
{
|
||||
$unread_topics = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$folder_image = ($unread_topics) ? $theme['forum_new'] : $theme['forum'];
|
||||
$folder_alt = ($unread_topics) ? $lang['New_posts'] : $lang['No_new_posts'];
|
||||
}
|
||||
|
||||
if ($forum_last_post_id)
|
||||
{
|
||||
$last_post = create_date($board_config['default_dateformat'], $forum_last_post_time, $board_config['board_timezone']) . '<br />';
|
||||
|
||||
$last_post .= ($user_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '<a href="profile.' . $phpEx . $SID . '&mode=viewprofile&u=' . $user_id . '">' . $username . '</a> ';
|
||||
|
||||
$last_post .= '<a href="viewtopic.' . $phpEx . '$SID&f=' . $forum_id . '&p=' . $forum_last_post_id . '#' . $forum_last_post_id . '">' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_post = $lang['No_Posts'];
|
||||
}
|
||||
|
||||
if (!empty($forum_moderators[$forum_id]))
|
||||
{
|
||||
$l_moderator = (count($forum_moderators[$forum_id]) == 1) ? $lang['Moderator'] . ': ' : $lang['Moderators'] . ': ' ;
|
||||
$moderators_list = implode(', ', $forum_moderators[$forum_id]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_moderator = ' ';
|
||||
$moderators_list = ' ';
|
||||
}
|
||||
|
||||
if (isset($subforums[$forum_id]))
|
||||
{
|
||||
$subforums_list = format_subforums_list($subforums[$forum_id]);
|
||||
$l_subforums = (count($subforums[$forum_id]) == 1) ? $lang['Subforum'] . ': ' : $lang['Subforums'] . ': ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$subforums_list = '';
|
||||
$l_subforums = '';
|
||||
}
|
||||
|
||||
switch ($forum_status)
|
||||
{
|
||||
case ITEM_CATEGORY:
|
||||
$forum_link = 'index.' . $phpEx . $SID . '&c=' . $forum_id;
|
||||
$forum_type_switch = 'S_IS_SUBCAT';
|
||||
break;
|
||||
|
||||
default:
|
||||
$forum_link = 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id;
|
||||
if ($parent_id == $root_id)
|
||||
{
|
||||
$forum_type_switch = 'S_IS_ROOTFORUM';
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_type_switch = 'S_IS_FORUM';
|
||||
}
|
||||
}
|
||||
|
||||
$l_moderator = 'Moderator: ';
|
||||
$moderators_list = '<a href="#">Ashe</a>';
|
||||
|
||||
$template->assign_block_vars('forumrow', array(
|
||||
$forum_type_switch => TRUE,
|
||||
|
||||
'FORUM_FOLDER_IMG' => create_img($folder_image, $folder_alt),
|
||||
'FORUM_NAME' => $forum_name,
|
||||
'FORUM_DESC' => $forum_desc,
|
||||
|
||||
'POSTS' => $forum_posts,
|
||||
'TOPICS' => $forum_topics,
|
||||
'LAST_POST' => $last_post,
|
||||
'MODERATORS' => $moderators_list,
|
||||
'SUBFORUMS' => $subforums_list,
|
||||
|
||||
'FORUM_IMG' => $forum_image,
|
||||
|
||||
'L_SUBFORUM' => $l_subforums,
|
||||
'L_MODERATOR' => $l_moderator,
|
||||
'L_FORUM_FOLDER_ALT'=> $folder_alt,
|
||||
|
||||
'U_VIEWFORUM' => $forum_link
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
55
phpBB/templates/subSilver/viewforum_subforum.html
Normal file
55
phpBB/templates/subSilver/viewforum_subforum.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
<table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0">
|
||||
<tr>
|
||||
<th class="thCornerL" colspan="3" height="25" nowrap="nowrap"> {L_SUBFORUM} </th>
|
||||
<th class="thTop" width="50" nowrap="nowrap"> {L_TOPICS} </th>
|
||||
<th class="thTop" width="50" nowrap="nowrap"> {L_POSTS} </th>
|
||||
<th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
|
||||
</tr>
|
||||
<!-- BEGIN forumrow -->
|
||||
<!-- IF forumrow.S_IS_CAT -->
|
||||
<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="rowpic" colspan="3" align="right"> </td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- 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>
|
||||
</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="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_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>
|
||||
<!-- ENDIF -->
|
||||
<!-- END forumrow -->
|
||||
</table>
|
Loading…
Add table
Reference in a new issue