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

PHP UniversalFeedCreator类代码示例

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

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



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

示例1: index

 function index()
 {
     global $G;
     include_once CLASS_PATH . 'feedcreator.class.php';
     $rss = new UniversalFeedCreator();
     $rss->useCached();
     $rss->title = $G['setting']['site_name'];
     $rss->description = $this->setting->getValue("site_description");
     $rss->link = URL;
     $rss->syndicationURL = URL . "rss.php";
     //announce
     $announce = $this->setting->dbstuff->GetArray("SELECT * FROM {$this->setting->table_prefix}announcements ORDER BY display_order ASC,id DESC LIMIT 0,5");
     if (!empty($announce)) {
         foreach ($announce as $key => $val) {
             $item = new FeedItem();
             $item->title = $val['subject'];
             $item->link = $this->url(array("module" => "announce", "id" => $val['id']));
             $item->description = $val['message'];
             $item->date = $val['created'];
             $item->source = $this->url(array("module" => "announce", "id" => $val['id']));
             $item->author = $G['setting']['company_name'];
             $rss->addItem($item);
         }
     }
     $image = new FeedImage();
     $image->title = $G['setting']['site_banner_word'];
     $image->url = URL . STATICURL . "images/logo.jpg";
     $image->link = URL;
     $image->description = $rss->description;
     $rss->image = $image;
     $rss->saveFeed("RSS1.0", DATA_PATH . "appcache/rss.xml");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:32,代码来源:rss_controller.php


示例2: createXML

 function createXML($title = '', $url = '', $rssurl = '', $description = '', $query = NULL)
 {
     require_once PATH_CORE . '/utilities/feedcreator.class.php';
     $rssFeed = new UniversalFeedCreator();
     $rssFeed->useCached();
     // use cached version if age<1 hour
     $rssFeed->title = $title;
     $rssFeed->link = $url;
     $rssFeed->syndicationURL = $rssFeedurl;
     $rssFeed->description = $description;
     $rssFeed->descriptionTruncSize = 500;
     $rssFeed->descriptionHtmlSyndicated = true;
     $rssFeed->language = "en-us";
     $number = $this->db->countQ($query);
     while ($data = $this->db->readQ($query)) {
         $item = new FeedItem();
         $temptitle = str_replace("\\'", "'", $data->title);
         $temptitle = str_replace('\\"', '"', $temptitle);
         $item->title = $temptitle;
         $item->link = $this->baseUrl . '?p=read&cid=' . $data->siteContentId . '&viaRSS';
         $tempdesc = str_replace("\\'", "'", $data->caption);
         $tempdesc = str_replace('\\"', '"', $tempdesc);
         $tempdesc = $this->utilObj->shorten($tempdesc, 500);
         $item->description = $this->safexml($tempdesc);
         $item->descriptionTruncSize = 500;
         $item->descriptionHtmlSyndicated = true;
         $item->date = $data->mydate;
         $item->source = $this->baseUrl;
         $rssFeed->addItem($item);
     }
     $temp_file = PATH_CACHE . '/rss' . rand(1, 1000) . '.tmp';
     $text = $rssFeed->saveFeed("RSS2.0", $temp_file, false);
     return $text;
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:34,代码来源:rss.class.php


示例3: generate

 /**
  * Generate the feed fully populated. Defaults to RSS2.0
  *
  *
  *  @param string $f Optional. Name of file to save feed to
  *  @param string $type Optional. Which type of feed to generate. Supported are RSS2.0, RSS1.0, RSS0.92, ATOM1.0, ATOM03
  *  @return mixed If a filename is passed, then nothing is returned, otherwise an XML datastream
  */
 function generate($type = null, $f = null)
 {
     include_once '3rdparty/feedcreator/feedcreator.class.php';
     $ft = $type;
     $feed = new UniversalFeedCreator();
     $feed->UseCached();
     $feed->title = C_BLOGNAME;
     $feed->description = C_BLOG_DESCRIPTION;
     $feed->link = BLOGURL;
     $feed->syndicationURL = BLOGURL . basename($_SERVER['SCRIPT_NAME']);
     $posts = $this->_ph->get_posts(array('order' => 'ORDER BY posts.posttime DESC', 'num' => 20));
     foreach ($posts as $post) {
         $item = new FeedItem();
         $item->title = $post['title'];
         $item->link = $post['permalink'];
         $item->guid = $post['permalink'];
         $item->description = $post['body'];
         $item->source = $feed->link;
         $item->author = $post['author']['fullname'];
         $item->authorEmail = $post['author']['email'];
         $feed->additem($item);
     }
     if (!is_null($f)) {
         if (file_exists($f) && is_writable($f)) {
             $feed->savefeed($ft, $f);
         }
         //right here we need to generate and catch an error
     } else {
         $feed->outputfeed($ft);
     }
 }
开发者ID:BackupTheBerlios,项目名称:loquacity-svn,代码行数:39,代码来源:feedhandler.class.php


示例4: handleRSS

 function handleRSS($results)
 {
     $app =& Dataface_Application::getInstance();
     $record =& $app->getRecord();
     $query =& $app->getQuery();
     import('feedcreator.class.php');
     import('Dataface/FeedTool.php');
     $ft = new Dataface_FeedTool();
     $rss = new UniversalFeedCreator();
     $rss->encoding = $app->_conf['oe'];
     //$rss->useCached(); // use cached version if age<1 hour
     $del =& $record->_table->getDelegate();
     if (!$del or !method_exists($del, 'getSingleRecordSearchFeed')) {
         $del =& $app->getDelegate();
     }
     if ($del and method_exists($del, 'getSingleRecordSearchFeed')) {
         $feedInfo = $del->getSingleRecordSearchFeed($record, $query);
         if (!$feedInfo) {
             $feedInfo = array();
         }
     }
     if (isset($feedInfo['title'])) {
         $rss->title = $feedInfo['title'];
     } else {
         $rss->title = $record->getTitle() . '[ Search for "' . $query['--subsearch'] . '"]';
     }
     if (isset($feedInfo['description'])) {
         $rss->description = $feedInfo['description'];
     } else {
         $rss->description = '';
     }
     if (isset($feedInfo['link'])) {
         $rss->link = $feedInfo['link'];
     } else {
         $rss->link = htmlentities(df_absolute_url($app->url('') . '&--subsearch=' . urlencode($query['--subsearch'])));
     }
     $rss->syndicationURL = $rss->link;
     $records = array();
     foreach ($results as $result) {
         foreach ($result as $rec) {
             $records[] = $rec->toRecord();
         }
     }
     uasort($records, array($this, 'cmp_last_modified'));
     foreach ($records as $rec) {
         if ($rec->checkPermission('view') and $rec->checkPermission('view in rss')) {
             $rss->addItem($ft->createFeedItem($rec));
         }
     }
     if (!$query['--subsearch']) {
         $rss->addItem($ft->createFeedItem($record));
     }
     header("Content-Type: application/xml; charset=" . $app->_conf['oe']);
     echo $rss->createFeed('RSS2.0');
     exit;
 }
开发者ID:promoso,项目名称:HVAC,代码行数:56,代码来源:single_record_search.php


示例5: showRSSActivity

 function showRSSActivity(&$rows)
 {
     $app = JFactory::getApplication();
     // Load feed creator class
     require_once JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'assets' . DS . 'feedcreator' . DS . 'feedcreator.php';
     $rssfile = $app->getCfg('tmp_path') . '/rssAUPactivity.xml';
     $rss = new UniversalFeedCreator();
     $rss->title = $app->getCfg('sitename');
     $rss->description = JText::_('AUP_LASTACTIVITY');
     $rss->link = JURI::base();
     $rss->syndicationURL = JURI::base();
     $rss->cssStyleSheet = NULL;
     $rss->descriptionHtmlSyndicated = true;
     if ($rows) {
         foreach ($rows as $row) {
             // exceptions private data
             if ($row->plugin_function == 'plgaup_getcouponcode_vm' || $row->plugin_function == 'plgaup_alphagetcouponcode_vm' || $row->plugin_function == 'sysplgaup_buypointswithpaypal') {
                 $datareference = '';
             }
             switch ($row->plugin_function) {
                 case 'sysplgaup_dailylogin':
                 case 'plgaup_dailylogin':
                     $row->datareference = JHTML::_('date', $row->datareference, JText::_('DATE_FORMAT_LC1'));
                     break;
                 case 'plgaup_getcouponcode_vm':
                 case 'plgaup_alphagetcouponcode_vm':
                 case 'sysplgaup_buypointswithpaypal':
                     $row->datareference = '';
                     break;
                 default:
             }
             $datareference = $row->datareference != '' ? ' (' . $row->datareference . ')' : '';
             // special format
             //if ( $row->plugin_function=='sysplgaup_dailylogin' ) $datareference = '';
             $item = new FeedItem();
             $item->title = htmlspecialchars($row->usrname, ENT_QUOTES, 'UTF-8');
             $item->description = JText::_($row->rule_name) . "{$datareference} /  " . $row->last_points . " " . JText::_('AUP_POINTS');
             $item->descriptionTruncSize = 250;
             $item->descriptionHtmlSyndicated = true;
             @($date = $row->insert_date ? date('r', strtotime($row->insert_date)) : '');
             $item->date = $date;
             $item->source = JURI::base();
             $rss->addItem($item);
         }
     }
     // save feed file
     $rss->saveFeed('RSS2.0', $rssfile);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:48,代码来源:rssactivity.php


示例6: index

 public function index()
 {
     $rss = new UniversalFeedCreator();
     $rss->useCached();
     // use cached version if age<1 hour
     $rss->title = app_conf("SHOP_TITLE") . " - " . app_conf("SHOP_SEO_TITLE");
     $rss->description = app_conf("SHOP_SEO_TITLE");
     //optional
     $rss->descriptionTruncSize = 500;
     $rss->descriptionHtmlSyndicated = true;
     $rss->link = get_domain() . APP_ROOT;
     $rss->syndicationURL = get_domain() . APP_ROOT;
     //optional
     $image->descriptionTruncSize = 500;
     $image->descriptionHtmlSyndicated = true;
     $domain = app_conf("PUBLIC_DOMAIN_ROOT") == '' ? get_domain() . $GLOBALS['IMG_APP_ROOT'] : app_conf("PUBLIC_DOMAIN_ROOT");
     $city = get_current_deal_city();
     $city_id = $city['id'];
     $deal_list = get_deal_list(app_conf("DEAL_PAGE_SIZE"), 0, 0, array(DEAL_ONLINE), " buy_type <> 1 or ( is_shop = 1 and is_effect =1 and is_delete = 0 and buy_type <> 1)");
     $deal_list = $deal_list['list'];
     foreach ($deal_list as $data) {
         $item = new FeedItem();
         if ($data['uname'] != '') {
             $gurl = url("shop", "goods", array("id" => $data['uname']));
         } else {
             $gurl = url("shop", "goods", array("id" => $data['id']));
         }
         $data['url'] = $gurl;
         $item->title = msubstr($data['name'], 0, 30);
         $item->link = get_domain() . $data['url'];
         $data['description'] = str_replace($GLOBALS['IMG_APP_ROOT'] . "./public/", $domain . "/public/", $data['description']);
         $data['description'] = str_replace("./public/", $domain . "/public/", $data['description']);
         $data['img'] = str_replace("./public/", $domain . "/public/", $data['img']);
         $item->description = "<img src='" . $data['img'] . "' /><br />" . $data['brief'] . "<br /> <a href='" . get_domain() . $data['url'] . "' target='_blank' >" . $GLOBALS['lang']['VIEW_DETAIL'] . "</a>";
         //optional
         $item->descriptionTruncSize = 500;
         $item->descriptionHtmlSyndicated = true;
         if ($data['end_time'] != 0) {
             $item->date = date('r', $data['end_time']);
         }
         $item->source = $data['url'];
         $item->author = app_conf("SHOP_TITLE");
         $rss->addItem($item);
     }
     $rss->saveFeed($format = "RSS0.91", $filename = APP_ROOT_PATH . "public/runtime/app/tpl_caches/rss.xml");
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:46,代码来源:rssModule.class.php


示例7: indexAction

 public static function indexAction()
 {
     $rss = new \UniversalFeedCreator();
     $rss->useCached('RSS1.0', ROOT_DIR . '/runtime/rss.xml');
     $rss->title = P_TITLE;
     $rss->link = ENV_PREFERED_PROTOCOL . '://' . CONFIG_HOST . P_PREFIX;
     $rss->syndicationURL = $rss->link . '/feed';
     $posts = \BWBlog\Post::list_all([], 1, 0);
     foreach ($posts as $post) {
         $item = new \FeedItem();
         $item->title = $post['title'];
         $item->link = ENV_PREFERED_PROTOCOL . '://' . CONFIG_HOST . P_PREFIX . $post['rest_url'];
         $item->description = $post['content']['html'];
         $item->date = $post['time']['main'];
         $rss->addItem($item);
     }
     echo $rss->saveFeed('RSS1.0', ROOT_DIR . '/runtime/rss.xml');
 }
开发者ID:yunxuanhao,项目名称:BWBlog,代码行数:18,代码来源:feedController.php


示例8: create_xml

 function create_xml($fileName, &$list, &$ads, &$columns)
 {
     global $gorumroll;
     include FEED_DIR . "/feedcreator.class.php";
     $ufc = new UniversalFeedCreator();
     $ufc->descriptionHtmlSyndicated = TRUE;
     $ufc->title = $list->listTitle;
     $ufc->description = $list->listDescription;
     $ctrl =& new AppController("customlist/{$list->id}");
     $ufc->link = $ctrl->makeUrl(TRUE);
     $ufc->syndicationURL = $gorumroll->ctrl->makeUrl(TRUE);
     // link to this page
     $owner = new User();
     foreach ($ads as $ad) {
         $item = new FeedItem();
         $item->descriptionHtmlSyndicated = TRUE;
         $item->title = $ad->getTitle(FALSE);
         $ctrl = $ad->getLinkCtrl($item->title);
         $item->link = $ctrl->makeUrl(TRUE);
         $item->description = $ad->getDescription(FALSE);
         // without htmlspecialchars()
         $item->date = (int) $ad->creationtime->getTimestamp();
         $item->additionalElements = array();
         foreach ($columns as $column) {
             if (isset($ad->{$column->columnIndex})) {
                 if ($column->userField) {
                     $owner->{$column->userColumnIndex} = $ad->{$column->columnIndex};
                     $content = $owner->showListVal($column->userColumnIndex, "", TRUE);
                 } else {
                     $content = $ad->showListVal($column->columnIndex, "", TRUE);
                 }
                 $item->additionalElements[$column->showListVal("name")] = array("html" => $column->allowHtml || $column->type == customfield_url || $column->type == customfield_picture || $column->type == customfield_media || $column->columnIndex == "cName" || $column->userColumnIndex == "email", "content" => $content);
             }
         }
         $ufc->addItem($item);
     }
     $ufc->saveFeed($list->xmlType, $fileName, FALSE);
 }
开发者ID:alencarmo,项目名称:OCF,代码行数:38,代码来源:export.php


示例9: fab_feed

function fab_feed($type, $filename, $timeout)
{
    global $sitename, $slogan, $nuke_url, $backend_image, $backend_title, $backend_width, $backend_height, $backend_language, $storyhome;
    include "lib/feedcreator.class.php";
    $rss = new UniversalFeedCreator();
    $rss->useCached($type, $filename, $timeout);
    $rss->title = $sitename;
    $rss->description = $slogan;
    $rss->descriptionTruncSize = 250;
    $rss->descriptionHtmlSyndicated = true;
    $rss->link = $nuke_url;
    $rss->syndicationURL = $nuke_url . "/backend.php?op=" . $type;
    $image = new FeedImage();
    $image->title = $sitename;
    $image->url = $backend_image;
    $image->link = $nuke_url;
    $image->description = $backend_title;
    $image->width = $backend_width;
    $image->height = $backend_height;
    $rss->image = $image;
    $xtab = news_aff("index", "where ihome='0' and archive='0'", $storyhome, "");
    $story_limit = 0;
    while ($story_limit < $storyhome and $story_limit < sizeof($xtab)) {
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[$story_limit];
        $story_limit++;
        $item = new FeedItem();
        $item->title = preview_local_langue($backend_language, str_replace("&quot;", "\"", $title));
        $item->link = $nuke_url . "/article.php?sid={$sid}";
        $item->description = meta_lang(preview_local_langue($backend_language, $hometext));
        $item->descriptionHtmlSyndicated = true;
        $item->date = convertdateTOtimestamp($time) + $gmt * 3600;
        $item->source = $nuke_url;
        $item->author = $aid;
        $rss->addItem($item);
    }
    echo $rss->saveFeed($type, $filename);
}
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:37,代码来源:backend.php


示例10: str_replace

|--------------------------------------------------------------------------
| Return
|--------------------------------------------------------------------------
|
*/
$link = str_replace('inc/rss.php', '', get_current_url(true));
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
switch ($format) {
    case 'ATOM':
    case 'RSS':
        require 'classes/Feedcreator.php';
        define('TIME_ZONE', $tz);
        define('FEEDCREATOR_VERSION', 'Pimp My Log v' . get_current_pml_version());
        $rss = new UniversalFeedCreator();
        $rss->title = sprintf(__("Pimp My Log : %s"), $files[$file_id]['display']);
        $rss->description = empty($search) ? sprintf(__("Pimp logs for file %s"), $files[$file_id]['path']) : sprintf(__("Pimp logs for file %s with search %s"), $files[$file_id]['path'], $search);
        $rss->descriptionTruncSize = 500;
        $rss->descriptionHtmlSyndicated = true;
        $rss->link = $link;
        $rss->syndicationURL = get_current_url(true);
        $image = new FeedImage();
        $image->title = $rss->title;
        $image->url = str_replace('inc/rss.php', 'img/icon72.png', get_current_url());
        $image->link = $link;
        $image->description = __("Feed provided by Pimp My Log");
        $image->descriptionTruncSize = 500;
        $image->descriptionHtmlSyndicated = true;
        $rss->image = $image;
        if (isset($logs['logs']) && is_array($logs['logs'])) {
开发者ID:expressive-analytics,项目名称:docker-dt-standard.php,代码行数:31,代码来源:rss.php


示例11: UniversalFeedCreator

<?php

// RSSサンプル
$rss = new UniversalFeedCreator();
$rss->useCached();
//システム情報の取得
$system_config_keyword_value = $request->getAttribute('system_config_keyword_value');
$rss->title = $system_config_keyword_value['SYSTEM_NAME'];
$rss->description = $system_config_keyword_value['SYSTEM_OUTLINE'];
$rss->link = $system_config_keyword_value['SYSTEM_BASE_URL'];
$rss->syndicationURL = $request->getAttribute('rss_syndicationURL');
$image = new FeedImage();
$image->title = $system_config_keyword_value['SYSTEM_IMAGE']['title'];
$image->url = $system_config_keyword_value['SYSTEM_IMAGE']['url'];
$image->link = $system_config_keyword_value['SYSTEM_IMAGE']['link'];
$image->description = $system_config_keyword_value['SYSTEM_IMAGE']['description'];
$rss->image = $image;
// get news items from somewhere:
$bbs_rss_array = $request->getAttribute('bbs_rss_array');
$system_top_address = $request->getAttribute('system_top_address');
$rss_display_max_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D06'), 'RSS_DISPLAY_MAX_COUNT');
$rss_count = 0;
foreach ($bbs_rss_array as $index => $data) {
    // CRLF → LF
    $body = preg_replace('/\\r\\n/', "\n", $data['body']);
    $item = new FeedItem();
    $item->post_date = $data['post_date'];
    $item->title = $data['community_id_name'] . "::" . $data['subject'];
    $item->link = $system_top_address . $data['bbs_url'];
    $item->description = $body;
    $item->image_link = $data['file_url'];
开发者ID:nkawa,项目名称:acs-git-test,代码行数:31,代码来源:PressReleaseAllRSS.php


示例12: decks

 function decks()
 {
     $criteria = $_GET['show'];
     if (!isset($criteria)) {
         die("error in receiving feed criteria!");
     }
     $feed_type = $_GET['output'];
     if (!isset($feed_type)) {
         $feed_type = "RSS1.0";
     }
     $deckList = new DeckList();
     switch ($criteria) {
         case "new":
             $title = "SlideWiki -- New Presentations";
             $description = "list of new presentations";
             $link = "http://slidewiki.org/search/order/date";
             $syndicationURL = "http://slidewiki.org/feed/decks/new";
             $decks = $deckList->getAllDecks(15);
             break;
         case "popular":
             $title = "SlideWiki -- Popular Presentations";
             $description = "list of popular presentations";
             $link = "http://slidewiki.org/search/order/popularity";
             $syndicationURL = "http://slidewiki.org/feed/decks/popular";
             $decks = $deckList->getAllPopular(15);
             break;
         case "featured":
             $title = "SlideWiki -- Featured Presentations";
             $description = "list of featured presentations";
             $link = "http://slidewiki.org/search/order/featured";
             $syndicationURL = "http://slidewiki.org/feed/decks/featured";
             $decks = $deckList->getAllFeatured(15);
             break;
     }
     //define channel
     $rss = new UniversalFeedCreator();
     $rss->useCached();
     $rss->title = $title;
     $rss->description = $description;
     $rss->link = $link;
     $rss->syndicationURL = $syndicationURL;
     //channel items/entries
     foreach ($decks as $deck) {
         $item = new FeedItem();
         $item->title = $deck->title;
         $item->link = "http://slidewiki.org/deck/" . $deck->id . '_' . $deck->slug_title;
         $item->description = $deck->abstract;
         $item->source = "http://slidewiki.org/";
         $item->date = strtotime($deck->revisionTime);
         $item->author = $deck->owner->username;
         $rss->addItem($item);
     }
     //Valid parameters are RSS0.91, RSS1.0, RSS2.0, PIE0.1 (deprecated),
     // MBOX, OPML, ATOM, ATOM1.0, ATOM0.3, HTML, JS
     $rss->outputFeed($feed_type);
 }
开发者ID:TBoonX,项目名称:SlideWiki,代码行数:56,代码来源:FeedController.php


示例13: explode

    $feed = explode("|", $feed);
    $feed = array_map('trim', $feed);
    $f[$feed[0]] = array('class' => $feed[0], 'file' => $feed[1], 'name' => $feed[2], 'active' => $feed[3], 'header' => $feed[4]);
}
if (!isset($f[$action])) {
    $t = current($f);
    $action = $t['class'];
}
$format = $f[$action];
if ($format['header'] == 1) {
    $h = false;
} else {
    $h = true;
}
// Header of feeds
$rss = new UniversalFeedCreator();
$rss->encoding = 'UTF-8';
$rss->setDir("feeds/topics_");
$rss->useCached($action, '', $h);
$rss->title = $config['fname'];
$rss->description = $config['fdesc'];
$rss->link = $config['furl'] . "/forum.php";
$rss->language = $lang->phrase('rss_language');
$rss->ttl = $config['rssttl'];
$rss->copyright = $config['fname'];
$rss->lastBuildDate = time();
$rss->editor = $config['fname'];
if ($config['syndication_insert_email'] == 1) {
    $rss->editorEmail = $config['forenmail'];
} else {
    $rss->editorEmail = '';
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:external.php


示例14: UniversalFeedCreator

$info['cache_time'] = $params->def('cache_time', 3600);
$info['count'] = $params->def('count', 5);
$info['orderby'] = $params->def('orderby', '');
$info['title'] = $params->def('title', 'Powered by Mambo 4.5.1');
$info['description'] = $params->def('description', 'Mambo site syndication');
$info['image_file'] = $params->def('image_file', 'mambo_rss.png');
if ($info['image_file'] == -1) {
    $info['image'] = NULL;
} else {
    $info['image'] = $mosConfig_live_site . '/images/M_images/' . $info['image_file'];
}
$info['image_alt'] = $params->def('image_alt', 'Powered by Mambo 4.5.1');
$info['limit_text'] = $params->def('limit_text', 1);
$info['text_length'] = $params->def('text_length', 20);
// load feed creator class
$rss = new UniversalFeedCreator();
// load image creator class
$image = new FeedImage();
// get feedtype from url
$info['feed '] = mosGetParam($_GET, 'feed', 'RSS2.0');
// set filename for feed
$info['file '] = strtolower(str_replace('.', '', $info['feed ']));
$info['file '] = $GLOBALS['mosConfig_absolute_path'] . '/cache/' . $info['file '] . '.xml';
// loads cache file
if ($info['cache']) {
    $rss->useCached($info['feed '], $info['file '], $info['cache_time']);
}
$rss->title = $info['title'];
$rss->description = $info['description'];
$rss->link = $info['link'];
$rss->syndicationURL = $info['link'];
开发者ID:cwcw,项目名称:cms,代码行数:31,代码来源:rss.php


示例15: UniversalFeedCreator

<?php

require "init.php";
include "./include/class.rss.php";
$rss = new UniversalFeedCreator();
$rss->useCached();
$action = getArrayVal($_GET, "action");
$user = getArrayVal($_GET, "user");
$project = getArrayVal($_GET, "project");
$username = $_SESSION["username"];
error_reporting(0);
if (!empty($settings["rssuser"]) and !empty($settings["rsspass"])) {
    if (!isset($_SERVER['PHP_AUTH_USER'])) {
        header('WWW-Authenticate: Basic realm="Collabtive"');
        header('HTTP/1.0 401 Unauthorized');
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "{$errtxt}<br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    $authuser = $_SERVER['PHP_AUTH_USER'];
    $authpw = $_SERVER['PHP_AUTH_PW'];
    if ($authuser != $settings["rssuser"] or $authpw != $settings["rsspass"]) {
        unset($_SERVER['PHP_AUTH_USER']);
        unset($_SERVER['PHP_AUTH_PW']);
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "{$errtxt}<br>{$noperm}");
        $template->display("error.tpl");
        die;
开发者ID:veganaize,项目名称:Collabtive,代码行数:31,代码来源:managerss.php


示例16: generate_feed

 function generate_feed($feed, $uniqueid, $rss_version, $changes, $itemurl, $urlparam, $id, $title, $titleId, $desc, $descId, $dateId, $authorId)
 {
     global $tikiIndex;
     global $userslib;
     if ($rss_version == '') {
         // override version if set as request parameter
         if (isset($_REQUEST["ver"])) {
             $ver = $_REQUEST["ver"];
             $rss_version = $this->get_rss_version($ver);
         } else {
             $rss_version = 9;
             // default to RSS 0.91
         }
     } else {
         $rss_version = $this->get_rss_version($rss_version);
     }
     $now = date("U");
     $output = $this->get_from_cache($uniqueid, $rss_version);
     if ($output != "EMPTY") {
         return $output;
     }
     $urlarray = parse_url($_SERVER["REQUEST_URI"]);
     /* 
                        this gets the correct directory name aka dirname
                        when tikiwiki is on the main directory, i mean
                        when ur site is www.yoursite.com, the dirname of your site
                        is "/" and when tikiwiki is not on main directory, i mean
                        www.yoursite.com/tiki, the dirname returns "/tiki".
                        so, on URLs, we just need to add a extra slash when the
                        tikiwiki isnt on the main directory, what means,
                        dirname($urlarray["path"]) equals to "/tiki", otherwise
                        we can ommit them.
     
                        This is a quick hack to solve the infamous double-slash 
                        problem, which was introduced somewhen after 1.9.0 release 
                        http://dev.tikiwiki.org/tiki-view_tracker_item.php?trackerId=5&itemId=291
     */
     $dirname = dirname($urlarray["path"]) != "/" ? "/" : "";
     $url = htmlspecialchars($this->httpPrefix() . $_SERVER["REQUEST_URI"]);
     $home = htmlspecialchars($this->httpPrefix() . dirname($urlarray["path"]) . $dirname . $tikiIndex);
     $img = htmlspecialchars($this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "img/tiki.jpg");
     $title = htmlspecialchars($title);
     $desc = htmlspecialchars($desc);
     $read = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . $itemurl;
     // different stylesheets for atom and rss
     $cssStyleSheet = "";
     $xslStyleSheet = "";
     $encoding = "ISO-8859-1";
     $encoding = "UTF-8";
     $contenttype = "application/xml";
     // valid format strings are: RSS0.91, RSS1.0, RSS2.0, PIE0.1, MBOX, OPML, ATOM0.3, HTML, JS
     // valid format ids        :    9   ,   1   ,    2  ,   3   ,  4  ,   6 ,    5   ,  7  ,  8
     switch ($rss_version) {
         case "1":
             // RSS 1.0
             $cssStyleSheet = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "lib/rss/rss-style.css";
             break;
         case "2":
             // RSS 2.0
             $cssStyleSheet = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "lib/rss/rss-style.css";
             $xslStyleSheet = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "lib/rss/rss20.xsl";
             break;
         case "3":
             // PIE 0.1
             break;
         case "4":
             // MBOX
             $contenttype = "text/plain";
             break;
         case "5":
             // ATOM0.3
             $cssStyleSheet = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "lib/rss/atom-style.css";
             break;
         case "6":
             // OPML
             $xslStyleSheet = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "lib/rss/opml.xsl";
             break;
         case "7":
             // HTML
             $contenttype = "text/plain";
             break;
         case "8":
             // JS
             $contenttype = "text/javascript";
             break;
         case "9":
             // RSS 0.91
             $cssStyleSheet = $this->httpPrefix() . dirname($urlarray["path"]) . $dirname . "lib/rss/rss-style.css";
             break;
     }
     $rss = new UniversalFeedCreator();
     $rss->title = $title;
     $rss->description = $desc;
     //optional
     $rss->descriptionTruncSize = 500;
     $rss->descriptionHtmlSyndicated = true;
     $rss->cssStyleSheet = htmlspecialchars($cssStyleSheet);
     $rss->xslStyleSheet = htmlspecialchars($xslStyleSheet);
     $rss->encoding = $encoding;
     $rss->language = $this->get_preference("rssfeed_language", "en-us");
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:owaspbwa,代码行数:101,代码来源:rsslib.php


示例17: sms_board_output_rss

function sms_board_output_rss($keyword, $line = "10")
{
    global $apps_path, $web_title;
    include_once $apps_path['plug'] . "/feature/sms_board/lib/external/feedcreator/feedcreator.class.php";
    $keyword = strtoupper($keyword);
    if (!$line) {
        $line = "10";
    }
    $format_output = "RSS0.91";
    $rss = new UniversalFeedCreator();
    $db_query1 = "SELECT * FROM " . _DB_PREF_ . "_featureBoard_log WHERE in_keyword='{$keyword}' ORDER BY in_datetime DESC LIMIT 0,{$line}";
    $db_result1 = dba_query($db_query1);
    while ($db_row1 = dba_fetch_array($db_result1)) {
        $title = $db_row1['in_masked'];
        $description = $db_row1['in_msg'];
        $datetime = $db_row1['in_datetime'];
        $items = new FeedItem();
        $items->title = $title;
        $items->description = $description;
        $items->comments = $datetime;
        $items->date = strtotime($datetime);
        $rss->addItem($items);
    }
    $feeds = $rss->createFeed($format_output);
    return $feeds;
}
开发者ID:ranakhurram,项目名称:playSMS,代码行数:26,代码来源:fn.php


示例18: type

support.



<enclosure> support is useful if you are into 
podcasting or publishing photoblog.

the required parameter for enclosure is url, length
and type (as in MIME-type)

*/

<?php 
include "include/feedcreator.class.php";
//define channel
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = "Personal News Site";
$rss->description = "daily news from me";
$rss->link = "http://mydomain.net/";
$rss->syndicationURL = "http://mydomain.net/{$PHP_SELF}";
//channel items/entries
$item = new FeedItem();
$item->title = "test berita pertama";
$item->link = "http://mydomain.net/news/somelinks.html";
$item->description = "hahaha aku berjaya!";
$item->source = "http://mydomain.net";
$item->author = "[email protected]";
//optional enclosure support
$item->enclosure = new EnclosureItem();
$item->enclosure->url = 'http://mydomain.net/news/picture.jpg';
开发者ID:pipwilson,项目名称:epubserver,代码行数:31,代码来源:feedcreator-demo.php


示例19: header

        exit;
    }
}
if (!isset($_SERVER["PHP_AUTH_USER"]) or !OCP\User::checkPassword($uid = $_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
    header('WWW-Authenticate: Basic realm="ownCloud Login"');
    header('HTTP/1.0 401 Unauthorized');
    exit;
}
$lang = OC_Preferences::getValue($uid, 'core', 'lang', OC_L10N::findLanguage());
$l = OC_L10N::get('notify', $lang);
//TODO: use different feed creator library (like Zend_Feed) and switch html flag to true
$notifications = OC_Notify::getNotifications($uid, 50, $lang, false);
$baseAddress = (isset($_SERVER["HTTPS"]) ? 'https://' : 'http://') . $_SERVER["SERVER_NAME"];
$rssURI = $baseAddress . $baseuri . 'feed.rss';
$atomURI = $baseAddress . $baseuri . 'feed.atom';
$feed = new UniversalFeedCreator();
$feed->title = $l->t('ownCloud notifications');
$feed->description = $l->t('ownCloud notification stream of the user "%s".', array($uid));
$feed->link = $baseAddress . OC::$WEBROOT;
$feed->syndicationURL = $baseAddress . $_SERVER["PHP_SELF"];
$feed->image = new FeedImage();
$feed->image->title = 'ownCloud';
$feed->image->url = $baseAddress . OCP\Util::imagePath('core', 'logo-inverted.png');
$feed->image->link = $feed->link;
foreach ($notifications as $notification) {
    $item = new FeedItem();
    $item->title = strip_tags($notification["summary"]);
    $item->date = strtotime($notification["moment"]);
    $item->link = OCP\Util::linkToAbsolute("notify", "go.php", array("id" => $notification["id"]));
    $item->description = $notification["content"];
    //TODO image
开发者ID:netcon-source,项目名称:apps,代码行数:31,代码来源:feed.php


示例20: UniversalFeedCreator

<?php

require '../variables.php';
require '../variablesdb.php';
require '../functions.php';
include "feedcreator.class.php";
$br = "<br />";
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = $leaguename . ".com Games";
$rss->description = "The latest games from {$leaguename}!";
$rss->link = $directory;
$rss->syndicationURL = $directory . $PHP_SELF;
$sql = "SELECT g.*, t.abbreviation as winabb, u.abbreviation as loseabb FROM {$gamestable} g " . "left join {$teamstable} t on g.winnerteam = t.id " . "left join {$teamstable} u on g.loserteam = u.id " . "where g.deleted='no' ORDER BY g.game_id DESC LIMIT 0,20";
$res = mysql_query($sql);
while ($data = mysql_fetch_object($res)) {
    $winner = $data->winner;
    $winner2 = $data->winner2;
    $winabb = $data->winabb;
    $loseabb = $data->loseabb;
    if (strlen($winner2) > 0) {
        $winnerdisplay = $winner . "/" . $winner2;
    } else {
        $winnerdisplay = $winner;
    }
    $loser = $data->loser;
    $loser2 = $data->loser2;
    $losepoints = $data->losepoints;
    if (strlen($loser2) > 0) {
        $loserdisplay = $loser . "/" . $loser2;
        $losepoints2 = $data->losepoints2;

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Universe类代码示例发布时间:2022-05-23
下一篇:
PHP UniteWpmlRev类代码示例发布时间: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