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


PHP Validator::is_digit方法代码示例

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


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

示例1: if

	$searchType = $accessInfo['action'];
	$searchKeyword = func::decode($accessInfo['value']);

	if ($searchType=='tag') {
    } else if ($searchType=='blogURL') { // 블로그주소			
		if(!empty($searchKeyword)) {
			$searchFeedId = Feed::blogURL2Id('http://'.str_replace('http://', '', $searchKeyword));
			$searchExtraValue = $searchFeedId;
		}
	} else if($searchType=='archive') { // 날짜..
		$targetDate = (!Validator::is_digit($searchKeyword) || strlen($searchKeyword) != 8) ? date("Ymd") : $searchKeyword;
		$tDate = substr($targetDate, 0, 4).'-'.substr($targetDate, 4, 2).'-'.substr($targetDate, 6, 2);
		$tStart = strtotime("$tDate 00:00:00");

		if(isset($accessInfo['pass'][0]) && Validator::is_digit($accessInfo['pass'][0]) && strlen($accessInfo['pass'][0]) == 8) {
			$targetDate = $accessInfo['pass'][0];
			$tDate = substr($targetDate, 0, 4).'-'.substr($targetDate, 4, 2).'-'.substr($targetDate, 6, 2);
			$tEnd = strtotime("$tDate 00:00:00");
			$searchExtraValue = array('start'=>$tStart,'end'=>$tEnd);
		} else {
			$searchExtraValue = $tStart;
		}
	}
	
	

	include ROOT . '/lib/begin.php';

	$customQuery = $event->on('Query.feedItems', '');
开发者ID:ncloud,项目名称:bloglounge,代码行数:29,代码来源:search.php

示例2: date

						}								
						
						$s_feedrecent .= $skin->dressOn('feedrecent_rep', $src_feedrecent_rep, $sp_feedrecent_rep, $src_feedrecent);

					} else {
						$s_feedrecent = '';
					}

				$sp_feeds = $skin->parseTag('feed_position', ($index==1?'firstItem':($index==count($feeds)?'lastItem':'')), $sp_feeds);

				$sp_feeds = $skin->dressOn('feedrecent', $src_feedrecent, $s_feedrecent, $sp_feeds);

				$sp_feeds = $skin->parseTag('feeds_desc', $event->on('Text.feedDescription', UTF8::lessenAsByte($feed['description'], 200)), $sp_feeds);
				$sp_feeds = $skin->parseTag('feeds_blogurl', $feed['blogURL'], $sp_feeds);
				$sp_feeds = $skin->parseTag('feeds_created', $event->on('Text.feedCreated', (Validator::is_digit($feed['created']) ? date('Y-m-d H:i', $feed['created']) : $feed['created'])), $sp_feeds);
				$sp_feeds = $skin->parseTag('feeds_lastupdate', $event->on('Text.feedLastupdate', (Validator::is_digit($feed['lastUpdate']) ? date('Y-m-d H:i', $feed['lastUpdate']) : $feed['lastUpdate'])), $sp_feeds);
				//$sp_feeds = $skin->parseTag('feeds_search_url', $service['path'].'/?blogURL='.str_replace('http://','',Func::lastSlashDelete($feed['blogURL'])), $sp_feeds);
				$sp_feeds = $skin->parseTag('feeds_linkurl', $service['path'].'/blog/'.$feed['id'], $sp_feeds);
				$sp_feeds = $skin->parseTag('feeds_feedurl', $service['path'].'/rss/blog/'.$feed['id'], $sp_feeds);

				$s_feeds_rep .= $event->on('Text.feed', $sp_feeds);
				$sp_feeds = '';
			}		

			$s_feeds = $skin->dressOn('feedlist_rep', $src_feed_rep, $s_feeds_rep, $src_feeds);

		} else {
			$s_feeds_rep = '<div class="no_article">'._t("블로그 목록이 비어있습니다.").'</div>';	
			$s_feeds = $skin->dressOn('feedlist_rep', $src_feed_rep, $s_feeds_rep, $src_feeds);
		}
开发者ID:ncloud,项目名称:bloglounge,代码行数:30,代码来源:feedlist.php

