/**
  * индексирование всех 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;
 }
Esempio n. 2
0
        $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>&nbsp;&nbsp;" : 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;