Beispiel #1
0
<?php

/**
 * Z-Blog with PHP
 * @author 
 * @copyright (C) RainbowSoft Studio
 * @version
 */
require './zb_system/function/c_system_base.php';
zbp_index_redirect_install();
$zbp->Load();
foreach ($GLOBALS['Filter_Plugin_Index_Begin'] as $fpname => &$fpsignal) {
    $fpname();
}
$url = GetRequestUri();
if ($url == $cookiespath || $url == $cookiespath . 'index.php') {
    ViewList(null, null, null, null, null);
} elseif (isset($_GET['id']) || isset($_GET['alias'])) {
    ViewPost(GetVars('id', 'GET'), GetVars('alias', 'GET'));
} elseif (isset($_GET['page']) || isset($_GET['cate']) || isset($_GET['auth']) || isset($_GET['date']) || isset($_GET['tags'])) {
    ViewList(GetVars('page', 'GET'), GetVars('cate', 'GET'), GetVars('auth', 'GET'), GetVars('date', 'GET'), GetVars('tags', 'GET'));
} else {
    ViewAuto($url);
}
foreach ($GLOBALS['Filter_Plugin_Index_End'] as $fpname => &$fpsignal) {
    $fpname();
}
RunTime();
Beispiel #2
0
/**
 * ViewIndex,首页,搜索页,feed页的主函数
 * @api Filter_Plugin_ViewIndex_Begin
 * @return mixed
 */
function ViewIndex()
{
    global $zbp, $action;
    foreach ($GLOBALS['Filter_Plugin_ViewIndex_Begin'] as $fpname => &$fpsignal) {
        $fpreturn = $fpname();
        if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
            $fpsignal = PLUGIN_EXITSIGNAL_NONE;
            return $fpreturn;
        }
    }
    switch ($action) {
        case 'feed':
            ViewFeed();
            break;
        case 'search':
            ViewSearch();
            break;
        case '':
        default:
            if ($zbp->currenturl == $zbp->cookiespath || $zbp->currenturl == $zbp->cookiespath . 'index.php') {
                ViewList(null, null, null, null, null);
            } elseif (($zbp->option['ZC_STATIC_MODE'] == 'ACTIVE' || isset($_GET['rewrite'])) && (isset($_GET['id']) || isset($_GET['alias']))) {
                ViewPost(GetVars('id', 'GET'), GetVars('alias', 'GET'));
            } elseif (($zbp->option['ZC_STATIC_MODE'] == 'ACTIVE' || isset($_GET['rewrite'])) && (isset($_GET['page']) || isset($_GET['cate']) || isset($_GET['auth']) || isset($_GET['date']) || isset($_GET['tags']))) {
                ViewList(GetVars('page', 'GET'), GetVars('cate', 'GET'), GetVars('auth', 'GET'), GetVars('date', 'GET'), GetVars('tags', 'GET'));
            } else {
                ViewAuto($zbp->currenturl);
            }
    }
}