当前位置: 首页>>代码示例>>PHP>>正文


PHP News::GetAllNews方法代码示例

本文整理汇总了PHP中News::GetAllNews方法的典型用法代码示例。如果您正苦于以下问题:PHP News::GetAllNews方法的具体用法?PHP News::GetAllNews怎么用?PHP News::GetAllNews使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在News的用法示例。


在下文中一共展示了News::GetAllNews方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

                     $Smarty->display('pages/game_event_data');
                 }
             }
         }
     }
     break;
 case 'blog':
     if (Text::IsNull($_REQUEST['subcategory'])) {
         header('Location: /');
     } else {
         Manager::LoadExtension('News', $ClassConstructor);
         $Article = News::GetArticle($_REQUEST['subcategory']);
         if ($Article == null) {
             header('Location: /');
         } else {
             $Smarty->assign('Articles', News::GetAllNews());
             $Smarty->assign('Article', $Article);
             $Smarty->assign('Page', Page::Info('blog', array('bodycss' => 'blog-article news', 'pagetitle' => $Article['title'] . ' - ')));
             $Smarty->display('blog');
         }
     }
     break;
 case 'community':
     if (Text::IsNull($_REQUEST['subcategory'])) {
         $Smarty->assign('Page', Page::Info('community', array('bodycss' => 'community-home', 'pagetitle' => $Smarty->GetConfigVars('Menu_Community') . ' - ')));
         $Smarty->display('community');
     } else {
         switch ($_REQUEST['subcategory']) {
             case 'status':
                 Manager::LoadExtension('Realms', $ClassConstructor);
                 $Smarty->assign('Realms', Realms::GetAllRealms());
开发者ID:Expecto,项目名称:FreedomCore,代码行数:31,代码来源:pager.php

示例2: array

<?php

require_once 'Core/Core.php';
Manager::LoadExtension('News', array($Database, $Smarty));
$Smarty->assign('Slideshow', News::GetSlideshowItems());
$Smarty->assign('News', News::GetAllNews());
$Smarty->assign('Page', Page::Info('homepage', array('bodycss' => 'homepage news', 'pagetitle' => '')));
$Smarty->display('main');
开发者ID:anonymous33rus,项目名称:FreedomCore,代码行数:8,代码来源:index.php

示例3: UpdateFeeds

 /**
  *  Updates Feeds
  */
 public static function UpdateFeeds()
 {
     global $objSettings, $objSiteDescription;
     $default_lang = Languages::GetDefaultLang();
     $current_rss_ids = $objSettings->GetParameter('rss_last_ids');
     $rss_ids = '';
     self::SetType($objSettings->GetParameter('rss_feed_type'));
     self::SetChannel(APPHP_BASE . 'feeds/rss.xml', $objSiteDescription->GetParameter('header_text'), $objSiteDescription->GetParameter('tag_description'), 'en-us', '(c) copyright', $objSettings->GetParameter('admin_email'), $objSiteDescription->GetParameter('tag_description'));
     self::SetImage(APPHP_BASE . 'images/icons/logo.png');
     $all_news = News::GetAllNews('previous', $default_lang);
     for ($i = 0; $i < $all_news[1] && $i < 10; $i++) {
         $rss_ids .= ($i > 0 ? '-' : '') . $all_news[0][$i]['id'];
     }
     // check if there difference between RSS IDs, so we have to update RSS file
     if ($current_rss_ids != $rss_ids) {
         for ($i = 0; $i < $all_news[1] && $i < 10; $i++) {
             $rss_text = RSSFeed::CleanTextRss(strip_tags($all_news[0][$i]['body_text']));
             if (strlen($rss_text) > 512) {
                 $rss_text = substr_by_word($rss_text, 512) . '...';
             }
             #$rss_text = htmlentities($post_text, ENT_COMPAT, 'UTF-8');
             self::SetItem(APPHP_BASE . 'index.php?page=news&nid=' . $all_news[0][$i]['id'], $all_news[0][$i]['header_text'], $rss_text, $all_news[0][$i]['date_created']);
         }
         $objSettings->UpdateFields(array('rss_last_ids' => $rss_ids));
     }
     return self::SaveFeed();
 }
开发者ID:mozdial,项目名称:Directory,代码行数:30,代码来源:RSSFeed.class.php

示例4: Template

if (!@(require "Config/Main.php")) {
    die;
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/News.tpl.php")) {
    $tpl = new Template();
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/MuDatabase.class.php";
    $db = new MuDatabase();
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/News.class.php";
    $new = new News();
    if (substr_count($_GET['c'], "/") > 0) {
        $my_url = explode("/", $_GET['c']);
        $action = $my_url[1];
    } else {
        $action = false;
    }
    if ($action) {
        if (is_numeric($action)) {
            $my_array['News'] = $new->ShowThisNew($db, "modules/ShowNew.tpl.php", $action);
        } else {
            $my_array['News'] = "";
        }
    } else {
        //Listar noticias
        $my_array['News'] = $new->GetAllNews($db, "modules/News.tpl.php");
    }
    $db->Disconnect();
    $tpl->Assign($my_array);
    $tpl->Display($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/News.tpl.php");
} else {
    echo "ERROR: File Templates/{$MainTemplate}/News.tpl.php doesnt exists";
}
开发者ID:BieeeLC,项目名称:OpenWeb,代码行数:31,代码来源:News.php


注:本文中的News::GetAllNews方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。