예제 #1
0
    $catarray[] = $cat;
}
foreach ($catarray as $cat) {
    // check how many content is in this cat
    $should_be = $cat->calc_content_amount();
    if ($should_be != $cat->get_content_amount()) {
        $missmatch['type'] = CONTENT_IN_CAT_AMOUNT;
        $missmatch['id'] = $cat->id;
        $missmatch['name'] = $cat->get_name();
        $missmatch['value'] = $cat->get_content_amount();
        $missmatch['should_be'] = $should_be;
        $missmatch_array[] = $missmatch;
    }
    // check child_content_amount
    $calc_child_content_amount = $cat->calc_child_content_amount();
    if ($calc_child_content_amount != $cat->get_child_content_amount()) {
        $missmatch['type'] = CHILD_CONTENT_IN_CAT_AMOUNT;
        $missmatch['id'] = $cat->id;
        $missmatch['name'] = $cat->get_name();
        $missmatch['value'] = $cat->get_child_content_amount();
        $missmatch['should_be'] = $calc_child_content_amount;
        $missmatch_array[] = $missmatch;
    }
    // check child comment amount
    $calc_child_comments_amount = $cat->calc_child_comments_amount();
    if ($calc_child_comments_amount != $cat->get_child_comments_amount()) {
        $missmatch['type'] = CHILD_COMMENTS_IN_CAT_AMOUNT;
        $missmatch['id'] = $cat->id;
        $missmatch['name'] = $cat->get_name();
        $missmatch['value'] = $cat->get_child_comments_amount();
        $missmatch['should_be'] = $calc_child_comments_amount;
예제 #2
0
$smarty->template_dir = ROOT_PATH . 'templates/';
$smarty->compile_dir = ROOT_PATH . 'templates_c/';
$smarty->config_dir = ROOT_PATH . 'templates/';
$smarty->cache_dir = ROOT_PATH . 'smarty_cache/';
$smarty->left_delimiter = '<!--{';
$smarty->right_delimiter = '}-->';
$smarty->force_compile = '0';
$smarty->debugging = false;
//$smarty->debug_tpl = SMARTY_DIR.'debug.tpl';
//this vars are needed on every page
$smarty->assign('title_site', $board_config['sitename']);
//this vars are needed in view_cat AND view_content
$smarty->assign('lang', $lang);
$smarty->assign('phpbb_path', ROOT_PATH . PHPBB_PATH);
$smarty->assign('server_name', SERVER_NAME);
$smarty->assign('template_name', $userdata['photo_user_template']);
$smarty->assign('sid', '&sid=' . $userdata['session_id']);
$smarty->assign('username', $userdata['username']);
$smarty->assign('user_id', $userdata['user_id']);
//set if the actual user is admin or not
if ($userdata['user_level'] == 1) {
    $smarty->assign('user_level', 'admin');
} else {
    $smarty->assign('user_level', 'user');
}
// get statistics data
$root_cat = new categorie();
$root_cat->generate_from_id($config_vars['root_categorie']);
$smarty->assign('total_content', $root_cat->get_child_content_amount());
$smarty->assign('total_comments', $root_cat->get_child_comments_amount());
$smarty->assign('root_path', ROOT_PATH);