예제 #1
0
파일: blog.php 프로젝트: ncloud/bloglounge
<?php
	define('ROOT', '..');
	include ROOT . '/lib/include.php';
	
	$searchFeedId = $accessInfo['action'];
	$searchType = 'blogURL';
	if(is_numeric($searchFeedId)) {
		$searchKeyword = 'http://'.str_replace('http://', '', Feed::get($searchFeedId, 'blogURL'));	
		$searchExtraValue = $searchFeedId;
	} else {
		$searchKeyword = 'http://'.str_replace('http://', '', $accessInfo['address']);
		$searchExtraValue = Feed::blogURL2Id('http://'.str_replace('http://', '', $searchKeyword));
	}

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

	$pageCount = $skinConfig->postList; // ÆäÀÌÁö°¹¼ö
	list($posts, $totalFeedItems) = FeedItem::getFeedItems($searchType, $searchKeyword, $searchExtraValue, $page, $pageCount);
	$paging = Func::makePaging($page, $pageCount, $totalFeedItems);

	include ROOT . '/lib/piece/message.php';
	include ROOT . '/lib/piece/postlist.php';
	include ROOT . '/lib/end.php';
?>
예제 #2
0
파일: index.php 프로젝트: ncloud/bloglounge
	// 현재 사용중인 스킨
	$n_skinname = Settings::get('metaskin');
	$n_skinpath = ROOT . '/skin/meta/'.$n_skinname;
	
	$xmls = new XMLStruct();

	if (file_exists($n_skinpath.'/index.xml')) { // 스킨 없음
		$xml = file_get_contents($n_skinpath.'/index.xml');
		$xmls->open($xml);
	}

	$pageCount = 15; // 페이지갯수
	$page = isset($_GET['page']) ? $_GET['page'] : 1;
	if(!isset($page) || empty($page)) $page = 1;

	$paging = Func::makePaging($page, $pageCount, count($skinlist));

?>

<link rel="stylesheet" href="<?php echo $service['path'];?>/style/admin_design.css" type="text/css" />
<script type="text/javascript">
	function saveSkin(name) {
		$.ajax({
		  type: "POST",
		  url: _path +'/service/design/skin.php',
		  data: 'name=' + encodeURIComponent(name) + "&type=meta",
		  dataType: 'xml',
		  success: function(msg){		
			error = $("response error", msg).text();
			if(error == "0") {
				document.location.reload();
예제 #3
0
파일: index.php 프로젝트: ncloud/bloglounge
		}

		if (!$plugin['status'] = $db->queryCell("SELECT status FROM {$database['prefix']}Plugins WHERE name='{$file}'"))
			$plugin['status'] = 'off';

		array_push($plugins, $plugin);
		unset($plugin);
	}

	$dir->close();
	
	$pageCount = 15; // 페이지갯수
	$page = isset($_GET['page']) ? $_GET['page'] : 1;
	if(!isset($page) || empty($page)) $page = 1;

	$paging = Func::makePaging($page, $pageCount, count($plugins));
	
?>	

	<script type="text/javascript">
		var pluginTing = [];
<?php
	foreach ($plugins as $plugin) {
		echo "\t\tpluginTing['{$plugin['name']}'] = [];\n";
		echo "\t\tpluginTing['{$plugin['name']}']['title'] = '".func::escapeJSInAttribute($plugin['title'])."';\n";
		echo "\t\tpluginTing['{$plugin['name']}']['config'] = '{$plugin['config']}';\n";
		foreach ($plugin['ting'] as $ting) {
			echo "\t\tpluginTing['{$plugin['name']}']['{$ting['event']}'] = [];\n";
			echo "\t\tpluginTing['{$plugin['name']}']['{$ting['event']}']['type'] = '{$ting['type']}';\n";
			echo "\t\tpluginTing['{$plugin['name']}']['{$ting['event']}']['text'] = '".func::escapeJSInAttribute($ting['text'])."';\n";
		}
예제 #4
0
파일: index.php 프로젝트: ncloud/bloglounge
				} else {
					$msg = _t('회원정보 수정 성공');
				}
			}
		}		
		
		$readUser = User::getAll($read);
	}

	$pageCount = 15; // 페이지갯수
	$page = isset($_GET['page']) ? $_GET['page'] : 1;
	if(!isset($page) || empty($page)) $page = 1;
	
	$memberCount = User::getMemberCount();
	$members = User::getMembers('',$page, $pageCount);
	$paging = Func::makePaging($page, $pageCount, $memberCount);