示例3: _t

	if (Validator::getBool(Settings::get('restrictBoom')) && !isLoggedIn()) {
		$response['error'] = 1;
		$response['message'] = _t('로그인 한 사람만 이 기능을 사용할 수 있습니다');
		func::printRespond($response);
	}

	requireComponent('Bloglounge.Model.Boom');

	if (!Validator::enum($_POST['direction'], 'up,down')) {
		$response['error'] = 1;
		$response['message'] = $_POST['direction'].'is undefined direction';
		func::printRespond($response);
	}

	if (!Validator::is_digit($_POST['itemId'])) {
		$response['error'] = 1;
		$response['message'] = 'illegal id';
	}
	$itemId = $_POST['itemId'];

	switch($_POST['direction']) {
		case 'up':				
			if (isLoggedIn()) {
				$userid = $session['id'];
				$boomedUp = Boom::isBoomedUp($itemId, 'userid', $userid);	
			} else {
				$ip = $_SERVER['REMOTE_ADDR'];
				$boomedUp = Boom::isBoomedUp($itemId, 'ip', $ip);	
			}			
开发者ID:ncloud,项目名称:bloglounge,代码行数:29,代码来源:index.php

示例4: htmlspecialchars

		if(!empty($thumbnailFile)) {
			$s_thumbnail = (!Validator::is_empty($thumbnailFile)) ? $skin->parseTag('thumbnail', $thumbnailFile, $src_thumbnail) : '';
			$skin->dress('cond_thumbnail', $s_thumbnail);		
			$skin->replace('thumbnail_exist', 'thumbnail_exist');
		} else {
			$skin->dress('cond_thumbnail', '');
			$skin->replace('thumbnail_exist', 'thumbnail_nonexistence');
		}

		$skin->replace('id', $linker_post['id']);		
		$skin->replace('permalink',  htmlspecialchars($linker_post['permalink']));
		
		$skin->replace('tags', $event->on('Text.linker.tags',UTF8::clear($linker_post['tags'])));

		$skin->replace('date', $event->on('Text.linker.date',(Validator::is_digit($linker_post['written']) ? date('Y-m-d h:i a', $linker_post['written']) : $linker_post['written'])));
		$skin->replace('view', $linker_post['click']);


		$linker_post['description'] = func::stripHTML($linker_post['description'].'>');
		if (substr($linker_post['description'], -1) == '>') $linker_post['description'] = substr($linker_post['description'], 0, strlen($linker_post['description']) - 1);
		$description = $linker_post['description'];
		if (strlen(trim($description)) == 0) $description = _t('(글의 앞부분이 이미지 혹은 HTML 태그만으로 되어있습니다)');

		$skin->replace('description_slashed', addslashes($post_description));
		$skin->replace('description', $event->on('Text.linker.description', $post_description));
		$skin->replace('blogname', UTF8::clear(Feed::get($linker_post['feed'], 'title')));
		$skin->replace('blogurl', htmlspecialchars(Feed::get($linker_post['feed'], 'blogURL')));
	
		$skin->replace('boom_rank', Boom::getRank($linker_post['id']));				
		$skin->replace('boom_rank_id', 'boomRank'.$linker_post['id']);
开发者ID:ncloud,项目名称:bloglounge,代码行数:30,代码来源:linker.php

示例5: htmlspecialchars

				$sp_booms = $skin->dressOn('cond_boom_thumbnail', $src_thumbnail, $s_thumbnail, $src_booms_rep);		
				$sp_booms = $skin->parseTag('boom_thumbnail_exist', 'boom_thumbnail_exist', $sp_booms);
			} else {
				$sp_booms = $skin->dressOn('cond_boom_thumbnail', $src_thumbnail, '', $src_booms_rep);
				$sp_booms = $skin->parseTag('boom_thumbnail_exist', 'boom_thumbnail_nonexistence', $sp_booms);
			}

			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$item['id'] : $service['path'].'/go/'.$item['permalink'];

			$sp_booms = $skin->parseTag('boom_url', htmlspecialchars($item['permalink']), $sp_booms);		
			$sp_booms = $skin->parseTag('boom_link_url', $link_url , $sp_booms);
			$sp_booms = $skin->parseTag('boom_title', UTF8::clear(UTF8::lessenAsByte(func::stripHTML($item['title']), $skinConfig->boomTitleLength)), $sp_booms);

			$sp_booms = $skin->parseTag('boom_description', UTF8::clear(UTF8::lessenAsByte(func::htmltrim(func::stripHTML($item['description'])),$skinConfig->boomDescLength)), $sp_booms);
			$sp_booms = $skin->parseTag('boom_author', UTF8::clear($item['author']), $sp_booms);
			$sp_booms = $skin->parseTag('boom_date', (Validator::is_digit($item['written']) ? date('Y-m-d', $item['written']) : $item['written']), $sp_booms);

			$s_booms_rep .= $sp_booms;
			$sp_booms = '';
		}		
		$s_booms = $skin->dressOn('boom_rep', $src_booms_rep, $s_booms_rep, $src_booms);
	} else {
		$s_booms = '';
	}
	$skin->dress('boom', $s_booms);

	// ** 태그 클라우드
	$skin->dress('tagcloud', SkinElement::getTagCloud($skinConfig->tagCloudOrder, $skinConfig->tagCloudLimit));

	// ** 달력
	$skin->replace('calendar', SkinElement::getCalendarView((($searchType=='archive')&&!empty($searchKeyword)) ? substr($searchKeyword, 0, 6) : null));
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:skin.begin.php

