本文整理汇总了PHP中RSSFeed::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::setTitle方法的具体用法?PHP RSSFeed::setTitle怎么用?PHP RSSFeed::setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSSFeed
的用法示例。
在下文中一共展示了RSSFeed::setTitle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doModel
//.........这里部分代码省略.........
break;
}
}
$p_iOrderType = $orderType;
}
}
// FILTERING USER
if ($p_sUser != '') {
$this->mSearch->fromUser($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...
$regionName = $p_sRegion;
if (is_numeric($p_sRegion)) {
$r = Region::newInstance()->findByPrimaryKey($p_sRegion);
if ($r) {
$regionName = $r['s_name'];
}
}
$cityName = $p_sCity;
if (is_numeric($p_sCity)) {
$c = City::newInstance()->findByPrimaryKey($p_sCity);
if ($c) {
$cityName = $c['s_name'];
}
}
//$this->_exportVariableToView('non_empty_categories', $aCategories) ;
$this->_exportVariableToView('search_start', $iStart);
$this->_exportVariableToView('search_end', $iEnd);
$this->_exportVariableToView('search_category', $p_sCategory);
// hardcoded - non pattern and order by relevance
$p_sOrder = $old_order;
$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', $regionName);
$this->_exportVariableToView('search_city', $cityName);
$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);
// json
$json = $this->mSearch->toJson();
$this->_exportVariableToView('search_alert', base64_encode($json));
//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 listings added') . ' - ' . osc_page_title());
$feed->setLink(osc_base_url());
$feed->setDescription(__('Latest listings 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(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date(), 'image' => array('url' => htmlentities(osc_resource_thumbnail_url(), ENT_COMPAT, "UTF-8"), 'title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"))));
} else {
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"), '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);
}
}
}
示例2: 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);
}
}
}
示例3: doModel
//.........这里部分代码省略.........
$iTotalItems = null;
if ($cache) {
$aItems = $cache['aItems'];
$iTotalItems = $cache['iTotalItems'];
} else {
$aItems = $this->mSearch->doSearch();
$iTotalItems = $this->mSearch->count();
$_cache['aItems'] = $aItems;
$_cache['iTotalItems'] = $iTotalItems;
osc_cache_set($key, $_cache, OSC_CACHE_TTL);
}
$iStart = $p_iPage * $p_iPageSize;
$iEnd = min(($p_iPage + 1) * $p_iPageSize, $iTotalItems);
$iNumPages = ceil($iTotalItems / $p_iPageSize);
// works with cache enabled ?
osc_run_hook('search', $this->mSearch);
//preparing variables...
$countryName = $p_sCountry;
if (strlen($p_sCountry) == 2) {
$c = Country::newInstance()->findByCode($p_sCountry);
if ($c) {
$countryName = $c['s_name'];
}
}
$regionName = $p_sRegion;
if (is_numeric($p_sRegion)) {
$r = Region::newInstance()->findByPrimaryKey($p_sRegion);
if ($r) {
$regionName = $r['s_name'];
}
}
$cityName = $p_sCity;
if (is_numeric($p_sCity)) {
$c = City::newInstance()->findByPrimaryKey($p_sCity);
if ($c) {
$cityName = $c['s_name'];
}
}
$this->_exportVariableToView('search_start', $iStart);
$this->_exportVariableToView('search_end', $iEnd);
$this->_exportVariableToView('search_category', $p_sCategory);
// hardcoded - non pattern and order by relevance
$p_sOrder = $old_order;
$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_only_premium', $p_bPremium);
$this->_exportVariableToView('search_country', $countryName);
$this->_exportVariableToView('search_region', $regionName);
$this->_exportVariableToView('search_city', $cityName);
$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);
// json
$json = $this->mSearch->toJson();
$encoded_alert = base64_encode(osc_encrypt_alert($json));
// Create the HMAC signature and convert the resulting hex hash into base64
$stringToSign = osc_get_alert_public_key() . $encoded_alert;
$signature = hex2b64(hmacsha1(osc_get_alert_private_key(), $stringToSign));
$server_signature = Session::newInstance()->_set('alert_signature', $signature);
$this->_exportVariableToView('search_alert', $encoded_alert);
// calling the view...
if (count($aItems) === 0) {
header('HTTP/1.1 404 Not Found');
}
osc_run_hook("after_search");
if (!Params::existParam('sFeed')) {
$this->doView('search.php');
} else {
if ($p_sFeed == '' || $p_sFeed == 'rss') {
// FEED REQUESTED!
header('Content-type: text/xml; charset=utf-8');
$feed = new RSSFeed();
$feed->setTitle(__('Latest listings added') . ' - ' . osc_page_title());
$feed->setLink(osc_base_url());
$feed->setDescription(__('Latest listings 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(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'country' => osc_item_country(), 'region' => osc_item_region(), 'city' => osc_item_city(), 'city_area' => osc_item_city_area(), 'category' => osc_item_category(), 'dt_pub_date' => osc_item_pub_date(), 'image' => array('url' => htmlentities(osc_resource_thumbnail_url(), ENT_COMPAT, "UTF-8"), 'title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"))));
} else {
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'country' => osc_item_country(), 'region' => osc_item_region(), 'city' => osc_item_city(), 'city_area' => osc_item_city_area(), 'category' => osc_item_category(), 'dt_pub_date' => osc_item_pub_date()));
}
}
}
osc_run_hook('feed', $feed);
$feed->dumpXML();
} else {
osc_run_hook('feed_' . $p_sFeed, $aItems);
}
}
}
示例4: RSSFeed
* @version 1.2.13
* @access public
* @since 1.2.2
*/
// Import the RSSFeed class
require_once 'path/to/RSSFeed/RSSFeed.class.php';
// MySQL Connection
$connection = mysql_connect('localhost', 'root', 'example');
mysql_select_db('website', $connection);
try {
// Create the new instance of the RSS Feed
$rssFeed = new RSSFeed('utf-8');
// Activate the string protection
$rssFeed->setProtectString(true);
// Set the feed title
$rssFeed->setTitle('My blog : the best in the world');
// Set the feed description
$rssFeed->setDescription('A little blog, which talks about Web programming');
// Set the feed link
$rssFeed->setLink('http://www.mywebsite.com/blog/rss/posts.php');
// Set the feed publication date
$rssFeed->setPubDate('2007-08-01');
// Set the feed last build date
$rssFeed->setLastBuildDate(date('Y-m-d'));
// Set the feed webmaster
$rssFeed->setWebMaster('me@mywebsite.com', 'John Doe');
// Set the feed managing editor
$rssFeed->setManagingEditor('me@mywebsite.com', 'John Doe');
// Set the feed image
$rssFeed->setImage('http://www.mywebsite.com/image/logo.jpg', 'My Logo', 'My blog', 100, 200);
// Set the feed categories
示例5: doModel
//.........这里部分代码省略.........
//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("(d.s_title LIKE '%%%s%%' OR d.s_description LIKE '%%%s%%')", $p_sPattern, $p_sPattern));
$osc_request['sPattern'] = $p_sPattern;
}
// 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());
$this->mSearch->addConditions(sprintf("%st_item.e_status = 'ACTIVE' ", DB_TABLE_PREFIX));
// RETRIEVE ITEMS AND TOTAL
$iTotalItems = $this->mSearch->count();
$aItems = $this->mSearch->doSearch();
if (!Params::existParam('sFeed')) {
$iStart = $p_iPage * $p_iPageSize;
$iEnd = min(($p_iPage + 1) * $p_iPageSize, $iTotalItems);
//Static data, which is the point?
/*$aOrders = array(
__('Newly listed') => array('sOrder' => 'dt_pub_date', 'iOrderType' => 'desc')
,__('Lower price first') => array('sOrder' => 'f_price', 'iOrderType' => 'asc')
,__('Higher price first') => array('sOrder' => 'f_price', 'iOrderType' => 'desc')
);*/
$iNumPages = ceil($iTotalItems / $p_iPageSize);
//Categories for select at view "search.php"
$mCategories = new Category();
$aCategories = $mCategories->findRootCategories();
$mCategoryStats = new CategoryStats();
$aCategories = $mCategories->toTree();
foreach ($aCategories as $k => $v) {
$iCategoryNumItems = CategoryStats::newInstance()->getNumItems($v);
if ($iCategoryNumItems > 0) {
$aCategories[$k]['total'] = $iCategoryNumItems;
} else {
unset($aCategories[$k]);
}
}
osc_run_hook('search', $this->mSearch);
//preparing variables...
$this->_exportVariableToView('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_total_pages', $iNumPages);
$this->_exportVariableToView('search_page', $p_iPage);
$this->_exportVariableToView('search_has_pic', $p_bPic);
$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);
//calling the view...
$this->doView('search.php');
} else {
$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()) {
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url()), 'description' => osc_item_description()));
}
}
osc_run_hook('feed', $feed);
$feed->dumpXML();
} else {
osc_run_hook('feed_' . $p_sFeed, $aItems);
}
}
}
示例6: getSettingValue
$noms["nom"] = $noms["prenom"] = NULL;
$noms = mysqli_fetch_array(mysqli_query($GLOBALS["mysqli"], "SELECT nom, prenom FROM eleves WHERE login = '" . $eleve_l . "' LIMIT 1"));
$title_rss = 'Cahier de textes - ' . getSettingValue("gepiSchoolName") . ' (' . getSettingValue("gepiYear") . ')';
$title_rss .= ': ' . get_nom_prenom_eleve($eleve_l);
$description_rss = 'Les devoirs à faire de ' . $noms["nom"] . ' ' . $noms["prenom"];
}
// =========================fin des cahiers de textes ===========================
$ServerProtocole = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
// Import de la classe RSSFeed
require 'RSSFeed/RSSFeed.class.php';
// Création des entêtes du flux RSS
//$oRssFeed = new RSSFeed('utf-8');
$oRssFeed = new RSSFeed('UTF-8');
$oRssFeed->setCloud($_SERVER["SERVER_NAME"], $_SERVER["REMOTE_PORT"], $gepiPath, '', 'http');
$oRssFeed->setProtectString(true);
$oRssFeed->setTitle($title_rss);
$oRssFeed->setDescription($description_rss);
$oRssFeed->setLink($ServerProtocole . $_SERVER["SERVER_NAME"] . $gepiPath);
$oRssFeed->setPubDate('2007-12-31');
$oRssFeed->setLastBuildDate(date('Y-m-d'));
//$oRssFeed->setWebMaster(getSettingValue("gepiSchoolEmail"),'ADMIN');
//$oRssFeed->setManagingEditor(getSettingValue("gepiSchoolEmail"),'ADMIN');
$oRssFeed->setWebMaster($rss_email_defaut, 'ADMIN');
$oRssFeed->setManagingEditor($rss_email_defaut, 'ADMIN');
$oRssFeed->setImage($gepiPath . '/favicon.ico', 'GEPI', $ServerProtocole . $_SERVER["SERVER_NAME"]);
$oRssFeed->setCopyright('(L) - GEPI ' . getSettingValue('version'));
$oRssFeed->setGenerator('Généré par RSSFeed Class de Hugo "Emacs" HAMON - http://www.apprendre-php.com');
$oRssFeed->setLanguage('fr');
$finfo = finfo_open(FILEINFO_MIME_TYPE);
// Ajout des news au flux
if ($items["cdt_dev"]["count"] != 0) {