Esempio n. 1
0
function admin_menu_list($return = false)
{
    global $auth, $admin_pages;
    $output = '<ul class="nav nav-list">';
    foreach ($admin_pages as $slug_name => $atts) {
        if ($auth->has_perm($atts['capability'])) {
            $page_url = generate_page_url($slug_name, false, false, true);
            $output .= '<li class="nav-header"><a href="' . $page_url . '">' . $atts['menu_title'] . '</a></li>';
            if (isset($atts['subpages']) && sizeof($atts['subpages'])) {
                foreach ($atts['subpages'] as $sub_slug_name => $sub_atts) {
                    if ($auth->has_perm($sub_atts['capability'])) {
                        $subpage_url = generate_page_url($slug_name, $sub_slug_name, false, true);
                        $output .= '<li><a href="' . $subpage_url . '">' . $sub_atts['menu_title'] . '</a></li>';
                    }
                }
            }
        }
    }
    $output .= '</ul>';
    if ($return) {
        return $output;
    }
    echo $output;
}
Esempio n. 2
0
function get_new_category_uri()
{
    global $page, $subpage;
    generate_page_url($page, $subpage);
}
Esempio n. 3
0
                     continue;
                 }
             }
         }
         $mn_page_int = $read_page_id;
     }
     if (file_exists(MN_ROOT . $dir['pages'] . 'page_' . $mn_page_int . '.php')) {
         $page = get_page_data($mn_page_int);
         if (isset($page['pass']) && !empty($page['pass'])) {
             if (isset($_GET['mn_key']) && $_GET['mn_key'] == substr(md5(substr($page['pass'], 1, 22) . $page['id'] . date('d.m.Y')), 6, 9) || isset($_POST['mn_pagepass']) && $page['pass'] == sha1($_POST['mn_pagepass'])) {
                 $page_tmpl = isset($mn_tmpl) && file_exists(MN_ROOT . $dir['templates'] . $mn_tmpl . '_11.html') ? $mn_tmpl : DEFAULT_TMPL;
                 $page_result = page_tmpl($mn_page_int, $page_tmpl . '_11', $mn_url);
                 echo encoding($page_result);
             } else {
                 $page_result = '<p>' . $lang['web_page_password'] . ':</p>';
                 $page_result .= '<form action="' . generate_page_url($mn_url, $page) . '" method="post"><input type="password" name="mn_pagepass" /> <input type="submit" value="vstúpiť" /></form>';
                 echo encoding($page_result);
             }
         } else {
             $page_tmpl = isset($mn_tmpl) && file_exists(MN_ROOT . $dir['templates'] . $mn_tmpl . '_11.html') ? $mn_tmpl : DEFAULT_TMPL;
             $page_result = page_tmpl($mn_page_int, $page_tmpl . '_11', $mn_url);
             echo encoding($page_result);
         }
     }
     echo '<!-- Powered by MNews: www.mnewscms.com -->';
 } elseif (isset($_GET['mn_user']) && !empty($_GET['mn_user']) && !empty($mn_users[$_GET['mn_user']]) && (!isset($mn_lock) || $mn_lock == 'user')) {
     $user_tmpl = isset($mn_tmpl) && file_exists(MN_ROOT . $dir['templates'] . $mn_tmpl . '_13.html') ? $mn_tmpl : DEFAULT_TMPL;
     $user_result = user_tmpl($_GET['mn_user'], $user_tmpl . '_13', $mn_url);
     echo encoding($user_result);
     echo '<!-- Powered by MNews: www.mnewscms.com -->';
 } elseif (file_exists(MN_ROOT . $file['posts'])) {
Esempio n. 4
0
function split_allkeys_on_pages()
{
    global $allkeys, $min_keys, $max_keys, $dor_type;
    $pages = 0;
    while (list($a, $curr_key) = each($allkeys)) {
        //Получения числа кеев для текущей страницы
        $n_keys = min(mt_rand($min_keys, $max_keys), count($allkeys));
        $page_url = generate_page_url($curr_key, $pages, $dor_type);
        $string = $page_url . '||' . $curr_key;
        for ($j = 0; $j < $n_keys - 1; $j++) {
            $pg_key = array_shift($allkeys);
            $string .= '|' . $pg_key;
        }
        $dor_pages[] = $string;
        //массив страниц дора в виде: url||key1|key2|key3
        unset($string);
        $pages = $pages + 1;
    }
    unset($pg_key, $page_url, $j, $curr_key, $pages, $string, $a);
    return $dor_pages;
}