本文整理汇总了PHP中data::get_feeds方法的典型用法代码示例。如果您正苦于以下问题:PHP data::get_feeds方法的具体用法?PHP data::get_feeds怎么用?PHP data::get_feeds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data
的用法示例。
在下文中一共展示了data::get_feeds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: all
/**
* индексирование всех rss-каналов
* @return type
*/
public function all($parameters = null)
{
//<<<<<<< HEAD
// /*$this->download = new downloader();
// $data = new data();
// $feed = new agregator_feed();
// $feed = new agregator_feed();
// $keyword = new keyword();*/
//
// $data = new data();
//=======
$cl_data = new data();
//>>>>>>> 958c783d1dc17f005a9a687915688f2dc8255bf1
if (isset($parameters['limit'])) {
$intLimit = $parameters['limit'];
} else {
$intLimit = 10;
}
$intAllFeeds = $cl_data->count_feeds();
$cio = 1;
print "Total RRS-feeds:" . $intAllFeeds . "\n";
if ($intAllFeeds == 0) {
print "Error: no feeds\n";
return 0;
}
for ($i = 0; $i < $intAllFeeds; $i++) {
// выбираем из БД список каналов в массив
$arrFeeds = $cl_data->get_feeds("", "", "`update`", "ASC", $i, $intLimit);
$intFeeds = count($arrFeeds);
if (!$arrFeeds) {
continue;
}
// перебираем весь массив
for ($cc = 0; $intFeeds > $cc; ++$cc) {
$intFeedId = $arrFeeds[$cc]->feed_id;
$strFeedUrl = $arrFeeds[$cc]->feed_url;
$strFeedLastIndex = $arrFeeds[$cc]->lastindex;
$_timer_start = date("Ymdhis");
// качаем канал
$_spider_channel_status = $this->spider_channel($intFeedId, $strFeedUrl);
$_timer_stop = date("Ymdhis");
echo "" . $cio++ . ". {$strFeedUrl} ... time: " . ($_timer_stop - $_timer_start) . " ... [" . ($_spider_channel_status == true ? "OK" : "ERR") . "]\n";
}
}
return true;
}
示例2: count
$to_next = true;
}
} else {
$start = $page * $step;
$stop = $start + $step;
$to_next = false;
$to_back = true;
if ($maxpages > $page) {
if ($stop < $intFeeds) {
$to_next = true;
}
}
}
$but_to_back = $to_back ? "<a href='/rss/cs.php?p=" . ($page - 1) . "'>< Back</a> " : null;
$but_to_next = $to_next ? "<a href='/rss/cs.php?p=" . ($page + 1) . "'>Next ></a>" : null;
$chi = $cData->get_feeds(null, null, "`update`", "ASC", $start, 50);
$chin = count($chi);
$return = null;
for ($c = 0; $chin > $c; $c++) {
$channel_id = $chi[$c]->feed_id;
$url = $chi[$c]->feed_url;
$link = $chi[$c]->link;
$title = $chi[$c]->title != "" ? $chi[$c]->title : "unknown";
$num = $c + $start + 1;
$return .= <<<PPH
\t\t\t<div class=item>
\t\t\t\t<div class=title>
\t\t\t\t\t{$num}. <b><span><a href="/rss/c.php?cid={$channel_id}">{$title}</a></span></b>
\t\t\t\t</div>
\t\t\t</div>
PPH;