diff --git a/phpBB/includes/forums_display.php b/phpBB/includes/forums_display.php new file mode 100644 index 0000000000..cc3bc64820 --- /dev/null +++ b/phpBB/includes/forums_display.php @@ -0,0 +1,168 @@ +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']) . '
'; + + $last_post .= ($user_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '' . $username . ' '; + + $last_post .= '' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . ''; + } + 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 = 'Ashe'; + + $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 + )); + } +} +?> \ No newline at end of file diff --git a/phpBB/templates/subSilver/viewforum_subforum.html b/phpBB/templates/subSilver/viewforum_subforum.html new file mode 100644 index 0000000000..e47df6f5af --- /dev/null +++ b/phpBB/templates/subSilver/viewforum_subforum.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {L_SUBFORUM}  {L_TOPICS}  {L_POSTS}  {L_LASTPOST} 
{forumrow.CAT_NAME} 
{forumrow.FORUM_FOLDER_IMG}{forumrow.FORUM_NAME}
{forumrow.FORUM_DESC}
+ + {forumrow.L_SUBFORUM} {forumrow.SUBFORUMS} + +  
{forumrow.TOPICS}{forumrow.POSTS} {forumrow.LAST_POST}
{forumrow.FORUM_FOLDER_IMG}{forumrow.FORUM_NAME}
{forumrow.FORUM_DESC}
+ + {forumrow.L_SUBFORUM} {forumrow.SUBFORUMS} + +  
{forumrow.TOPICS}{forumrow.POSTS} {forumrow.LAST_POST}
{forumrow.FORUM_FOLDER_IMG}{forumrow.FORUM_NAME}
{forumrow.FORUM_DESC}
+ + {forumrow.L_SUBFORUM} {forumrow.SUBFORUMS} + +  
 
\ No newline at end of file