?>

<script type="text/javascript">
<?php
	if(!empty($read)) {
?>		
		function deleteMember() {
			if (!confirm('<?php echo _t('탈퇴처리를 한 회원의 글은 모두 삭제되며, 다시 복구 하실 수 없습니다.\n\n탈퇴처리 하시겠습니까?');?>')) {
				return false;
			}

			var form = $("#memberForm");
			$('#is_secede').val('1');

			form.submit();
예제 #5
0
파일: read.php 프로젝트: ncloud/bloglounge
	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];
			$pageDatas[$start++] = '/read/'.$item['id'];
		}

		$paging['pageDatas'] = $pageDatas;
	}
예제 #6
0
파일: index.php 프로젝트: ncloud/bloglounge
		}
		$exports[$file] = $export;
		unset($export);
	}

	$dir->close();

	requireComponent('Bloglounge.Model.Exports');
	
	$exportList = Export::getList();

	$pageCount = 15; // 페이지갯수
	$page = isset($_GET['page']) ? $_GET['page'] : 1;
	if(!isset($page) || empty($page)) $page = 1;

	$paging = Func::makePaging($page, $pageCount, count($exportList));
?>

<link rel="stylesheet" href="<?php echo $service['path'];?>/style/admin_plugin.css" type="text/css" />

<script type="text/javascript">
		function showExportConfig(domainName, type, height) {
			if (($('#exportStatus'+domainName).val() == 'off') && type =='config')
				return false;			
		
			if($("#exportDetail" + domainName).length==0) {
				$("#exportConfigView" + domainName + " td").append($("<div>").attr('id', 'exportDetail' + domainName).css ( {
					"width":"100%",
					"height":height+"px"
				} )).addClass('exportDetail');
				
예제 #7
0
파일: index.php 프로젝트: ncloud/bloglounge
	function getNoticePage($input, $config) {
		global $database, $db, $event, $service;
		if(!isAdmin()) {
?>
<?php
			return $input;
		} 

		$blogId = isset($config['blog'])?$config['blog']:0;
		$tag = isset($config['tag'])?$config['tag']:'';
		$pluginURL = $event->pluginURL;
		
		$params = '';

		if(!empty($blogId)) {
			
			$pageCount = 15; // 페이지갯수
			$page = isset($_GET['page']) ? $_GET['page'] : 1;
			if(!isset($page) || empty($page)) $page = 1;

			list($posts, $totalFeedItems) = getNoticeFeedItems($blogId,$page,$pageCount);							
			$paging = Func::makePaging($page, $pageCount, $totalFeedItems);
			
			ob_start();

?>
		<link rel="stylesheet" href="<?php echo $pluginURL;?>/style.css" type="text/css" />

		<script type="text/javascript">
			var is_checked = false;
			function toggleCheckAll(className) {
				is_checked = !is_checked;
				$("."+className).each( function() {
						this.checked = is_checked;
				});
			}

			function deleteItem(id) {
				if(confirm("<?php echo _t('이 글을 삭제하시겠습니까?');?>")) {
					$.ajax({
					  type: "POST",
					  url: '<?php echo $pluginURL;?>/delete.php',
					  data: 'id=' + id,
					  dataType: 'xml',
					  success: function(msg){		
						error = $("response error", msg).text();
						if(error == "0") {
							document.location.reload();
						} else {
							alert($("response message", msg).text());
						}
					  },
					  error: function(msg) {
						 alert('unknown error');
					  }
					});
				}
			}

			function deleteAllItem(className) {
				var ids = '';
				$("."+className).each( function() {
						if(this.checked) {
							ids += $(this).val() + ',';
						}
				});

				if(ids == '') {
					return false;
				}		
				
				if(confirm("<?php echo _t('선택된 모든 글을 삭제하시겠습니까?');?>")) {
					$.ajax({
					  type: "POST",
					  url:  '<?php echo $pluginURL;?>/delete.php',
					  data: 'id=' + ids,
					  dataType: 'xml',
					  success: function(msg){		
						error = $("response error", msg).text();
						if(error == "0") {
							document.location.reload();
						} else {
							alert($("response message", msg).text());
						}
					  },
					  error: function(msg) {
						 alert('unknown error');
					  }
					});
				}
			}
		</script>

		<div class="title_wrap">
			<h3><?php echo _t('공지사항');?> <span class="cnt">(<?php echo $totalFeedItems;?>)</span></h3>
		</div>
		
		<div class="notice_wrap">
<?php
	$headers = array(array('title'=>_t('선택'),'class'=>'entrylist_select','width'=>'50px'),
					array('title'=>_t('날짜'),'class'=>'entrylist_date','width'=>'100px'),
					array('title'=>_t('제목'),'class'=>'entrylist_title','width'=>'790px'),
					array('title'=>_t('실행'),'class'=>'entrylist_execute','width'=>'auto'));
	
	$datas = array();

	if(count($posts)>0) {
		foreach($posts as $post) {		
			$data = array();

			$date = Func::dateToString($post['written']);
			$feedvisibility = Feed::get($post['feed'], 'visibility');

			$data['id'] = 'list_item_'.$post['id'];
			$data['class'] = ($post['visibility']=='n'?'list_item_hide':'').($post['id']==$read?' list_item_select':'');
			
			$data['datas'] = array();
			
			// 글 선택
			array_push($data['datas'], array('class'=>'noticelist_select','data'=> '<input type="checkbox" class="postid" value="'.$post['id'].'" />' ));
	
			// 글 등록날짜		
			ob_start();
?>
			<?php echo date('y.m.d H:i:s', $post['written']);?><br />
			<span class="date_text">(<?php echo $date;?>)</span>
<?php
			$content = ob_get_contents();
			ob_end_clean();
			array_push($data['datas'], array('class'=>'noticelist_date','data'=> $content ));
			
			// 글 제목
			ob_start();
?>

<?php
			$desc = UTF8::lessenAsEm(str_replace('&nbsp;','',func::stripHTML($post['description'])),82);
			if(empty($desc)) {
				$desc = '<span class="empty">'._t('내용이 비어있거나 HTML로만 작성되어 있습니다.').'</span>';
			}	
			$isNew = Func::isNew($post['written'],1);
?>

			<div class="title"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($post['title'])), 60);?> <?php echo ($isNew?' <img	src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle" class="new" />':'');?></div>
			<?php echo $desc?>
<?php
			$content = ob_get_contents();
			ob_end_clean();

			array_push($data['datas'], array('class'=>'noticelist_title','data'=> $content ));

			// 글 실행
			ob_start();
?>
			<a href="#" class="microbutton alertbutton" onclick="deleteItem(<?php echo $post['id'];?>); return false;"><span><?php echo _t('삭제');?></span></a>
<?php

			$content = ob_get_contents();
			ob_end_clean();

			array_push($data['datas'], array('class'=>'noticelist_execute','data'=> $content ));
			
			array_push($datas, $data);
		}

	} else {
			array_push( $datas, array( 'class'=>"list_empty", 'datas'=>array(array('data'=>empty($keyword)?_t('공지사항이 없습니다.'):_t('검색된 공지사항이 없습니다.')) )) );
	}

	ob_start();
?>
		<div class="select">
			<a href="#" onclick="toggleCheckAll('postid'); return false;"><img src="<?php echo $service['path'];?>/images/admin/bt_arrow.gif" /></a>
		</div>
		<div class="action">
			<strong><a href="#" onclick="deleteAllItem('postid'); return false;"><?php echo _t('삭제');?></a></strong>
		</div>				
		<div class="clear"></div>
<?php
	$footers = ob_get_contents();
	ob_end_clean();

	echo makeTableBox('noticelist', $headers, $datas, $footers);	
?>
</div>

<div class="wrap">
	<br />
	<div class="paging">
		<?php echo func::printPaging($paging, $params);?>
	</div>
</div>
<?php
			$input .= ob_get_contents();
			ob_end_clean();
		}

		return $input;
	}
예제 #8
0
파일: index.php 프로젝트: ncloud/bloglounge
	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;
	}