当前位置: 首页>>代码示例>>PHP>>正文


PHP FeedItem::getFeedItem方法代码示例

本文整理汇总了PHP中FeedItem::getFeedItem方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::getFeedItem方法的具体用法?PHP FeedItem::getFeedItem怎么用?PHP FeedItem::getFeedItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FeedItem的用法示例。


在下文中一共展示了FeedItem::getFeedItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: WHERE

<?php
	define('ROOT', '..');
	include ROOT . '/lib/include.php';
	include ROOT . '/lib/begin.php';	

	if(isset($accessInfo['action'])) {
		$id = $accessInfo['action'];
		$post = FeedItem::getFeedItem($id);
		FeedItem::edit($post['id'], 'click', $post['click']+1);	
		
		$page = FeedItem::getPageFromWritten($post['written']);

		if(!isAdmin()) {
			$filter = ' WHERE  (i.visibility = "y") AND (i.feedVisibility = "y") ';
		} else {
			$filter = ' WHERE  (i.visibility != "d") ';
		}
		
		$pageCut = 5;
		$pageCount = 1;		
		$paging = Func::makePaging($page, $pageCount, FeedItem::getFeedItemCount($filter), $pageCut);

		$pageCount = $paging['pageEnd'] - $paging['pageStart'] + 1;
		$result = FeedItem::getIdListFromPage($paging['pageStart'], $filter  ,$pageCount);

		$pageDatas = array();
		$start = $paging['pageStart']-1;
		if($start <= 0) $start = 1;

		for($i=0;$i<count($result);$i++) {			
			$item = $result[$i];
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:read.php

示例2:

<?php
	define('ROOT', '..');
	include ROOT . '/lib/include.php';
	include ROOT . '/lib/link.begin.php';	

	if(isset($accessInfo['action'])) {
		$id = $accessInfo['action'];	
		if(!is_numeric($id) || empty($id)) {
			$id = FeedItem::getIdByURL($accessInfo['address']);
		}

		$linker_post = FeedItem::getFeedItem($id);
		$linker_feed = Feed::getAll($linker_post['feed']);
		
		FeedItem::edit($linker_post['id'], 'click', $linker_post['click']+1);
	}

	if(!empty($config->linkskin)) {	
		$skin = new Skin;	
		$skin->load('link/'.$config->linkskin);

		include ROOT.'/lib/link/skin.begin.php';
			include ROOT . '/lib/piece/linker.php';	
		include ROOT.'/lib/link/skin.end.php';
	} else {
		if(isset($linker_post)) {	
			header('Location: ' . func::translate_uri($linker_post['permalink'])); // 한글주소 문제없이..
		}
	}
	
	include ROOT . '/lib/link.end.php';
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:go.php

示例3: saveFeedItem


//.........这里部分代码省略.........
				}

				if ($filtered) return false;
			}

			if (preg_match('/\((.[^\)]+)\)$/Ui', trim($item['author']), $_matches)) $item['author'] = $_matches[1];
			$item['author']=$db->escape($db->lessen(UTF8::correct($item['author'])));
			$item['permalink']=$db->escape($db->lessen(UTF8::correct($item['permalink'])));
			$item['description']=$db->escape($db->lessen(UTF8::correct(trim($item['description'])),65535));
			
			$enclosures = array();
			foreach($item['enclosures'] as $en) {
				array_push($enclosures, $en['url']);
			}

			$enclosureString=$db->escape($db->lessen(UTF8::correct(implode('|',$enclosures))));				

			$deadLine=0;
			$feedLife = Settings::get('archivePeriod');
			if ($feedLife > 0) $deadLine=gmmktime()-($feedLife*86400);

			requireComponent('Bloglounge.Data.FeedItems');

			$oldTags = null;
			$id = FeedItem::getIdByURL($item['permalink']);
			if($id === false && isset($item['guid'])) {
				$item['guid']=$db->escape($db->lessen(UTF8::correct($item['guid'])));
				$id = FeedItem::getIdByURL($item['guid']);
			}

			$item['author'] = Feed::getAuthor($item, $feedId, $id);
			$item['title'] = Feed::getTitle($item, $feedId, $id);

			$affected = 0;
			$isRebuildData = false;

			$summarySave = Settings::get('summarySave');
			$description = $item['description'];
			if(Validator::getBool($summarySave)) { // summarySave
				$description = func::stripHTML($item['description'].'>');
				if (substr($description, -1) == '>') $description = substr($description, 0, strlen($description) - 1);
				$description = $db->lessen(func::htmltrim($description), 1000, '');
			}
			
			if (preg_match("/^[0-9]+$/",$id)) {
				$baseItem = FeedItem::getFeedItem($id);
			//	$baseItem['title']=$db->escape(UTF8::correct($baseItem['title']));
			//	$baseItem['description']=$db->escape(UTF8::correct(trim($baseItem['description'])));

				if(($baseItem['title']!=$item['title'])) {
					$isRebuildData = true;
					$tags = FeedItem::get($id, 'tags');
					requireComponent('LZ.PHP.Media');
					Media::delete($id);

					$oldTags = func::array_trim(explode(',', $tags));
					$db->execute("UPDATE {$database['prefix']}FeedItems SET author = '{$item['author']}', title = '{$item['title']}', description = '{$description}', tags = '$tagString', enclosure = '$enclosureString', written = {$item['written']} WHERE id = $id");
				}
			} else {
				if ($item['written']==0)
					$item['written']=gmmktime();
				if ($item['written']>$deadLine) {
					$db->execute("INSERT INTO {$database['prefix']}FeedItems (feed, author, permalink, title, description, tags, enclosure, written, feedVisibility) VALUES ($feedId, '{$item['author']}', '{$item['permalink']}', '{$item['title']}', '{$description}', '$tagString', '$enclosureString', {$item['written']},'{$feedVisibility}')");

					$id =$db->insertId();
					$db->execute('UPDATE '.$database['prefix'].'Feeds SET feedCount=feedCount+1 WHERE id="'.$feedId.'"');
					if (isset($this)) $this->updated++;
				}
				$isRebuildData = true;
			}			

			if(Validator::getBool(Settings::get('saveImages'))) {
				if($description = FeedItem::saveImages($feedId, $id, $item)) {
					$db->execute("UPDATE {$database['prefix']}FeedItems SET description = '{$description}' WHERE id = $id");
				}
			}
			
			$item = $event->on('Add.updateFeedItem', array($feedId, $id, $item));
			if(count($item)==3) $item = $item[2];
	
			$result = false;
			if($isRebuildData) {
				requireComponent('Bloglounge.Data.Groups');
				GroupCategory::buildGroupCategory($id, $feedId, $item['tags']);

				Tag::buildTagIndex($id, $item['tags'], $oldTags);
					

				Category::buildCategoryRelations($id, $item['tags'], $oldTags);
				
				$isSaveThumbnail = FeedItem::cacheThumbnail($id, $item);

				// 썸네일 저장 이벤트
				$event->on('Add.thumbnailSave',array($item, $feedId, $id, $isSaveThumbnail));
				
				$result = true;
			}

			return $result;
		}
开发者ID:ncloud,项目名称:bloglounge,代码行数:101,代码来源:LZ.PHP.Feeder.php


注:本文中的FeedItem::getFeedItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。