本文整理汇总了PHP中data::count_feeds方法的典型用法代码示例。如果您正苦于以下问题:PHP data::count_feeds方法的具体用法?PHP data::count_feeds怎么用?PHP data::count_feeds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data
的用法示例。
在下文中一共展示了data::count_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: db
<?php
include '../WEB-INC/conf.php';
include '../WEB-INC/class.db.php';
//include '../WEB-INC/class.auth.php';
include '../WEB-INC/class.contain.feed.php';
include '../WEB-INC/class.contain.item.php';
include '../WEB-INC/class.data.php';
$cDb = new db();
//$cAuth = new auth();
$cData = new data();
$intFeeds = $cData->count_feeds();
$step = 10;
$page = isset($_GET['p']) ? $_GET['p'] : 1;
$maxpages = $intFeeds / $step;
if ($page > $maxpages) {
$page = $maxpages;
}
if ($page <= 1) {
$start = 0;
$stop = $start + $step;
$to_back = false;
if ($maxpages > 1) {
$to_next = true;
}
} else {
$start = $page * $step;
$stop = $start + $step;
$to_next = false;
$to_back = true;
if ($maxpages > $page) {