/** * индексирование всех 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; }
<?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) {