Esempio n. 1
0
    //								'L_MODERATOR' => $l_moderators,
    //								'L_FORUM_FOLDER_ALT' => $folder_alt,
    //
    //								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
    //							);
    //						}
    //					}
    //				}
    //			}
    //		}
    //	} // for ... categories
    $max_depth = !$sub_forum ? get_max_depth($viewcat) : 0;
    $template->assign_vars(array('INC_SPAN' => $max_depth + 2));
    enhance_cat($viewcat);
    // display the index
    $found = false;
    for ($i = 0; $i < $total_categories && !$found; $i++) {
        if ($viewcat == -1 && $category_rows[$i]['cat_main'] == 0 || $viewcat > 0 && $category_rows[$i]['cat_id'] == $viewcat) {
            display_index_cat($category_rows[$i], $sub_forum, true);
            $found = $viewcat > 0;
        }
    }
    // End PNphpBB2 Categories Hierarchie Mod
} else {
    message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Generate the page
//
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
Esempio n. 2
0
function display_index_cat($catrow, $sub_forum, $main, $cur_depth = 0)
{
    global $total_categories, $category_rows, $total_forums, $forum_data, $forum_moderators, $images, $lang, $template, $phpEx;
    global $max_depth;
    if ($sub_forum) {
        $cur_depth = 0;
    }
    $cat_id = $catrow['cat_id'];
    if ($catrow['cat_display']) {
        // display cat title
        // Begin PNphpBB2 Module
        //		$class_catLeft = "catLeft";
        // 		$class_catLeft = "cat";
        // End PNphpBB2 Module
        // 		$class_rowpic  = "rowpic";
        //		if (!$sub_forum && $main)
        //		{
        //			$class_catLeft = "catRupt";
        //			$class_rowpic  = "catRupt";
        //		}
        $template->assign_block_vars('catrow', array('INC_SPAN' => $max_depth - $cur_depth + 2, 'CAT_ID' => $cat_id, 'CAT_DESC' => $catrow['cat_title'], 'U_VIEWCAT' => append_sid("index.{$phpEx}?" . POST_CAT_URL . "={$cat_id}")));
        $color = true;
        $inc_row = true;
        for ($k = 0; $k < $cur_depth; $k++) {
            $template->assign_block_vars('catrow.inc', array('INC_ROW' => $inc_row ? "row1" : "row2"));
            $inc_row = !$inc_row;
        }
        // display forums
        for ($j = 0; $j < $total_forums; $j++) {
            if ($forum_data[$j]['cat_id'] == $cat_id && $forum_data[$j]['display_forum']) {
                $forum_id = $forum_data[$j]['forum_id'];
                $folder_image = $forum_data[$j]['unread_topics'] ? $images['forum_new'] : $images['forum'];
                $folder_alt = $forum_data[$j]['unread_topics'] ? $lang['New_posts'] : $lang['No_new_posts'];
                if ($forum_data[$j]['forum_status'] == FORUM_LOCKED) {
                    $folder_image = $images['forum_locked'];
                    $folder_alt = $lang['Forum_locked'];
                }
                $l_moderators = '&nbsp;';
                $moderator_list = '&nbsp;';
                if (count($forum_moderators[$forum_id]) > 0) {
                    $l_moderators = count($forum_moderators[$forum_id]) == 1 ? $lang['Moderator'] : $lang['Moderators'];
                    $moderator_list = implode(', ', $forum_moderators[$forum_id]);
                }
                // Begin PNphpBB2 Module
                $row_color = $color ? $phpbb_theme['td_color1'] : $phpbb_theme['td_color2'];
                $row_class = $color ? $phpbb_theme['td_class1'] : $phpbb_theme['td_class2'];
                // End PNphpBB2 Module
                $color = !$color;
                $odd = $sub_forum || intval($cur_depth / 2) == $cur_depth / 2;
                $template->assign_block_vars('catrow.forumrow', array('INC_SPAN' => $max_depth - $cur_depth + 1, 'INC_ROW' => $odd ? "row1" : "row2", 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FORUM_FOLDER_IMG' => $folder_image, 'FORUM_NAME' => $forum_data[$j]['forum_name'], 'FORUM_DESC' => $forum_data[$j]['forum_desc'], 'POSTS' => $forum_data[$j]['forum_posts'], 'TOPICS' => $forum_data[$j]['forum_topics'], 'LAST_POST' => $forum_data[$j]['last_post'], 'MODERATORS' => $moderator_list, 'L_MODERATOR' => $l_moderators, 'L_FORUM_FOLDER_ALT' => $folder_alt, 'U_VIEWFORUM' => append_sid("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}")));
                $inc_row = true;
                for ($k = 0; $k < $cur_depth; $k++) {
                    $template->assign_block_vars('catrow.forumrow.inc', array('INC_ROW' => $inc_row ? "row1" : "row2"));
                    $inc_row = !$inc_row;
                }
            }
            //  if ( ($forum_data[$j]['cat_id']==$cat_id) && $forum_data[$j]['display_forum'] )
        }
        //  for($j = 0; $j < $total_forums; $j++)
        // display sub-cat title
        for ($j = 0; $j < $total_categories; $j++) {
            if ($category_rows[$j]['cat_main'] == $cat_id && $category_rows[$j]['cat_display']) {
                if (!$sub_forum) {
                    display_index_cat($category_rows[$j], $sub_forum, false, $cur_depth + 1);
                }
                if ($sub_forum) {
                    $subcat_id = $category_rows[$j]['cat_id'];
                    $folder_image = $category_rows[$j]['unread_topics'] ? $images['category_new'] : $images['category'];
                    $folder_alt = $category_rows[$j]['unread_topics'] ? $lang['New_posts'] : $lang['No_new_posts'];
                    if ($category_rows[$j]['cat_locked']) {
                        $folder_image = $images['category_locked'];
                        $folder_alt = $lang['Forum_locked'];
                    }
                    // Begin PNphpBB2 Module
                    $row_color = $color ? $phpbb_theme['td_color1'] : $phpbb_theme['td_color2'];
                    $row_class = $color ? $phpbb_theme['td_class1'] : $phpbb_theme['td_class2'];
                    // End PNphpBB2 Module
                    $color = !$color;
                    $template->assign_block_vars('catrow.forumrow', array('INC_ROW' => "row1", 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FORUM_FOLDER_IMG' => $folder_image, 'FORUM_NAME' => $category_rows[$j]['cat_title'], 'FORUM_DESC' => $category_rows[$j]['cat_desc'], 'POSTS' => $category_rows[$j]['posts'], 'TOPICS' => $category_rows[$j]['topics'], 'LAST_POST' => $category_rows[$j]['last_post'], 'MODERATORS' => "", 'L_MODERATOR' => "", 'L_FORUM_FOLDER_ALT' => $folder_alt, 'U_VIEWFORUM' => append_sid("index.{$phpEx}?" . POST_CAT_URL . "={$subcat_id}")));
                }
                //  if ($sub_forum)
            }
            //  if ($category_rows[$j]['cat_main']==$cat_id)
        }
        // for ($j=0; $j < $total_categories; $j++)
    }
    //  if ($catrow['cat_display'])
}