static function lessenAsEncoding($str, $length = 255, $tail = '...')
 {
     $context = \CADB\Model\Context::getInstance();
     if ($context->getProperty('database.utf8') != true) {
         return UTF8::lessen($str, $length, $tail);
     } else {
         return UTF8::lessenAsByte($str, $length, $tail);
     }
 }
Exemple #2
0
							$s_feedrecent_rep = $skin->parseTag('feeds_recent_title', $recent['title'], $s_feedrecent_rep);
							$s_feedrecent_rep = $skin->parseTag('feeds_recent_date', date('Y-m-d H:i',$recent['written']), $s_feedrecent_rep);
							$sp_feedrecent_rep .= $s_feedrecent_rep;
						}								
						
						$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>';	
Exemple #3
0
		function lessen($str, $length = 255, $tail = '..') {
			global $database;
			return ($database['utf8']) ? UTF8::lessen($str, $length, $tail) : UTF8::lessenAsByte($str, $length, $tail);
		}
Exemple #4
0
	function getIssueFocus($input, $config) {
		global $database, $db, $skin, $event, $service, $accessInfo;

		// 첫페이지에만 보이기 ..
		if(!(empty($accessInfo['controller']) && ($accessInfo['page']==1))) {
			return $input;
		}

		$pluginURL = $event->pluginURL;
		requireComponent('LZ.PHP.Media');

		if(!isset($config['tabDelay'])) {
			$config['tabDelay'] = 0;
		}

		// css
		ob_start();
?>
<style type="text/css"> 
		.issueFocus { border:1px solid #dbdbdb; }
			.issueFocus ul.menu { width:100%; list-style:none; padding:0; margin:0; color:#999999; letter-spacing:2px;background:url("<?php echo $pluginURL;?>/images/bg_dot.gif") repeat-x bottom #fbfbfb; height:28px;  }
			.issueFocus ul.menu li { float:left; padding:8px; padding-left:10px; padding-right:10px; border-right:1px solid #eaeaea; height:11px; cursor:pointer; }
				.issueFocus ul.menu li.selected {font-weight:bold; color:#0f0f0f; background:#ffffff; border-right:1px solid #dbdbdb; height:12px; }
		
			.issueFocus ul.item { list-style:none; padding:10px; padding-bottom:0px; margin:0; display:none; overflow:hidden;  }
				.issueFocus ul.viewed { display:block; }
			.issueFocus ul.item li { padding-top:5px; padding-bottom:5px; }
				.issueFocus ul.item li.empty { color:#aaa; font-size:11px; padding-bottom:14px; }
				
				.issueFocus ul.item li .thumbnail { float:left; margin-right:10px; width:60px; }
					.issueFocus ul.item li .thumbnail img { width:50px; border:1px solid #ddd; padding:2px; }

				.issueFocus ul.item li .data { float:left; width:670px; padding-top:3px; }
					.issueFocus ul.item li .data h3 { font-size:13px; color:#595959; font-weight:bold; margin:0; margin-bottom:6px; }
						.issueFocus ul.item li .data h3 a { color:#595959; text-decoration:none; }
						.issueFocus ul.item li .data h3 a:hover { text-decoration:underline; }

					.issueFocus ul.item li .data .desc { color:#aaa; line-height:16px; font-size:11px; }

				.issueFocus ul.item li .data2 { width: 745px; }
		
		.issueFocus_shadow { height:0px; font-size:0; border-top:1px solid #f5f5f5; margin-bottom:15px; }
</style>
<?php
		$css = ob_get_contents();
		ob_end_clean();
		
		$skin->css($css);

		// js
		ob_start();
?>
<script type="text/javascript"> 
		var issueFocusTabIntervalId = 0;

		function issueFocusMouseOverMenu(id) {	
<?php
	if($config['tabDelay']>0) {
?>
			if(issueFocusTabIntervalId!=0) {
				clearInterval(issueFocusTabIntervalId);
				issueFocusTabIntervalId = 0;
			}

			issueFocusTabIntervalId = setInterval( function() {
<?php
	}
?>
				var menu = $("#"+id+"_menu");
				var item = $("#"+id+"_item");

				$('._issueFocus_menu').each( function() {
					$(this).removeClass('selected');
				});
				$('._issueFocus_item').each( function() {
					$(this).removeClass('viewed');
				});

				menu.addClass('selected');
				item.addClass('viewed');	
<?php
	if($config['tabDelay']>0) {
?>				
				clearInterval(issueFocusTabIntervalId);
				issueFocusTabIntervalId = 0;
			},<?php echo $config['tabDelay'];?>);
<?php
	}
?>
		}

		function issueFocusMouseOut() {		
			if(issueFocusTabIntervalId!=0) {
				clearInterval(issueFocusTabIntervalId);
				issueFocusTabIntervalId = 0;
			}
		}
</script>
<?php
		$javascript = ob_get_contents();
		ob_end_clean();
		
		$skin->javascript($javascript);

		if($config['issueType'] == 'auto') {
			$issueTags = Tag::getIssueTags($config['issueCount']);
		} else {
			$issueTags = explode(',', $config['issueTag']);
			foreach($issueTags as $key=>$tag) {
				$issueTags[$key] = array('name'=>trim($tag));
			}
		}

		ob_start();
?>
		<div class="issueFocus">
			<ul class="menu" onmouseout="issueFocusMouseOut();">
<?php
		// 포커스

		if($config['useFocus']) {
			$focusFeedItems = FeedItem::getRecentFocusFeedItems($config['focusCount']);
?>
				<li id="_issueFocus_focus_menu" class="selected _issueFocus_menu" onclick="goto('<?php echo $service['path'];?>/focus'); return false;" onmouseover="issueFocusMouseOverMenu('_issueFocus_focus');">포커스</li>
<?php
		}
		
		// 이슈태그

		$index = 0;
		foreach($issueTags as $key=>$tag) {
			list($issueTags[$key]['feedItems'], $totalFeedItemCount) = FeedItem::getFeedItems('tag', $tag['name'], null, 1, $config['issueFeedCount']);
			$index++;
?>	
			<li id="_issueFocus_<?php echo $index;?>_menu" class="<?php echo (!$config['useFocus']&&($index==1))?'selected ':'';?>_issueFocus_menu" onclick="goto('<?php echo $service['path'];?>/search/tag/<?php echo rawurlencode($tag['name']);?>'); return false;" onmouseover="issueFocusMouseOverMenu('_issueFocus_<?php echo $index;?>');" title="클릭하시면 태그검색이 가능합니다."><?php echo $tag['name'];?></li>
<?php
		}
?>
			</ul>

			<div class="clear"></div>
<?php
		// 포커스 내용
		if($config['useFocus']) {
?>
			<ul id="_issueFocus_focus_item" class="item _issueFocus_item viewed">
<?php
	if(count($focusFeedItems)>0) {
		foreach($focusFeedItems as $feedItem) {
			$thumbnailFile = '';
			if($media = Media::getMedia($feedItem['thumbnailId'])) {
				$thumbnailFile = Media::getMediaFile($media['thumbnail']);
			}

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

?>
			<li>
<?php
			if(!empty($thumbnailFile)) {
?>
				<div class="thumbnail">
					<img src="<?php echo $thumbnailFile;?>" alt="미리보기" />
				</div>
<?php
			}
?>
				<div class="data <?php echo empty($thumbnailFile)?'data2':'';?>">
					<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['title']),$config['issueTitleLength']);?></a></h3>
					<div class="desc">
						<?php echo UTF8::lessenAsByte(func::htmltrim(func::stripHTML($feedItem['description'])),$config['issueDescLength']);?>
					</div>
				</div>

				<div class="clear"></div>
			</li>
<?php
		}
	} else {
?>
			<li class="empty">포커스로 지정된 글이 없습니다.</li>
<?php
	}
?>
			</ul>
<?php
		}

		// 이슈태그 내용

		$index = 0;
		foreach($issueTags as $tag) {
			$index ++;
?>
			<ul id="_issueFocus_<?php echo $index;?>_item" class="item _issueFocus_item<?php echo (!$config['useFocus']&&($index==1))?' viewed':'';?>">
<?php
	if(count($tag['feedItems'])>0) {
		foreach($tag['feedItems'] as $feedItem) {
			$thumbnailFile = '';
			if($media = Media::getMedia($feedItem['thumbnailId'])) {
				$thumbnailFile = Media::getMediaFile($media['thumbnail']);
			}		
			
			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$feedItem['id'] : $service['path'].'/go/'.$feedItem['permalink'];

?>
			<li>
<?php
			if(!empty($thumbnailFile)) {
?>
				<div class="thumbnail">
					<img src="<?php echo $thumbnailFile;?>" alt="미리보기" />
				</div>
<?php
			}
?>
				<div class="data <?php echo empty($thumbnailFile)?'data2':'';?>">
					<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['title']),60);?></a></h3>
					<div class="desc">
						<?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['description']),$config['issueDescLength']);?>
					</div>
				</div>

				<div class="clear"></div>
			</li>
<?php
		}
	}
?>
			</ul>
<?php
		}
?>
		</div>
		<div class="issueFocus_shadow"></div>
<?php
		$result = ob_get_contents();
		ob_end_clean();

		return $input . $result;
	}
Exemple #5
0
			if(!empty($thumbnailFile)) {
				$s_thumbnail = (!Validator::is_empty($thumbnailFile)) ? $skin->parseTag('boom_thumbnail', $thumbnailFile, $src_thumbnail) : '';
				$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));
Exemple #6
0
	if(isset($categories)) {
		$s_categories = '';
		$src_categories = $skin->cutSkinTag('categorylist');	
		$subpath = empty($accessInfo['subpath'])?'':'/'.func::firstSlashDelete($accessInfo['subpath']);
		
		$skinConfig->categoryListNameLength = 30;

		if(count($categories) > 0) {
			$s_categories_rep = '';
			$src_category_rep = $skin->cutSkinTag('categorylist_rep');		
			$index = 0;
			foreach ($categories as $category) {	
				$index ++;
				$category = $event->on('Data.category', $category);
				
				$sp_categories = $skin->parseTag('category_name', $event->on('Text.categoryName', UTF8::lessenAsByte($category['name'], $skinConfig->categoryListNameLength)), $src_category_rep);

				$s_categoryrecent = '';
				$src_categoryrecent = $skin->cutSkinTag('categoryrecent');
				$src_categoryrecent_rep = $skin->cutSkinTag('categoryrecent_rep');
				$s_categoryrecent_rep = '';

					if ($category['posts']) {	
						$sp_categoryrecent_rep = '';
						foreach($category['posts'] as $post) {
							$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$post['id'] : $service['path'].'/go/'.$post['permalink'];

							$post['thumbnail'] = '';
							if($media = Media::getMedia($post['thumbnailId'])) {
								$post['thumbnail'] = $media['thumbnail'];	
							}
Exemple #7
0
	function getMagazineFocus($input, $config) {	
		global $database, $db, $skin, $event, $service, $accessInfo;

		// 첫페이지에만 보이기 ..
		/*
		if(!(empty($accessInfo['controller']) && ($accessInfo['page']==1))) {
			return $input;
		}
		*/

		$pluginURL = $event->pluginURL;
		requireComponent('LZ.PHP.Media');

		if(!isset($config['tabDelay'])) {
			$config['tabDelay'] = 0;
		}
		
		ob_start();
?>
		<style type="text/css">
			.magazineFocusWrap {  padding-top:10px; }
				.magazineFocusTable { width:100%; border:5px solid #b2c941; }
				.magazineFocusTable .leftTab { width:166px; overflow:hidden; background:url("<?php echo $pluginURL;?>/images/bg_left_tab.gif") repeat-y right #fafafa; vertical-align:top; }
					.magazineFocusTable .leftTab ul { list-style:none; margin:0; padding:0; }
						.magazineFocusTable .leftTab ul li { color:#989898; padding-left:20px; padding-top:8px; padding-bottom:8px; margin-right:1px; background:url("<?php echo $pluginURL;?>/images/bg_left_line.gif") repeat-x top; cursor:pointer; font-size:13px; }
						
						.magazineFocusTable .leftTab ul li a { color:#989898; text-decoration:none; }

						.magazineFocusTable .leftTab ul li.first { background-image:none; }
						.magazineFocusTable .leftTab ul li.selected { background-color:#ffffff; margin-right:0; color:#333; font-weight:bold; }
						.magazineFocusTable .leftTab ul li.selected span { background:url("<?php echo $pluginURL;?>/images/bg_left_select.gif") no-repeat right; padding-right:14px; }

						.magazineFocusTable .leftTab ul li.selected a { color:#333; }

						.magazineFocusTable .leftTab ul li.dummy { cursor:default; }
				
				.magazineFocusTable .mainData { vertical-align:top; }

					.magazineFocusTable .mainData ul.item { list-style:none; padding:10px; padding-right:0; padding-bottom:0px; margin:0; display:none; overflow:hidden;  }
						.magazineFocusTable .mainData ul.viewed { display:block; }
					.magazineFocusTable .mainData ul.item li { width:430px; height:68px; padding-bottom:5px; margin-bottom:10px; overflow:hidden; border-bottom:1px solid #ececec; }
						.magazineFocusTable .mainData ul.item li.empty { color:#aaa; font-size:11px; padding-bottom:14px; }
						
						.magazineFocusTable .mainData ul.item li .thumbnail { float:left; margin-right:10px; width:62px; }
							.magazineFocusTable .mainData ul.item li .thumbnail img { width:62px; }

						.magazineFocusTable .mainData ul.item li .data { float:left; width:350px; }
							.magazineFocusTable .mainData ul.item li .data h3 { font-size:14px; color:#595959; font-weight:bold; margin:0; margin-bottom:2px; }
								.magazineFocusTable .mainData ul.item li .data h3 a { color:#4e4e4e; text-decoration:none; }
								.magazineFocusTable .mainData ul.item li .data h3 a:hover { text-decoration:underline; }
							
							.magazineFocusTable .mainData ul.item li .permalink { font-size:11px; margin-bottom:8px; height:12px; line-height:12px; overflow:hidden; }
								.magazineFocusTable .mainData ul.item li .permalink a { color:#909090; text-decoration:none; }
								.magazineFocusTable .mainData ul.item li .permalink a:hover { text-decoration:underline; }

							.magazineFocusTable .mainData ul.item li .data .desc { color:#5d5d5d; line-height:14px; font-size:11px; }

						.magazineFocusTable .mainData ul.item li .data2 { width: 430px; }

						.magazineFocusTable .mainData ul.item li.title_only { padding-bottom:0; border:0; height:14px; background:url("<?php echo $pluginURL;?>/images/bg_li.gif") no-repeat 0px 6px; padding-left:8px; letter-spacing:0px; }
							.magazineFocusTable .mainData ul.item li.title_only a { color:#4e4e4e; text-decoration:none; }
							.magazineFocusTable .mainData ul.item li.title_only a:hover { text-decoration:underline; }

							.magazineFocusTable .mainData ul.item li.title_only .sep { color:#eee; }
							.magazineFocusTable .mainData ul.item li.title_only .feedTitle { color:#999; font:11px Dotum; }
			
				.magazineFocusTable .focusImageWrap { padding:5px;  }
				.magazineFocusTable .focusImageWrap .focusImageDataWrap { padding:10px; padding-bottom:0px; background:url("<?php echo $pluginURL;?>/images/bg.gif") repeat-x; }
				.magazineFocusTable .focusImageWrap .focusImageDatas { float:left; width: 300px; height:164px; position: relative; overflow: hidden; }
				
					.magazineFocusTable .focusImageWrap #focusImageData { position:absolute; z-index:98; }
					
						.magazineFocusTable .focusImageWrap .focusImage { position:absolute; width: 300px; height: 160px; overflow:hidden; }
							.magazineFocusTable .focusImageWrap .focusImage img { width:300px; height: 344px; }

						.magazineFocusTable .focusImageWrap .focusShadow { position:absolute;  top:160px; width:300px; height:4px; background:url("<?php echo $pluginURL;?>/images/bg_image_shadow.gif") repeat-x; font-size:0; line-height:0; z-index:102; }
						
						.magazineFocusTable .focusImageWrap .focusTitleBG { width:300px; position:absolute; height:40px; background:#000000; opacity:0.3; filter: alpha(opacity = 30); z-index: 100; }
						
						.magazineFocusTable .focusImageWrap .focusImageTitle { width: 300px; color:#ffffff;  position:absolute; top:137px; padding:5px; z-index: 101; font-size:13px; line-height:15px; }

							.magazineFocusTable .focusImageWrap .focusImageTitle a { color:#ffffff; text-decoration:none; font-weight:bold; }
							.magazineFocusTable .focusImageWrap .focusImageTitle a:hover { text-decoration:underline; }	

							.magazineFocusTable .focusImageWrap .focusImageTitle .blogtitle { font-size:11px; color:#cdcdcd; }

				.magazineFocusTable .focusImageWrap .focusImageNav { float:left; margin-left:14px; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul { list-style:none; margin:0; padding:0; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul li { margin-bottom:6px; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul li .thumbnail { width:30px; height:30px; overflow:hidden; border:1px solid #000; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul li .thumbnail img { height:30px; }

					.magazineFocusTable .focusImageWrap .focusImageNav ul li.selected .thumbnail { opacity:0.5; filter: alpha(opacity = 50); }

					.magazineFocusTable .focusImageWrap .focusImageNav ul li .shadow { width:32px; height:4px; background:url("<?php echo $pluginURL;?>/images/bg_image_shadow.gif") repeat-x; font-size:0; line-height:0; }

					.magazineFocusTable .focusImageEmpty { text-align: center; color: #999; }					
		</style>
<?php
		$css = ob_get_contents();
		ob_end_clean();

		$skin->css($css);

		ob_start();
?>
	<script type="text/javascript"> 		
		var magazineFocusTabIntervalId = 0;

		function magazineFocusMouseOverMenu(id) {	
<?php
	if($config['tabDelay']>0) {
?>
			if(magazineFocusTabIntervalId!=0) {
				clearInterval(magazineFocusTabIntervalId);
				magazineFocusTabIntervalId = 0;
			}

			magazineFocusTabIntervalId = setInterval( function() {
<?php
	}
?>
				var menu = $("#"+id+"_menu");
				var item = $("#"+id+"_item");

				$('._magazineFocus_menu').each( function() {
					$(this).removeClass('selected');
				});
				$('._magazineFocus_item').each( function() {
					$(this).removeClass('viewed');
				});

			menu.addClass('selected');
			item.addClass('viewed');	
<?php
		if($config['tabDelay']>0) {
?>				
				clearInterval(magazineFocusTabIntervalId);
				magazineFocusTabIntervalId = 0;
			},<?php echo $config['tabDelay'];?>);
<?php
		}
?>
		}
		function magazineFocusMouseOut() {		
			if(magazineFocusTabIntervalId!=0) {
				clearInterval(magazineFocusTabIntervalId);
				magazineFocusTabIntervalId = 0;
			}
		}
		var lastSelectFocusImage = null;
		function moveFocusImagePosition(objId,pos) {
		//	$("#focusImageData").animate({'top':pos+'px'},'fast');
			$("#focusImageData").css('top',pos+'px');

			var obj = $("#"+objId);
			if(lastSelectFocusImage!=null) {
				lastSelectFocusImage.removeClass('selected');
			}
			obj.addClass('selected');
			lastSelectFocusImage = obj;
		}
	</script>
<?php
		$javascript = ob_get_contents();
		ob_end_clean();
		
		$skin->javascript($javascript);
		
		// 포커스이미지
		$count = 4;

		$focusImages = $db->queryAll('SELECT fi.id,fi.feed,fi.permalink,fi.title,fi.description,fi.author,fi.written,m.source FROM '.$database['prefix'].'FeedItems fi LEFT JOIN '.$database['prefix'].'Medias m ON ( m.feeditem = fi.id ) WHERE fi.focus = "y" AND fi.visibility = "y" AND m.width >= 300 GROUP BY fi.id ORDER BY fi.written DESC LIMIT '. $count);
		
		$path = ROOT . '/cache/thumbnail/m_focus';
		if (!is_dir($path)) {
			mkdir($path);
			@chmod($path, 0777);
		}
		
		$media = new Media;
		foreach($focusImages as $item) {
			if(!file_exists($path.'/'.$item['id'].'.jpg')) {
				$media->getThumbnail($item['source'], 350, 160, $path, $item['id'], 'crop');
			}
		}
		
		// 이슈태그
		
		if($config['issueType'] == 'auto') {
			$issueTags = Tag::getIssueTags($config['issueCount']);
		} else {
			$issueTags = explode(',', $config['issueTag']);
			foreach($issueTags as $key=>$tag) {
				$issueTags[$key] = array('name'=>trim($tag));
			}
		}
	
		// 이슈태그

		ob_start();
?>
		<div class="magazineFocusWrap">
			<table class="magazineFocusTable" cellpadding="0" cellspacing="0">
				<tr>
					<td class="leftTab">
						<ul>
<?php
			$index = 0;
			foreach($issueTags as $key=>$tag) {
				list($issueTags[$key]['feedItems'], $totalFeedItemCount) = FeedItem::getFeedItems('tag', $tag['name'], null, 1, $config['issueFeedCount']);
				$index++;
?>
							<li id="_magazineFocus_<?php echo $index;?>_menu" class="<?php echo ($index==1)?'first selected ':'';?>_magazineFocus_menu" onclick="goto('<?php echo $service['path'];?>/search/tag/<?php echo rawurlencode($tag['name']);?>'); return false;" onmouseover="magazineFocusMouseOverMenu('_magazineFocus_<?php echo $index;?>');" title="클릭하시면 태그검색이 가능합니다."><span><?php echo UTF8::lessen($tag['name'],10);?></span></li>
<?php
		}
?>							<li class="dummy"></li>
						</ul>
					</td>
					<td class="mainData">
<?php
	// 이슈태그 내용
	$index = 0;
	foreach($issueTags as $tag) {
		$index ++;
?>
						<ul id="_magazineFocus_<?php echo $index;?>_item" class="item _magazineFocus_item<?php echo ($index==1)?' viewed':'';?>">
<?php
	if(count($tag['feedItems'])>0) {
			$feedItem = current($tag['feedItems']);

			$thumbnailFile = '';
			if($media = Media::getMedia($feedItem['thumbnailId'])) {
				$thumbnailFile = Media::getMediaFile($media['thumbnail']);
			}			
			
			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$feedItem['id'] : $service['path'].'/go/'.$feedItem['permalink'];

?>
							<li>
<?php
			if(!empty($thumbnailFile)) {
?>
								<div class="thumbnail">
									<img src="<?php echo $thumbnailFile;?>" alt="미리보기" />
								</div>
<?php
			}
?>
								<div class="data <?php echo empty($thumbnailFile)?'data2':'';?>">
									<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['title']),60);?></a></h3>
									<div class="permalink">
										<a href="<?php echo $feedItem['permalink'];?>" target="_blank"><?php echo $feedItem['permalink'];?></a>
									</div>
									<div class="desc">
										<?php echo UTF8::lessenAsByte(func::stripHTML($feedItem['description']),140);?>
									</div>
								</div>

								<div class="clear"></div>
							</li>
<?php
			if(count($tag['feedItems'])>1) {
					for($i=1;$i<count($tag['feedItems']);$i++) {
						$tagItem = $tag['feedItems'][$i];

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

?>
							<li class="title_only">
								<a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($tagItem['title']),60);?></a> <span class="sep">|</span> <span class="feedTitle"><?php echo Feed::get($tagItem['feed'],'title');?></span>
							</li>
<?php			
					}
			} else {
?>				
							<li class="title_only"></li>
<?php
			}
	}
?>
						</ul>
<?php
}
?>
					</td>
					<td class="focusImageWrap">
<?php
	if(count($focusImages)) {
?>
					<div class="focusImageDataWrap">
						<div class="focusImageDatas">

						

							<div id="focusImageData">
<?php	
		$i = 1;		
		foreach($focusImages as $focusImage) {
								$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$focusImage['id'] : $service['path'].'/go/'.$focusImage['permalink'];

?>
								<div class="focusImage" style="top:<?php echo ($i-1)*160;?>px; background:url('<?php echo $service['path'];?>/cache/thumbnail/m_focus/<?php echo $focusImage['id'];?>.jpg') no-repeat top center;">
									<a href="<?php echo $link_url;?>" target="_blank"><img src="<?php echo $pluginURL;?>/images/empty.gif" alt="" /></a>
								</div>

								<div class="focusTitleBG" style="top:<?php echo ($i-1)*160 + 120;?>px;"></div>
								<div class="focusImageTitle" style="top:<?php echo ($i-1)*160 + 120;?>px;">	
									<a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte($focusImage['title'],60);?></a><br />
									<span class="blogtitle"><?php echo Feed::get($focusImage['feed'],'title');?></span>
								</div>
<?php
			$i ++;
		}

?>
							</div>		
							<div class="focusShadow">&nbsp;</div>

						</div>
						<div class="focusImageNav">
							<ul>
<?php
		$i = 1;
		foreach($focusImages as $focusImage) {
?>
								<li id="thumbnail<?php echo $i;?>">
									<div class="thumbnail">
										<a href="#" onmouseover="moveFocusImagePosition('thumbnail<?php echo $i;?>',-<?php echo ($i-1)*160;?>);" onclick="return false;"><img src="<?php echo $service['path'];?>/cache/thumbnail/m_focus/<?php echo $focusImage['id'];?>.jpg" alt="썸네일" /></a>
									</div>
									<div class="shadow">&nbsp;</div>
								</li>
<?php		
			$i ++;
		}
?>
							</ul>
						</div>
						<div class="clear"></div>
					</div> <!-- focusImageDataWrap close -->
					
<?php		
	} else {
?>
					<div class="focusImageEmpty">
						포커스로 지정된 글이 없습니다. 
					</div>
<?php	
	}
?>
					</td>
				</tr>
			</table>
		</div>
<?php
		$result = ob_get_contents();
		ob_end_clean();

		return $input . $result;
	}
Exemple #8
0
					$sp_posts = $skin->parseTag('post_link_target',  (Validator::getBool($config->directView)?'_self':'_blank'), $sp_posts);					
					$sp_posts = $skin->parseTag('post_permalink',  htmlspecialchars($item['permalink']), $sp_posts);

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

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

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

					$post_description = func::stripHTML($item['description'].'>');
					if (substr($post_description, -1) == '>') $post_description = substr($post_description, 0, strlen($post_description) - 1);
					$post_description = UTF8::lessenAsByte(func::htmltrim($post_description), $skinConfig->postDescLength);
					if (strlen($post_description) == 0) $post_description = '<span class="empty">'._t('(글의 앞부분이 이미지 혹은 HTML 태그만으로 되어있습니다)').'</span>';					

					$post_description = $event->on('Text.postDescription', $post_description);

					if(!empty($searchKeyword) && in_array($searchType,array('title','description','title+description'))) {
						$keyword_pattern = "/([^<]*)".str_replace("\0","\\0",preg_quote($searchKeyword,"/"))."([^>]*)/i";
						$post_description = preg_replace($keyword_pattern, "\\1<span class=\"point\">" . $searchKeyword . "</span>\\2", $post_description);
					}

					$sp_posts = $skin->parseTag('post_description_slashed', addslashes($post_description), $sp_posts);
					$sp_posts = $skin->parseTag('post_description', $post_description, $sp_posts);

					$post_description = str_replace('/cache/images/',$service['path'] . '/cache/images/', $item['description']);

					$sp_posts = $skin->parseTag('post_description_original', $post_description, $sp_posts);
Exemple #9
0
	function exportFunction_iframe($params, $exportConfig) {
		global $export, $service, $config, $event;
		
		$page = isset($params['get']['page'])?$params['get']['page']:1;
		if($page <= 0) $page = 1;

		$thumbnail = isset($exportConfig) && isset($exportConfig['thumbnail']) ?  Validator::getBool($exportConfig['thumbnail']) : true;
		$pageCount = isset($exportConfig) && isset($exportConfig['count']) ?  $exportConfig['count'] : 10;
		$newWindow = isset($exportConfig) && isset($exportConfig['popup']) ?  Validator::getBool($exportConfig['popup']) : true;
		$categoryView = isset($exportConfig) && isset($exportConfig['category_view']) ?  Validator::getBool($exportConfig['category_view']) : false;
		$focusView = isset($exportConfig) && isset($exportConfig['focus_view']) ?  ($exportConfig['focus_view'] == 'focus' ? true : false) : false;
		
		if($focusView) {
			list($posts, $totalFeedItems) = FeedItem::getFeedItems('focus', 'y', '', $page, $pageCount);
		} else {
			if($categoryView) {
				$categoryValue = isset($exportConfig) && isset($exportConfig['category']) ?  $exportConfig['category'] : '';
				list($posts, $totalFeedItems) = FeedItem::getFeedItems('category', $categoryValue, '', $page, $pageCount);
			} else {
				list($posts, $totalFeedItems) = FeedItem::getFeedItems('', '', '', $page, $pageCount);
			}
		}
		$paging = Func::makePaging($page, $pageCount, $totalFeedItems);

		requireComponent('LZ.PHP.Media');

		ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $config->title;?></title>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $export->exportURL;?>/style.css" />
<link rel="shortcut icon" href="<?php echo $service['path'];?>/images/favicon.ico" />
</head>
<body>
	<div id="export_iframe_wrap">
		<ul>
<?php
		foreach($posts as $post) {	
			$post['thumbnail'] = '';
			if($media = Media::getMedia($post['thumbnailId'])) {
				$post['thumbnail'] = $media['thumbnail'];	
			}
			$thumbnailFile =  $event->on('Text.postThumbnail', Media::getMediaFile($post['thumbnail']));

			$post['description'] = func::stripHTML($post['description'].'>');
			if (substr($post['description'], -1) == '>') $post['description'] = substr($post['description'], 0, strlen($post['description']) - 1);
			$post_description = UTF8::lessenAsByte(func::htmltrim($post['description']), 300);
			if (strlen($post_description) == 0) $post_description = '<span class="empty">'._t('(글의 앞부분이 이미지 혹은 HTML 태그만으로 되어있습니다)').'</span>';					

			$post_description = $event->on('Text.postDescription', $post_description);

?>
			<li class="<?php echo empty($thumbnailFile)||!$thumbnail?'thumbnail_nonexistence':'';?>">
<?php
		if($thumbnail) {

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

			if(!empty($post['thumbnail'])) {
?>
				<div class="thumbnail">
					<a href="<?php echo $link_url;?>" target="<?php echo $newWindow?'_blank':'_parent';?>"><img src="<?php echo $thumbnailFile;?>" alt="thumnail" /></a>
				</div>
<?php
			}
		}
?>
				<div class="data">
					<h3><a href="<?php echo $link_url;?>" target="<?php echo $newWindow?'_blank':'_parent';?>"><?php echo UTF8::clear($event->on('Text.postTitle', func::stripHTML($post['title'])));?></a></h3>
					<p><?php echo $post_description;?></p>
				</div>
				<div class="clear"></div>
			</li>
<?php
		}
?>
		</ul>

		<div class="paging">
			<?php echo func::printPaging($paging);?>
		</div>

	</div>
</body>
</html>
<?php
		$content = ob_get_contents();
		ob_end_clean();

		return $content;
	}
Exemple #10
0
function printCategoryFocusView($categories, $index, $config) {
	global $service, $event;
	$pluginURL = $event->pluginURL;

	if($index < 0 || $index >= count($categories)) {
		return false;
	}
	$category = $categories[$index];
	$result = '';

	$entries = FeedItem::getRecentFeedItemsByCategory($category['id'], $config['categoryFeedCount']+1);
?>
	<div class="title">
		<h3><a href="<?php echo $service['path'];?>/category/<?php echo func::encode($category['name']);?>"><?php echo $category['name'];?></a></h3>
		<div class="more">
			<a href="<?php echo $service['path'];?>/category/<?php echo func::encode($category['name']);?>"><img src="<?php echo $pluginURL;?>/images/bt_more.gif" alt="<?php echo _t('더보기');?>" /></a>
		</div>
		<div class="clear"></div>
	</div>
	<ul>
<?php
		if(count($entries)>0) {
			$entry = $entries[0];
?>
		<li class="detail">
<?php
		$thumbnailFile = '';
		if($media = Media::getMedia($entry['thumbnailId'])) {
			$thumbnailFile = Media::getMediaFile($media['thumbnail']);
		}
		
		$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$entry['id'] : $service['path'].'/go/'.$entry['permalink'];

		if(!empty($thumbnailFile)) {
?>
			<div class="thumbnail">
				<img src="<?php echo $thumbnailFile;?>" alt="<?php echo _t('미리보기 이미지');?>" />
			</div>
			<div class="data">
				<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></h3>
				<div class="desc">
					<?php echo UTF8::lessenAsByte(func::stripHTML($entry['description']),$config['categoryDescLength']);?>
				</div>
			</div>
<?php
		} else {
?>
			<div class="data data_full">
				<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></h3>
				<div class="desc">
					<?php echo UTF8::lessenAsByte(func::stripHTML($entry['description']),$config['categoryDescLength']);?>
				</div>
			</div>
<?php
		}
?>
			<div class="clear"></div>
		</li>
<?php
		}
		for($i=1;$i<count($entries);$i++) {
			$entry = $entries[$i];
			$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$entry['id'] : $service['path'].'/go/'.$entry['permalink'];

?>
		<li class="list"><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></li>
<?php
		}
?>
	</ul>
<?php
	return $result;
}