Ejemplo n.º 1
0
 function updateMemcache()
 {
     // ignore_user_abort();
     //set_time_limit(0);
     //$interval=3600; //(seconds)
     require_once 'model/Feed.php';
     require_once 'lib/BitMemCache.php';
     require_once 'lib/RssReader.php';
     $feed = new Feed();
     $feeds = $feed->getFeeds();
     $logger = LogUtil::getLogger();
     //do{
     include "config/site.php";
     foreach ($feeds as $feed) {
         $url = $feed['url'];
         $mem = new BitMemCache();
         $reader = new RssReader();
         $rss = $reader->fetch($url);
         if (!$rss) {
         } else {
             if ($mem->init()) {
                 $mem->set($url, json_encode($rss));
                 $logger->info("update memcache {$url}");
             }
         }
     }
     //  sleep($interval);
     //}while($memcache);
 }
 function listnews()
 {
     include "config/site.php";
     require_once 'model/Feed.php';
     $feed = new Feed();
     $feeds = $feed->getFeeds();
     require "view/admin/feednews.php";
 }
Ejemplo n.º 3
0
 /**
  * Feed ajax 读取
  */
 public function actionFeed()
 {
     $type = Yii::app()->request->getParam('type');
     $uid = Yii::app()->request->getParam('uid');
     $feeds = array();
     $model = new Feed();
     $feeds = $model->getFeeds($uid, $type, $page, $opts);
     $data = array('feeds' => $feeds);
     $this->renderPartial('feed', $data, '', false);
 }
Ejemplo n.º 4
0
			requireComponent('Bloglounge.Model.Users');
			$id = User::getIdByName($keyword);
			$sQuery = ' owner = ' . $id;
		} else {
			$sQuery = ' title LIKE "%' . $keyword . '%"';
		}			
		if(!empty($read)) { $page = Feed::getPredictionPage($read,$pageCount,$sQuery); }
		if($is_admin) {			
			list($feeds, $totalFeeds) = Feed::getFeeds($page,$pageCount,$sQuery);	
		} else {		
			list($feeds, $totalFeeds) = Feed::getFeedsByOwner(getLoggedId(), $page, $pageCount,$sQuery);	
		}
	} else {		
		if(!empty($read)) { $page = Feed::getPredictionPage($read,$pageCount); }
		if($is_admin) {
			list($feeds, $totalFeeds) = Feed::getFeeds($page,$pageCount);	
		} else {
			list($feeds, $totalFeeds) = Feed::getFeedsByOwner(getLoggedId(), $page, $pageCount);	
		}
	}

	$paging = Func::makePaging($page, $pageCount, $totalFeeds);

	$config = new Settings;
		
	requireComponent('Bloglounge.Data.Groups');
	$groups = Group::getGroupsAll();
	
?>	
	<script type="text/javascript">
		
Ejemplo n.º 5
0
// XSRF protection with token
if (!empty($_POST)) {
    if (!Session::isToken($_POST['token'])) {
        $pb->assign('message', Intl::msg('Wrong token'));
        $pb->renderPage('message');
    }
    unset($_SESSION['tokens']);
}
$kfc = new FeedConf(CONFIG_FILE, FEED_VERSION);
$kf = new Feed(DATA_FILE, CACHE_DIR, $kfc);
$ks = new Star(STAR_FILE, ITEM_FILE, $kfc);
// autosave opml
if (Session::isLogged()) {
    if (!is_file(OPML_FILE)) {
        $kf->loadData();
        file_put_contents(OPML_FILE, Opml::generateOpml($kf->getFeeds(), $kf->getFolders()));
    } else {
        if (filemtime(OPML_FILE) < time() - UPDATECHECK_INTERVAL) {
            $kf->loadData();
            rename(OPML_FILE, OPML_FILE_SAVE);
            file_put_contents(OPML_FILE, Opml::generateOpml($kf->getFeeds(), $kf->getFolders()));
        }
    }
}
// List or Expanded ?
$view = $kfc->view;
// show or hide list of feeds ?
$listFeeds = $kfc->listFeeds;
// All or Unread ?
$filter = $kfc->filter;
// newerFirst or olderFirst
Ejemplo n.º 6
0
<?php
	define('ROOT', '..');
	include ROOT . '/lib/include.php';
	include ROOT . '/lib/begin.php';

	// 피드 목록

	$pageCount = $skinConfig->feedListPage;

	list($feeds, $totalFeeds) = Feed::getFeeds($page, $pageCount, $skinConfig->feedListPageOrder);
	$paging = Func::makePaging($page, $pageCount, $totalFeeds);

	include ROOT.'/lib/piece/feed_message.php';
	include ROOT.'/lib/piece/feedlist.php';
	include ROOT.'/lib/end.php';
?>