Ejemplo n.º 1
0
 function ShowError($idortext, $file = null, $line = null)
 {
     if ((int) $idortext == 2) {
         Http404();
     }
     self::$error_id = (int) $idortext;
     self::$error_file = $file;
     self::$error_line = $line;
     if (is_numeric($idortext)) {
         $idortext = $this->lang['error'][$idortext];
     }
     foreach ($GLOBALS['Filter_Plugin_Zbp_ShowError'] as $fpname => &$fpsignal) {
         $fpreturn = $fpname($idortext, $file, $line);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             return $fpreturn;
         }
     }
     throw new Exception($idortext);
 }
Ejemplo n.º 2
0
/**
 * 显示RSS2Feed
 * @api Filter_Plugin_ViewFeed_Begin
 * @return mixed
 */
function ViewFeed()
{
    global $zbp;
    foreach ($GLOBALS['Filter_Plugin_ViewFeed_Begin'] as $fpname => &$fpsignal) {
        $fpreturn = $fpname();
        if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
            $fpsignal = PLUGIN_EXITSIGNAL_NONE;
            return $fpreturn;
        }
    }
    if (!$zbp->CheckRights($GLOBALS['action'])) {
        Http404();
        die;
    }
    $rss2 = new Rss2($zbp->name, $zbp->host, $zbp->subname);
    $articles = $zbp->GetArticleList('*', array(array('=', 'log_Status', 0)), array('log_PostTime' => 'DESC'), $zbp->option['ZC_RSS2_COUNT'], null);
    foreach ($articles as $article) {
        $rss2->addItem($article->Title, $article->Url, $zbp->option['ZC_RSS_EXPORT_WHOLE'] == true ? $article->Content : $article->Intro, $article->PostTime);
    }
    header("Content-type:text/xml; Charset=utf-8");
    echo $rss2->saveXML();
}
Ejemplo n.º 3
0
     if (!$zbp->CheckRights('root')) {
         echo $zbp->ShowError(6, __FILE__, __LINE__);
         die;
     }
     misc_statistic();
     break;
 case 'updateinfo':
     if (!$zbp->CheckRights('root')) {
         echo $zbp->ShowError(6, __FILE__, __LINE__);
         die;
     }
     misc_updateinfo();
     break;
 case 'showtags':
     if (!$zbp->CheckRights('ArticleEdt')) {
         Http404();
         die;
     }
     misc_showtags();
     break;
 case 'vrs':
     if (!$zbp->CheckRights('misc')) {
         $zbp->ShowError(6, __FILE__, __LINE__);
     }
     misc_viewrights();
     break;
 case 'phpinfo':
     if (!$zbp->CheckRights('root')) {
         echo $zbp->ShowError(6, __FILE__, __LINE__);
         die;
     }
Ejemplo n.º 4
0
 /**
  * 显示错误信息
  * @api Filter_Plugin_Zbp_ShowError
  * @param string/int $errorText
  * @param null $file
  * @param null $line
  * @return mixed
  * @throws Exception
  */
 public function ShowError($errorText, $file = null, $line = null)
 {
     $errorCode = 0;
     if (is_numeric($errorText)) {
         $errorCode = (int) $errorText;
         $errorText = $this->lang['error'][$errorText];
     }
     if ($errorCode == 2) {
         Http404();
     }
     ZBlogException::$error_id = $errorCode;
     ZBlogException::$error_file = $file;
     ZBlogException::$error_line = $line;
     foreach ($GLOBALS['hooks']['Filter_Plugin_Zbp_ShowError'] as $fpname => &$fpsignal) {
         $fpsignal = PLUGIN_EXITSIGNAL_NONE;
         $fpreturn = $fpname($errorCode, $errorText, $file, $line);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             return $fpreturn;
         }
     }
     throw new Exception($errorText);
 }