Ejemplo n.º 1
0
?>
			<li class="empty">글이 없습니다.</li>
<?php
	}
?>
				</ul>
			</div>
			<?php echo drawAdminBoxEnd();?>
		</div>

		<!-- new version -->
		<div id="new_version_sidebar" class="sidebar_item">
<?php
	list($feedItems, $totalFeedItems) = FeedItem::getFeedItems('blogURL','itcanus.net/bloglounge_download',Feed::blogURL2Id('http://itcanus.net/bloglounge_download'),1,10);
	if($totalFeedItems==0) { // 자동등록된 공지사항 피드를 삭제하였을경우 .. 동적으로 읽어 온다.
		list($status, $feed, $xml) = Feed::getRemoteFeed('http://itcanus.net/bloglounge_download/rss');
		if($status == 0) {
			$feedItems = Feed::getFeedItems($xml);
			if(count($feedItems) > 10) $feedItems = array_slice($feedItems, 0,10);
			$totalFeedItems = count($feedItems);
		}
	}
?>
		<?php echo drawAdminBoxBegin('new_version');?>
			<div class="title">
				<a href="http://itcanus.net/bloglounge_download" target="_blank"><?php echo _t('다운로드');?></a> <span class="subtitle"><?php echo _t('현재버전');?> v<?php echo BLOGLOUNGE_VERSION;?></span>
			</div>
			<div class="line"></div>
			<div class="data">
				<ul>
<?php
Ejemplo n.º 2
0
		function updateFeed($feedURL){
			global $database, $db, $event;

			if (preg_match("/^[0-9]+$/", $feedURL))
				$feedURL = $db->queryCell('SELECT xmlURL FROM '.$database['prefix'].'Feeds WHERE id="'.$feedURL.'"');

			list($feedId, $lastUpdate, $autoUpdate, $feedVisibility, $isVerified, $owner) = $db->pick('SELECT id, lastUpdate, autoUpdate, visibility, isVerified, owner FROM '.$database['prefix'].'Feeds WHERE xmlURL="'.$feedURL.'"');

			$result = $event->on('Add.checkFeed', array($feedURL, $feedId));
			if(is_array($result) && count($result)>=3) {
				list($status, $feed, $xml) = $result;
			} else {
				$feedURL = trim('http://' . str_replace('http://','',$feedURL));
				list($status, $feed, $xml) = Feed::getRemoteFeed($feedURL);
			}

			if ($status > 0){
				$db->execute("UPDATE {$database['prefix']}Feeds SET lastUpdate = ".gmmktime()." WHERE xmlURL = '{$feedURL}'");
				return array(0, $db->queryCell('SELECT title FROM '.$database['prefix'].'Feeds WHERE xmlURL = "' . $feedURL . '"'), 0);
			} else{
				$sQuery = (Validator::getBool($autoUpdate)) ? "title = '{$feed['title']}', description = '{$feed['description']}', " : '';
				$db->execute("UPDATE {$database['prefix']}Feeds SET blogURL = '{$feed['blogURL']}', $sQuery language = '{$feed['language']}', lastUpdate = ".gmmktime()." WHERE xmlURL = '{$feedURL}'");

				if(Validator::getBool(Settings::get('useVerifier')) && $owner != 1 && !Validator::getBool($isVerified)) {
					if(!$this->checkVerifier($feedId,$feedURL,$xml)) {
						return array(false, $feed['title']);
					} else {
						$db->execute("UPDATE {$database['prefix']}Feeds SET isVerified = 'y' WHERE xmlURL = '{$feedURL}'");
					}
				}

				$this->updated = 0;
				$result = $this->saveFeedItems($feedId,$feedVisibility,$xml)?0:1;
				return array($result, $feed['title'], $this->updated);
			}
		}