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


PHP FeedItem::getIdByURL方法代码示例

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


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

示例1:

<?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

示例2: saveFeedItem

		function saveFeedItem($feedId,$feedVisibility,$item){
			global $database, $db, $event;

			$db->query("SELECT id FROM {$database['prefix']}DeleteHistory WHERE feed='$feedId' and permalink='{$item['permalink']}'");
			if ($db->numRows() > 0) 
				return false;
	
			if ($item['written']>gmmktime()+86400)
				return false;

			$item['title']=$db->escape($db->lessen(UTF8::correct($item['title'])));

			list($useRssOut) = Settings::gets('useRssOut');
		
			list($feedCreated,$localFilter,$localFilterType) = Feed::gets($feedId, 'created,filter,filterType');

			$tagString=$db->escape($db->lessen(UTF8::correct(implode(', ',$item['tags']))));

			list($globalFilter,$blackFilter,$globalFilterType,$blackFilterType) = Settings::gets('filter,blackfilter,filterType,blackfilterType');
			$filter = empty($globalFilter)?$localFilter:$globalFilter;
			$filterType = empty($globalFilter)?$localFilterType:$globalFilterType;


			if (!Validator::is_empty($filter)) {
				$filtered = true;				
				$allowTags = explode(',', $filter);

				if($filterType == 'tag' || $filterType == 'tag+title') {					
					foreach ($allowTags as $ftag) {
						if (Validator::enum($ftag, $tagString)) {
							$filtered = false;
							break;
						}
					}
				}

				if($filtered && ($filterType == 'title' || $filterType == 'tag+title')) {
					foreach ($allowTags as $ftag) {
						if(strpos($item['title'],$ftag)!==false) {
							$filtered = false;
							break;
						}
					}
				}

				if ($filtered) return false;
			}

			if (!Validator::is_empty($blackFilter)) {
				$filtered = false;
				$denyTags = explode(',', $blackFilter);
				if($blackFilterType == 'tag' || $blackFilterType == 'tag+title') {					
					foreach ($denyTags as $ftag) {
						if (Validator::enum($ftag, $tagString)) {
							$filtered = true;
							break;
						}
					}
				}
				if($filtered && ($filterType == 'title' || $filterType == 'tag+title')) {
					foreach ($denyTags as $ftag) {
						if(strpos($item['title'],$ftag)!==false) {
							$filtered = true;
							break;
						}
					}
				}

				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;
//.........这里部分代码省略.........
开发者ID:ncloud,项目名称:bloglounge,代码行数:101,代码来源:LZ.PHP.Feeder.php


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