示例6: htmlspecialchars

			}

			$sp_post = $skin->parseTag('post_id', $post['id'], $sp_post);
			
			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$post['id'] : $service['path'].'/go/'.htmlspecialchars($post['permalink']);
			$sp_post = $skin->parseTag('post_url',  $event->on('Text.postURL',$link_url), $sp_post);	
			$sp_post = $skin->parseTag('post_permalink',  htmlspecialchars($post['permalink']), $sp_post);

			$sp_post = $skin->parseTag('post_visibility', (($post['visibility'] == 'n' || $post['feedVisibility'] == 'n') ? 'hidden' : 'visible' ), $sp_post);

			$sp_post = $skin->parseTag('post_title', UTF8::clear($event->on('Text.postTitle', func::stripHTML($post['title']))), $sp_post);
			$sp_post = $skin->parseTag('post_author', UTF8::clear($event->on('Text.postAuthor',$post['author'])), $sp_post);

			list($post_category) = explode(',', UTF8::clear($post['tags']), 2);
			$sp_post = $skin->parseTag('post_category', $post_category, $sp_post);
			$sp_post = $skin->parseTag('post_date', $event->on('Text.postDate',(Validator::is_digit($post['written']) ? date('Y-m-d h:i a', $post['written']) : $post['written'])), $sp_post);
			$sp_post = $skin->parseTag('post_view', $post['click'], $sp_post);

			$post_description = $event->on('Text.postDescription', $post['description']);
			$post_description = str_replace('/cache/images/',$service['path'] . '/cache/images/', $post_description);

			$sp_post = $skin->parseTag('post_description', $post_description, $sp_post);
			$sp_post = $skin->parseTag('post_blogname', UTF8::clear(Feed::get($post['feed'], 'title')), $sp_post);
			$sp_post = $skin->parseTag('post_blogurl', htmlspecialchars(Feed::get($post['feed'], 'blogURL')), $sp_post);
			$sp_post = $skin->parseTag('post_bloglink', $service['path'].'/blog/'.Feed::get($post['feed'], 'id') , $sp_post);
			
			$sp_post = $skin->parseTag('boom_rank', Boom::getRank($post['id']), $sp_post);	
			$sp_post = $skin->parseTag('boom_rank_id', 'boomRank'.$post['id'], $sp_post);
			$sp_post = $skin->parseTag('boom_rank_class', 'boom_rank_'.Boom::getRank($post['id']), $sp_post);
			$sp_post = $skin->parseTag('boomup_count', $post['boomUp'], $sp_post);		
			$sp_post = $skin->parseTag('boomdown_count', $post['boomDown'], $sp_post);
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:post.php

示例7: getLatestPost

		/** gets **/

		function getLatestPost($feedId) {
			global $database, $db;
			if (!isset($feedId) || !Validator::is_digit($feedId) || !Feed::doesExistFeedId($feedId))
				return false;

			if (!$db->query("SELECT id, permalink, title, written FROM {$database['prefix']}FeedItems WHERE feed='{$feedId}' AND visibility!='d' ORDER BY written DESC LIMIT 0,1"))
				return false;
			if ($db->numRows() < 1)
				return false;

			$post = $db->fetch();
			$db->free();

			$recent = array();	

			$recent['id'] = $post->id;
			$recent['url'] = $post->permalink;
			$recent['title'] = $post->title;
			$recent['date'] = date("Y.m.d H:i", $post->written);

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

示例8: substr

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

	// 글 목록
	$action = func::decode($accessInfo['action']);

	$searchType = 'archive';
	
	if((Validator::is_digit($action) && strlen($action) == 8)) {
		$targetDate = $searchKeyword = $action;
		$tDate = substr($targetDate, 0, 4).'-'.substr($targetDate, 4, 2).'-'.substr($targetDate, 6, 2);
		$tStart = strtotime("$tDate 00:00:00");
		
		if(isset($accessInfo['value']) && Validator::is_digit($accessInfo['value']) && strlen($accessInfo['value']) == 8) {
			$targetDate = $accessInfo['value'];
			$tDate = substr($targetDate, 0, 4).'-'.substr($targetDate, 4, 2).'-'.substr($targetDate, 6, 2);
			$tEnd = strtotime("$tDate 00:00:00");
			$searchExtraValue = array('start'=>$tStart,'end'=>$tEnd);
		} else {
			$searchExtraValue = $tStart;
		}
	} else {
		switch($action) {
			case 'yesterday':		
				$searchKeyword = date('Ymd',mktime()-86400);
				$searchExtraValue = strtotime( $searchKeyword . ' 00:00:00');
			break;
			case 'today':	
			default:
				$searchKeyword = date('Ymd',mktime());
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:day.php


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