• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP RSSFeed类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中RSSFeed的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed类的具体用法?PHP RSSFeed怎么用?PHP RSSFeed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: testRSSFeed

 function testRSSFeed()
 {
     $list = new DataObjectSet();
     $list->push(new RSSFeedTest_ItemA());
     $list->push(new RSSFeedTest_ItemB());
     $list->push(new RSSFeedTest_ItemC());
     $origServer = $_SERVER;
     $_SERVER['HTTP_HOST'] = 'www.example.org';
     Director::setBaseURL('/');
     $rssFeed = new RSSFeed($list, "http://www.example.com", "Test RSS Feed", "Test RSS Feed Description");
     $content = $rssFeed->feedContent();
     //Debug::message($content);
     $this->assertContains('<link>http://www.example.org/item-a/</link>', $content);
     $this->assertContains('<link>http://www.example.com/item-b.html</link>', $content);
     $this->assertContains('<link>http://www.example.com/item-c.html</link>', $content);
     $this->assertContains('<title>ItemA</title>', $content);
     $this->assertContains('<title>ItemB</title>', $content);
     $this->assertContains('<title>ItemC</title>', $content);
     $this->assertContains('<description>ItemA Content</description>', $content);
     $this->assertContains('<description>ItemB Content</description>', $content);
     $this->assertContains('<description>ItemC Content</description>', $content);
     // Feed #2 - put Content() into <title> and AltContent() into <description>
     $rssFeed = new RSSFeed($list, "http://www.example.com", "Test RSS Feed", "Test RSS Feed Description", "Content", "AltContent");
     $content = $rssFeed->feedContent();
     $this->assertContains('<title>ItemA Content</title>', $content);
     $this->assertContains('<title>ItemB Content</title>', $content);
     $this->assertContains('<title>ItemC Content</title>', $content);
     $this->assertContains('<description>ItemA AltContent</description>', $content);
     $this->assertContains('<description>ItemB AltContent</description>', $content);
     $this->assertContains('<description>ItemC AltContent</description>', $content);
     Director::setBaseURL(null);
     $_SERVER = $origServer;
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:33,代码来源:RSSFeedTest.php


示例2: rss

 /**
  * Return an RSS feed of comments for a given set of comments or all 
  * comments on the website.
  *
  * To maintain backwards compatibility with 2.4 this supports mapping
  * of PageComment/rss?pageid= as well as the new RSS format for comments
  * of CommentingController/rss/{classname}/{id}
  *
  * @return RSS
  */
 public function rss()
 {
     $link = $this->Link('rss');
     $class = $this->urlParams['ID'];
     $id = $this->urlParams['OtherID'];
     if (isset($_GET['pageid'])) {
         $id = Convert::raw2sql($_GET['pageid']);
         $comments = Comment::get()->where(sprintf("BaseClass = 'SiteTree' AND ParentID = '%s' AND Moderated = 1 AND IsSpam = 0", $id));
         $link = $this->Link('rss', 'SiteTree', $id);
     } else {
         if ($class && $id) {
             if (Commenting::has_commenting($class)) {
                 $comments = Comment::get()->where(sprintf("BaseClass = '%s' AND ParentID = '%s' AND Moderated = 1 AND IsSpam = 0", Convert::raw2sql($class), Convert::raw2sql($id)));
                 $link = $this->Link('rss', Convert::raw2xml($class), (int) $id);
             } else {
                 return $this->httpError(404);
             }
         } else {
             if ($class) {
                 if (Commenting::has_commenting($class)) {
                     $comments = Comment::get()->where(sprintf("BaseClass = '%s' AND Moderated = 1 AND IsSpam = 0", Convert::raw2sql($class)));
                 } else {
                     return $this->httpError(404);
                 }
             } else {
                 $comments = Comment::get();
             }
         }
     }
     $title = _t('CommentingController.RSSTITLE', "Comments RSS Feed");
     $feed = new RSSFeed($comments, $link, $title, $link, 'Title', 'Comment', 'AuthorName');
     $feed->outputToBrowser();
 }
开发者ID:roed,项目名称:silverstripe-comments,代码行数:43,代码来源:CommentingController.php


示例3: rss

 function rss()
 {
     $request = Controller::curr()->getRequest();
     $foundation = $request->requestVar('foundation');
     $jobs = $this->repository->getDateSortedJobs($foundation);
     $rss = new RSSFeed($jobs, $this->Link(), "OpenStack Jobs Feed");
     $rss->outputToBrowser();
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:8,代码来源:JobHolder.php


示例4: rss

 public function rss()
 {
     $config = SiteConfig::current_site_config();
     // Creates a new RSS Feed list
     $rss = new RSSFeed($list = NewsArticle::get(), $link = $this->Link("rss"), $title = $config->Title . " News", $description = "All the latest news from " . $config->Title . ".");
     // Outputs the RSS feed to the user.
     return $rss->outputToBrowser();
 }
开发者ID:helpfulrobot,项目名称:purplespider-basic-news,代码行数:8,代码来源:NewsHolder.php


示例5: testRenderWithTemplate

 public function testRenderWithTemplate()
 {
     $rssFeed = new RSSFeed(new ArrayList(), "", "", "");
     $rssFeed->setTemplate('RSSFeedTest');
     $content = $rssFeed->outputToBrowser();
     $this->assertContains('<title>Test Custom Template</title>', $content);
     $rssFeed->setTemplate('RSSFeed');
     $content = $rssFeed->outputToBrowser();
     $this->assertNotContains('<title>Test Custom Template</title>', $content);
 }
开发者ID:congaaids,项目名称:silverstripe-framework,代码行数:10,代码来源:RSSFeedTest.php


示例6: on_get_rss

 /**
  * Возвращает RSS комментариев.
  * @route GET//comments.rss
  */
 public static function on_get_rss(Context $ctx)
 {
     if (!class_exists('RSSFeed')) {
         throw new PageNotFoundException(t('Модуль rss не установлен.'));
     }
     $filter = array('class' => 'comment', 'deleted' => 0, 'published' => 1, '#limit' => 20, '#sort' => '-id');
     $title = t('Комментарии на %host', array('%host' => MCMS_HOST_NAME));
     $feed = new RSSFeed($filter);
     return $feed->render($ctx, array('title' => $title, 'description' => $title . '.', 'xsl' => os::path('lib', 'modules', 'comment', 'rss.xsl')));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:14,代码来源:class.commentapi.php


示例7: tag

 function tag()
 {
     $blogName = $this->owner->Title . " - " . ucwords($this->owner->request->latestParam('ID'));
     if ($this->owner->request->param('Action') == 'tag' && $this->owner->request->param('OtherID') == "rss") {
         $entries = $this->owner->Entries(20, Convert::raw2xml($this->owner->request->latestParam('ID')));
         if ($entries) {
             $rss = new RSSFeed($entries, $this->owner->Link('rss'), $blogName, "", "Title", "RSSContent");
             return $rss->outputToBrowser();
         }
     } else {
         return $this->owner;
     }
 }
开发者ID:helpfulrobot,项目名称:thezenmonkey-enhancedblog,代码行数:13,代码来源:EnhancedBlogTree.php


示例8: on_get_custom

 public static function on_get_custom(Context $ctx)
 {
     $filter = array();
     if (!($filter['class'] = $ctx->get('type'))) {
         $filter['class'] = $ctx->db->getResultsV("name", "SELECT name FROM node WHERE class = 'type' AND deleted = 0 AND published = 1");
     }
     if ($tmp = $ctx->get('tags')) {
         $filter['tags'] = explode('+', $tmp);
     }
     if ($tmp = $ctx->get('author')) {
         $filter['uid'] = $tmp;
     }
     $feed = new RSSFeed($filter);
     return $feed->render($ctx);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:15,代码来源:class.rssrouter.php


示例9: init

 /**
  *
  */
 function init()
 {
     RSSFeed::linkToFeed(Director::baseURL() . $this->URLSegment . "/episodesRSS");
     if (Director::is_ajax()) {
         $this->isAjax = true;
     } else {
         $this->isAjax = false;
     }
     parent::init();
 }
开发者ID:howardgrigg,项目名称:SilverStripe-Podcast-Module,代码行数:13,代码来源:PodcastPage.php


示例10: init

 public function init()
 {
     // Adds the requirements for the Podcast and Episode Page in the correct order
     Requirements::javascript('framework/thirdparty/jquery/jquery.js');
     Requirements::javascript('podcast/thirdparty/mediaelement/mediaelement-and-player.min.js');
     Requirements::javascript('podcast/javascript/podcast-page.js');
     Requirements::css('podcast/thirdparty/mediaelement/mediaelementplayer.min.css');
     Requirements::css('podcast/css/podcast-page.css');
     // Provides a link to the Podcast RSS in the HTML head
     RSSFeed::linkToFeed($this->Link('rss'));
     parent::init();
 }
开发者ID:helpfulrobot,项目名称:lukereative-silverstripe-podcast,代码行数:12,代码来源:PodcastPage.php


示例11: importString

 public static function importString($string)
 {
     $xml = simplexml_load_string($string);
     if ($xml === false) {
         return;
     }
     if (isset($xml->channel)) {
         // RSS
         return RSSFeed::import($xml->channel[0]);
     }
     if (isset($xml->entry)) {
         // Atom
         return AtomFeed::import($xml);
     }
 }
开发者ID:point,项目名称:cassea,代码行数:15,代码来源:Grabber.php


示例12: rss

 public function rss()
 {
     $SiteConfig = SiteConfig::current_site_config();
     $rss = new RSSFeed(NewsArticle::get(), $this->Link(), $SiteConfig->Title);
     return $rss->outputToBrowser();
 }
开发者ID:helpfulrobot,项目名称:arnhoe-silverstripe-simplenews,代码行数:6,代码来源:NewsHolder.php


示例13: OpXML

$xssDomain = $tmp[2];
$tmp = "";
//$getData = XML_unserialize($test);
//print_r($getData);
/*******************************************************
* 开始存储数据到xml文件
********************************************************/
$fpath = "../slave/slave.xml";
$slaveData = new OpXML('slaveData', $fpath);
//增加一条记录
$arr = array('requestDate' => $requestDate, 'slaveWatermark' => $slaveWatermark, 'slaveIP' => $slaveIP, 'slaveUA' => $slaveUA, 'slaveLang' => $slaveLang, 'slaveProxy' => $slaveProxy, 'slaveLocation' => $slaveLocation, 'xssGot' => $qstr);
$slaveData->insert($arr);
/*******************************************************
* 生成rss feed
********************************************************/
$myFeed = new RSSFeed();
$myFeed->addChannel("Anehta!", "http://anehta.googlecode.com", "Anehta Slave Events!", "zh-cn");
// 下面去掉$qstr 里的 "<![CDATA["和 "]]>"
$qstr = str_replace("\r\n<![CDATA[\r\n", "", $qstr);
$qstr = str_replace("\r\n]]>\r\n", "", $qstr);
/**
 * Encodes HTML safely for UTF-8. Use instead of htmlentities.
 *
 * @param string $var
 * @return string
 */
function html_encode($var)
{
    return htmlentities($var, ENT_QUOTES, 'UTF-8');
}
$qstr = html_encode($qstr);
开发者ID:moorefu,项目名称:anehta,代码行数:31,代码来源:logxss.php


示例14: init

 public function init()
 {
     RSSFeed::linkToFeed($this->Parent()->Link() . "rss", _t("CalendarEvent.RSSFEED", "RSS Feed of this calendar"));
     parent::init();
     Requirements::css('event_calendar/css/calendar.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('event_calendar/javascript/calendar_core.js');
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:8,代码来源:CalendarEvent.php


示例15: display

 public function display($part = 'all')
 {
     switch ($part) {
         case 'page-menu-only':
             if (file_exists('theme/' . $this->get_config('es_theme') . '/page_menu.php')) {
                 $page_menu_file = 'theme/' . $this->get_config('es_theme') . '/page_menu.php';
             } else {
                 $page_menu_file = 'includes/layout/theme//page_menu.php';
             }
             ob_start();
             include $page_menu_file;
             $page_menu = ob_get_contents();
             ob_end_clean();
             echo $page_menu;
             break;
         case 'posts-only':
             echo '<div id="new-post"></div>';
             $this->get_posts();
             break;
         case 'topbar-only':
             ob_start();
             include 'includes/layout/topbar.php';
             $this->topbar = ob_get_contents();
             ob_end_clean();
             echo $this->topbar;
             break;
         case 'sidebar-only':
             if (file_exists('theme/' . $this->get_config('es_theme') . '/sidebar.php')) {
                 $sidebar_file = 'theme/' . $this->get_config('es_theme') . '/sidebar.php';
             } else {
                 $sidebar_file = 'includes/layout/theme/sidebar.php';
             }
             ob_start();
             include $sidebar_file;
             $sidebar = ob_get_contents();
             ob_end_clean();
             echo $sidebar;
             break;
         case 'first-load':
             if ($this->configFileExists()) {
                 ob_start();
                 include 'includes/layout/topbar.php';
                 $this->topbar = ob_get_contents();
                 ob_end_clean();
                 $script_uri = 'http://' . str_replace('www.', '', $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI'];
                 if (substr($script_uri, -1) != '/') {
                     $script_uri .= '/';
                 }
                 $editsee_request = str_replace(str_replace('www.', '', $this->get_config('es_main_url')), '', $script_uri);
                 if (substr($editsee_request, 0, 5) == 'feed/') {
                     include "includes/RSSFeed.class.php";
                     header("Content-type: text/xml; charset=UTF-8");
                     $myfeed = new RSSFeed();
                     $myfeed->SetChannel($this->get_config('es_main_url'), $this->get_config('es_title'), $this->get_config('es_description'), 'en-us', date(Y) . ' ' . $_SERVER['HTTP_HOST'], 'webmaster@' . $_SERVER['HTTP_HOST'], $this->get_config('es_title'));
                     $myfeed->SetImage('');
                     $query = $this->db->_query("select id,title,urltag,content,date_entered from " . $this->db->get_table_prefix() . "post \n\t\t\t\t\t\t\t\t\t\t\t\t\twhere type='post' and deleted='0' and (date_entered <= NOW())\n\t\t\t\t\t\t\t\t\t\t\t\t\torder by date_entered desc");
                     while ($post = $query->_fetch_assoc()) {
                         $post['content'] = strip_tags($post['content'], '<br/><br>');
                         if (strpos($post['content'], '!--full-post--!')) {
                             $post['content'] = substr($post['content'], 0, strpos($post['content'], '!--full-post--!'));
                             $add_dots = true;
                         } else {
                             if (strlen($post['content']) > 280) {
                                 $post['content'] = substr(substr($post['content'], 0, 280), 0, strrpos(substr($post['content'], 0, 280), ' '));
                                 $add_dots = true;
                             }
                         }
                         $post['content'] = htmlentities(stripslashes($post['content']));
                         if ($add_dots) {
                             $post['content'] .= ' [...]';
                         }
                         $myfeed->SetItem($this->get_config('es_main_url') . 'post/' . $post['id'], $this->get_config('es_main_url') . 'post/' . $post['urltag'], $post['title'], $post['date_entered'], $post['content']);
                     }
                     echo $myfeed->output();
                     exit;
                 }
                 $editsee_index = '';
                 if ($editsee_request == '' || $editsee_request == $this->get_config('es_postpage') . '/' || $editsee_request == 'index.php/') {
                     $post_start = 0;
                     $page_number = 1;
                     if ($this->get_config('es_homepage') == '!posts!' || $editsee_request == $this->get_config('es_postpage') . '/') {
                         $this->is_posts = true;
                     } else {
                         $editsee_request = $this->get_config('es_homepage') . '/';
                     }
                 }
                 if (substr($editsee_request, 0, 5) == 'page/') {
                     $page_number = substr(substr($editsee_request, 5), 0, strpos(substr($editsee_request, 5), '/'));
                     $post_start = ($page_number - 1) * $this->get_config('es_posts_per_page');
                     $this->is_posts = true;
                 }
                 if ($this->is_posts) {
                     ob_start();
                     $this->get_posts($post_start);
                     $editsee_index .= ob_get_contents();
                     ob_end_clean();
                 } else {
                     $query = $this->db->_query("select id,title from " . $this->db->get_table_prefix() . "post where urltag='" . substr($editsee_request, 0, -1) . "'");
                     if ($query->_num_rows() == 1) {
                         $this->is_page = true;
//.........这里部分代码省略.........
开发者ID:apexad,项目名称:editsee,代码行数:101,代码来源:editsee_App.class.php


示例16: index

    function index($request)
    {
        // For 2.3 and 2.4 compatibility
        $bt = defined('DB::USE_ANSI_SQL') ? "\"" : "`";
        BasicAuth::enable();
        BasicAuth::requireLogin("CMS RSS feed access.  Use your CMS login", "CMS_ACCESS_CMSMain");
        $member = $this->getBasicAuthMember();
        // Due to a bug in 2.3.0 we can't get the information that we need from $request
        $params = Director::urlParams();
        // Default value
        if (!isset($params['Data']) || !$params['Data']) {
            $params['Data'] = 'all';
        }
        switch ($params['Data']) {
            case 'all':
                $changes = $this->changes();
                break;
            case 'page':
                if ((int) $params['PageID']) {
                    $changes = $this->changes("{$bt}SiteTree{$bt}.{$bt}ID{$bt} = " . (int) $params['PageID']);
                } else {
                    return new HTTPResponse("<h1>Bad Page ID</h1><p>Bad page ID when getting RSS feed of changes to a page.</p>", 400);
                }
                break;
            default:
                user_error("CMSChangeTracker Data param value '{$params['Data']}' not implemented; this is probably due to a bad URL rule.", E_USER_ERROR);
        }
        $processedChanges = new DataObjectSet();
        foreach ($changes as $change) {
            if ($change->canEdit($member)) {
                $author = DataObject::get_by_id("Member", $change->AuthorID);
                $verbed = $change->Version == 1 ? "created" : "edited";
                if ($author) {
                    $changeTitle = "'{$change->Title}' {$verbed} by {$author->FirstName} {$author->Surname}";
                    $changeAuthor = "{$author->FirstName} {$author->Surname}";
                    $firstParagraph = "{$author->FirstName} {$author->Surname} (<a href=\"mailto:{$author->Email}\">{$author->Email}</a>) has {$verbed} the '{$change->Title}' page.";
                } else {
                    $changeTitle = "'{$change->Title}' {$verbed}";
                    $changeAuthor = "";
                    $firstParagraph = "The '{$change->Title}' page has been {$verbed}.";
                }
                $actionLinks = "";
                $cmsLink = Director::absoluteURL("admin/show/{$change->ID}");
                $actionLinks .= "<li><a href=\"{$cmsLink}\">Edit in CMS</a></li>\n";
                $page = DataObject::get_by_id('SiteTree', $change->ID);
                if ($page) {
                    $link = $page->AbsoluteLink();
                    $actionLinks .= "<li><a href=\"{$link}\">See the page on site</a></li>\n";
                }
                if ($change->Version > 1) {
                    $prevVersion = $change->Version - 1;
                    $diffLink = Director::absoluteURL("admin/compareversions/{$change->ID}/?From={$prevVersion}&To={$change->Version}");
                    $actionLinks .= "<li><a href=\"{$diffLink}\">See the changes in CMS</a></li>\n";
                }
                $changeDescription = <<<HTML
<p>{$firstParagraph}</p>

<h3>Actions and links</h3>

<ul>
\t{$actionLinks}
</ul>
HTML;
                $processedChange = new CMSChangeTracker_Change(array("ChangeTitle" => $changeTitle, "Author" => $changeAuthor, "Content" => $changeDescription, "Link" => $change->Link() . "version/{$change->Version}"));
                $processedChanges->push($processedChange);
            }
        }
        $feed = new RSSFeed($processedChanges, Director::absoluteURL("admin/"), "SilverStripe Content Changes", "", "ChangeTitle");
        return $feed->outputToBrowser();
    }
开发者ID:helpfulrobot,项目名称:silverstripe-cmsworkflow,代码行数:70,代码来源:CMSChangeTracker.php


示例17: doModel


//.........这里部分代码省略.........
     foreach ($p_sCityArea as $city_area) {
         $this->mSearch->addCityArea($city_area);
     }
     $p_sCityArea = implode(", ", $p_sCityArea);
     //FILTERING CITY
     foreach ($p_sCity as $city) {
         $this->mSearch->addCity($city);
     }
     $p_sCity = implode(", ", $p_sCity);
     //FILTERING REGION
     foreach ($p_sRegion as $region) {
         $this->mSearch->addRegion($region);
     }
     $p_sRegion = implode(", ", $p_sRegion);
     //FILTERING COUNTRY
     foreach ($p_sCountry as $country) {
         $this->mSearch->addCountry($country);
     }
     $p_sCountry = implode(", ", $p_sCountry);
     // FILTERING PATTERN
     if ($p_sPattern != '') {
         $this->mSearch->addConditions(sprintf("MATCH(d.s_title, d.s_description) AGAINST('%s' IN BOOLEAN MODE)", $p_sPattern));
         $osc_request['sPattern'] = $p_sPattern;
     }
     // FILTERING USER
     if ($p_sUser != '') {
         $this->mSearch->fromUser(explode(",", $p_sUser));
     }
     // FILTERING IF WE ONLY WANT ITEMS WITH PICS
     if ($p_bPic) {
         $this->mSearch->withPicture(true);
     }
     //FILTERING BY RANGE PRICE
     $this->mSearch->priceRange($p_sPriceMin, $p_sPriceMax);
     //ORDERING THE SEARCH RESULTS
     $this->mSearch->order($p_sOrder, $allowedTypesForSorting[$p_iOrderType]);
     //SET PAGE
     $this->mSearch->page($p_iPage, $p_iPageSize);
     osc_run_hook('search_conditions', Params::getParamsAsArray());
     if (!Params::existParam('sFeed')) {
         // RETRIEVE ITEMS AND TOTAL
         $aItems = $this->mSearch->doSearch();
         $iTotalItems = $this->mSearch->count();
         $iStart = $p_iPage * $p_iPageSize;
         $iEnd = min(($p_iPage + 1) * $p_iPageSize, $iTotalItems);
         $iNumPages = ceil($iTotalItems / $p_iPageSize);
         osc_run_hook('search', $this->mSearch);
         //preparing variables...
         //$this->_exportVariableToView('non_empty_categories', $aCategories) ;
         $this->_exportVariableToView('search_start', $iStart);
         $this->_exportVariableToView('search_end', $iEnd);
         $this->_exportVariableToView('search_category', $p_sCategory);
         $this->_exportVariableToView('search_order_type', $p_iOrderType);
         $this->_exportVariableToView('search_order', $p_sOrder);
         $this->_exportVariableToView('search_pattern', $p_sPattern);
         $this->_exportVariableToView('search_from_user', $p_sUser);
         $this->_exportVariableToView('search_total_pages', $iNumPages);
         $this->_exportVariableToView('search_page', $p_iPage);
         $this->_exportVariableToView('search_has_pic', $p_bPic);
         $this->_exportVariableToView('search_region', $p_sRegion);
         $this->_exportVariableToView('search_city', $p_sCity);
         $this->_exportVariableToView('search_price_min', $p_sPriceMin);
         $this->_exportVariableToView('search_price_max', $p_sPriceMax);
         $this->_exportVariableToView('search_total_items', $iTotalItems);
         $this->_exportVariableToView('items', $aItems);
         $this->_exportVariableToView('search_show_as', $p_sShowAs);
         $this->_exportVariableToView('search', $this->mSearch);
         $this->_exportVariableToView('search_alert', base64_encode(serialize($this->mSearch)));
         //calling the view...
         $this->doView('search.php');
     } else {
         $this->mSearch->page(0, osc_num_rss_items());
         // RETRIEVE ITEMS AND TOTAL
         $iTotalItems = $this->mSearch->count();
         $aItems = $this->mSearch->doSearch();
         $this->_exportVariableToView('items', $aItems);
         if ($p_sFeed == '' || $p_sFeed == 'rss') {
             // FEED REQUESTED!
             header('Content-type: text/xml; charset=utf-8');
             $feed = new RSSFeed();
             $feed->setTitle(__('Latest items added') . ' - ' . osc_page_title());
             $feed->setLink(osc_base_url());
             $feed->setDescription(__('Latest items added in') . ' ' . osc_page_title());
             if (osc_count_items() > 0) {
                 while (osc_has_items()) {
                     if (osc_count_item_resources() > 0) {
                         osc_has_item_resources();
                         $feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url()), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date(), 'image' => array('url' => htmlentities(osc_resource_thumbnail_url()), 'title' => osc_item_title(), 'link' => htmlentities(osc_item_url()))));
                     } else {
                         $feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url()), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date()));
                     }
                 }
             }
             osc_run_hook('feed', $feed);
             $feed->dumpXML();
         } else {
             osc_run_hook('feed_' . $p_sFeed, $aItems);
         }
     }
 }
开发者ID:acharei,项目名称:OSClass,代码行数:101,代码来源:search.php


示例18: array

                                        $params_ranks = array();
                                        $params_ranks['alexa_rank'] = number_format((double) $objSettings->CheckAlexaRank($http_host));
                                        $params_ranks['google_rank'] = (int) $objSettings->CheckGoogleRank($http_host);
                                        if ($objSettings->UpdateFields($params_ranks) == true) {
                                            $msg = draw_success_message(_CHANGES_WERE_SAVED, false);
                                        } else {
                                            $msg = draw_important_message($objSettings->error, false);
                                        }
                                    } else {
                                        if ($submition_type == 'cron_settings') {
                                            if ($objSettings->UpdateFields($params_cron) == true) {
                                                $msg = draw_success_message(_CHANGES_WERE_SAVED, false);
                                            } else {
                                                $msg = draw_important_message($objSettings->error, false);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $template = $objSettings->GetTemplate();
    if (strtolower(SITE_MODE) != 'demo' && $submition_type == 'general' || $submition_type == 'visual_settings' || $submition_type == 'meta_tags') {
        $objSiteDescription->LoadData();
        RSSFeed::UpdateFeeds();
    }
}
开发者ID:mozdial,项目名称:Directory,代码行数:31,代码来源:handler_settings.php


示例19: rss

 public function rss()
 {
     $rss = new RSSFeed($this->Updates()->sort('Created DESC')->limit(20), $this->Link(), $this->getSubscriptionTitle());
     $rss->setTemplate('NewsHolder_rss');
     return $rss->outputToBrowser();
 }
开发者ID:silverstripe-scienceninjas,项目名称:datedupdates,代码行数:6,代码来源:NewsHolder.php


示例20: addDefaultJoin

 /**
  * Generic Function to add Default left join to a request
  *
  * @param $itemtype                    reference ID
  * @param $ref_table                   reference table
  * @param &$already_link_tables  array of tables already joined
  *
  * @return Left join string
  **/
 static function addDefaultJoin($itemtype, $ref_table, array &$already_link_tables)
 {
     switch ($itemtype) {
         // No link
         case 'User':
             return self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_profiles_users", "profiles_users_id", 0, 0, array('jointype' => 'child'));
         case 'Reminder':
             return Reminder::addVisibilityJoins();
         case 'RSSFeed':
             return RSSFeed::addVisibilityJoins();
         case 'ProjectTask':
             // Same structure in addDefaultWhere
             $out = '';
             $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_projecttaskteams", "projecttaskteams_id", 0, 0, array('jointype' => 'child'));
             return $out;
         case 'Project':
             // Same structure in addDefaultWhere
             $out = '';
             if (!Session::haveRight("project", Project::READALL)) {
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_projectteams", "projectteams_id", 0, 0, array('jointype' => 'child'));
             }
             return $out;
         case 'Ticket':
             // Same structure in addDefaultWhere
             $out = '';
             if (!Session::haveRight("ticket", Ticket::READALL)) {
                 $searchopt =& self::getOptions($itemtype);
                 // show mine : requester
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[4]['joinparams']['beforejoin']['joinparams']);
                 if (Session::haveRight("ticket", Ticket::READGROUP)) {
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[71]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
                 // show mine : observer
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[66]['joinparams']['beforejoin']['joinparams']);
                 if (count($_SESSION['glpigroups'])) {
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[65]['joinparams']['beforejoin']['joinparams']);
                 }
                 if (Session::haveRight("ticket", Ticket::OWN)) {
                     // Can own ticket : show assign to me
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                 }
                 if (Session::haveRightsOr("ticket", array(Ticket::READMY, Ticket::READASSIGN))) {
                     // show mine + assign to me
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[8]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
                 if (Session::haveRightsOr('ticketvalidation', array(TicketValidation::VALIDATEINCIDENT, TicketValidation::VALIDATEREQUEST))) {
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_ticketvalidations", "ticketvalidations_id", 0, 0, $searchopt[58]['joinparams']['beforejoin']['joinparams']);
                 }
             }
             return $out;
         case 'Change':
         case 'Problem':
             if ($itemtype == 'Change') {
                 $right = 'change';
                 $table = 'changes';
                 $groupetable = "glpi_changes_groups";
                 $linkfield = "changes_groups_id";
             } else {
                 if ($itemtype == 'Problem') {
                     $right = 'problem';
                     $table = 'problems';
                     $groupetable = "glpi_groups_problems";
                     $linkfield = "groups_problems_id";
                 }
             }
             // Same structure in addDefaultWhere
             $out = '';
             if (!Session::haveRight("{$right}", $itemtype::READALL)) {
                 $searchopt =& self::getOptions($itemtype);
                 if (Session::haveRight("{$right}", $itemtype::READMY)) {
                     // show mine : requester
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_" . $table . "_users", $table . "_users_id", 0, 0, $searchopt[4]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, $groupetable, $linkfield, 0, 0, $searchopt[71]['joinparams']['beforejoin']['joinparams']);
                     }
                     // show mine : observer
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_" . $table . "_users", $table . "_users_id", 0, 0, $searchopt[66]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, $groupetable, $linkfield, 0, 0, $searchopt[65]['joinparams']['beforejoin']['joinparams']);
                     }
                     // show mine : assign
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_" . $table . "_users", $table . "_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, $groupetable, $linkfield, 0, 0, $searchopt[8]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
//.........这里部分代码省略.........
开发者ID:jose-martins,项目名称:glpi,代码行数:101,代码来源:search.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP RWMB_Field类代码示例发布时间:2022-05-23
下一篇:
PHP RSS类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap