Beispiel #1
0
function login($userid, $userpw, $saveId = false) {
	global $database, $db, $service, $event;

	if (!((strlen($userpw) == 40) && preg_match('/[0-9a-f]/i', $userpw))) $forceRaw = true;		
	if (!isset($_SESSION['sslPublicKey']) && !$forceRaw) return false;
	if (Validator::getBool($forceRaw) === true) $userid = sha1($userid);
	
	$db->query('SELECT id, loginid, password, email FROM '.$database['prefix'].'Users WHERE SHA1(loginid)="'.$db->escape($userid).'"');
	if ($db->numRows() != 0) {
		list($uid, $loginid, $password, $email) = $db->fetchRow();
		$db->free();
		$input = array('loginid'=>$loginid, 'email'=>$email, 'saveId'=>$saveId);
		
		if ($password != getEncryptedPassword($loginid, $userpw))
			return false;

		authorizeSession($uid);
		@$db->query('UPDATE '.$database['prefix'].'Users SET lastLogin = UNIX_TIMESTAMP() WHERE loginid="'.$loginid.'"');
		if (!isset($saveId) || empty($saveId)) {
			setcookie('BLOGLOUNGE_LOGINID', '', time() - 31536000, $service['path'] . '/', '.'.$_SERVER['HTTP_HOST']);
		} else {
			setcookie('BLOGLOUNGE_LOGINID', $loginid, time() + 31536000, $service['path'] . '/', '.'.$_SERVER['HTTP_HOST']);
		}
		$event->on('Auth.login', $input);

		return true;
	} 
	return false;
}
		function buildTagIndex($itemId, $tags, $oldtags = null, $firstDelete = true) {
			global $database, $db;
			if (!isset($tags) || !is_array($tags) || !isset($itemId) || !Validator::getBool($itemId))
				return false;
			
			$tagChunk = array();
			$tagInsertChunk = array();
			
			if($firstDelete) 
				@array_shift($tags); // first tag is category

			if (empty($tags)) return false;
			foreach ($tags as $tag) {
				if (!Validator::is_empty($tag)) {
					
					$tag = trim($tag);
					array_push($tagChunk, "'$tag'");
					array_push($tagInsertChunk, "('$tag')");
				}
			}
			$tagInsertStr = implode(',', $tagInsertChunk); // ('tag'),('tag')...
			$tagStr = implode(',', $tagChunk); // 'tag','tag',...

			$db->execute("INSERT IGNORE INTO {$database['prefix']}Tags (name) VALUES $tagInsertStr");

			$tagIdList = array();
			if (!$db->query("SELECT id FROM {$database['prefix']}Tags WHERE name IN ($tagStr)")) return false;
			while ($taglist = $db->fetchRow()) { 
					array_push($tagIdList, $taglist[0]); 
			}
			$db->free();

			$relationList = array();
			foreach ($tagIdList as $tagId) {
				array_push($relationList, "('$itemId', '$tagId', UNIX_TIMESTAMP())");
			}
			$relationStr = implode(',', $relationList); // ('itemId','tagId'),('itemId','tagId')...

			$db->execute("INSERT IGNORE INTO {$database['prefix']}TagRelations (item, tag, linked) VALUES $relationStr");

			if (!isset($oldtags) || empty($oldtags)) return true; // finish here if oldtags empty.

			$deletedTags = array_diff($oldtags, $tags);
			if (count($deletedTags) > 0) {
				$delTags = array();
				$dTagStr = '\'' . implode('\' , \'', $deletedTags) . '\'';
				if (!$db->query("SELECT id FROM {$database['prefix']}Tags WHERE name IN ($dTagStr)")) return false;
				while ($dlist = $db->fetchRow()) { 
					array_push($delTags, $dlist[0]); 
				}
				$db->free();
				$delTagStr = implode(', ', $delTags); // 삭제된 태그의 id 리스트

				$db->execute("DELETE FROM {$database['prefix']}TagRelations WHERE item='$itemId' AND type='feed' AND tag IN ($delTagStr)"); // TagRelation 삭제
			}
		}
Beispiel #3
0
function scanner($path, $node, $line)
{
    global $migrational, $items;
    switch ($path) {
        case '/blog':
            if (!preg_match('/^tattertools\\/1\\.[01]$/', @$node['.attributes']['type']) && !preg_match('/^textcube\\/1\\.[01]$/', @$node['.attributes']['type'])) {
                finish(_t('지원하지 않는 백업파일입니다.'));
            }
            $migrational = Validator::getBool(@$node['.attributes']['migrational']);
            return true;
        case '/blog/setting/banner/content':
        case '/blog/post/attachment/content':
        case '/blog/notice/attachment/content':
        case '/blog/keyword/attachment/content':
            if (!empty($node['.stream'])) {
                fclose($node['.stream']);
                unset($node['.stream']);
            }
            return true;
        case '/blog/setting':
        case '/blog/category':
        case '/blog/post':
        case '/blog/notice':
        case '/blog/keyword':
        case '/blog/link':
        case '/blog/logs/referer':
        case '/blog/statistics/referer':
        case '/blog/statistics/visits':
        case '/blog/statistics/daily':
        case '/blog/skin':
        case '/blog/plugin':
        case '/blog/commentNotified/comment':
        case '/blog/commentNotifiedSiteInfo/site':
        case '/blog/guestbook/comment':
        case '/blog/filter':
        case '/blog/feed':
        case '/blog/line':
            $items++;
            if (!strpos($path, 'referer')) {
                setProgress(null, _t('백업파일을 확인하고 있습니다.'), $line);
            }
            return true;
        case '/blog/personalization':
        case '/blog/userSetting':
            // skip
            return true;
    }
}
Beispiel #4
0
	if (!$xmls->openFile(ROOT . '/exports/'.$programName.'/index.xml')) {
		func::alert(_t('프로그램 정보를 읽을 수 없습니다'), 'dialog');
	}

	$exportInfo = array();
	$exportInfo['domain'] = $domainName;
	$exportInfo['program'] = $programName;
	$exportInfo['title'] = $xmls->getValue('/export/information/name[lang()]');
	$exportInfo['config'] = $xmls->selectNode('/export/config[lang()]');
	$exportInfo['description'] = func::filterJavascript($xmls->getValue('/export/information/description[lang()]'));
	$exportInfo['license'] = func::filterJavascript($xmls->getValue('/export/information/license[lang()]'));
	$exportInfo['version'] = func::filterJavascript($xmls->getValue('/export/information/version'));
	$exportInfo['author'] = func::filterJavascript($xmls->getValue('/export/information/author[lang()]'));
	$exportInfo['email'] = func::filterJavascript($xmls->getAttribute('/export/information/author[lang()]', 'email'));
	$exportInfo['homepage'] = func::filterJavascript($xmls->getAttribute('/export/information/author[lang()]', 'link'));
	$exportInfo['status'] = Validator::getBool($db->queryCell("SELECT status FROM {$database['prefix']}Exports WHERE domain='{$domainName}'"));

	$exportInfo['tags'] = array();
	$sNode = $xmls->selectNode('/export/binding');
	if(isset($sNode['tag'])) {
		foreach($sNode['tag'] as $tag) {
			array_push($exportInfo['tags'], '[##_'.$tag['.attributes']['name'].'_##]');
		}
	}
?>
<!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 $exportInfo['title'];?></title>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $service['path'];?>/style/common.css" />
Beispiel #5
0
	$xmls = new XMLStruct;
	if (!$xmls->openFile(ROOT . '/plugins/'.$pluginName.'/index.xml')) {
		func::alert(_t('플러그인 정보를 읽을 수 없습니다'), 'dialog');
	}

	$pluginInfo = array();
	$pluginInfo['name'] = $pluginName;
	$pluginInfo['title'] = $xmls->getValue('/plugin/information/name[lang()]');
	$pluginInfo['config'] = $xmls->selectNode('/plugin/config[lang()]');
	$pluginInfo['description'] = func::filterJavascript($xmls->getValue('/plugin/information/description[lang()]'));
	$pluginInfo['license'] = func::filterJavascript($xmls->getValue('/plugin/information/license[lang()]'));
	$pluginInfo['version'] = func::filterJavascript($xmls->getValue('/plugin/information/version'));
	$pluginInfo['author'] = func::filterJavascript($xmls->getValue('/plugin/information/author[lang()]'));
	$pluginInfo['email'] = func::filterJavascript($xmls->getAttribute('/plugin/information/author[lang()]', 'email'));
	$pluginInfo['homepage'] = func::filterJavascript($xmls->getAttribute('/plugin/information/author[lang()]', 'link'));
	$pluginInfo['status'] = Validator::getBool($db->queryCell("SELECT status FROM {$database['prefix']}Plugins WHERE name='{$pluginName}'"));

	$pluginInfo['tags'] = array();
	$sNode = $xmls->selectNode('/plugin/binding');
	if(isset($sNode['tag'])) {
		foreach($sNode['tag'] as $tag) {
			array_push($pluginInfo['tags'], '[##_'.$tag['.attributes']['name'].'_##]');
		}
	}
?>
<!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 $pluginInfo['title'];?></title>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $service['path'];?>/style/common.css" />
Beispiel #6
0
					if(!empty($logoFile)) {
						$s_logo = (!Validator::is_empty($logoFile)) ? $skin->parseTag('post_logo', $logoFile, $src_logo) : '';
						$sp_posts = $skin->dressOn('cond_logo', $src_logo, $s_logo, $sp_posts);		
						$sp_posts = $skin->parseTag('post_logo_exist', 'post_logo_exist', $sp_posts);
					} else {
						$sp_posts = $skin->dressOn('cond_logo', $src_logo, '', $sp_posts);
						$sp_posts = $skin->parseTag('post_logo_exist', 'post_logo_nonexistence', $sp_posts);
					}

					$sp_posts = $skin->parseTag('post_position', ($index==1?'firstItem':($index==$lastIndex?'lastItem':'')), $sp_posts);

					$sp_posts = $skin->parseTag('post_id', $item['id'], $sp_posts);
					
					$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$item['id'] : $service['path'].'/go/'.htmlspecialchars($item['permalink']);
					$sp_posts = $skin->parseTag('post_url',  $event->on('Text.postURL',(Validator::getBool($config->directView)?$service['path'].'/read/'.$item['id']:$link_url)), $sp_posts);	
					$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);
Beispiel #7
0
	include ROOT . '/lib/includeForAjax.php';

	requireStrictRoute();

	$response = array();
	$response['error'] = 0;
	$response['message'] = '';
	
	if (!isAdmin()) {
		$response['error'] = 1;
		$response['message'] = _t('관리자만이 이 기능을 사용할 수 있습니다.');
	} else {
		$response['error'] = 1;

		$pluginName = $_POST['plugin'];
		$ting = (isset($_POST['ting']) && !empty($_POST['ting'])) ? Validator::getBool($_POST['ting']) : null;

		if (!preg_match('/^[A-Za-z0-9 _-]+$/', $pluginName)) {
			$response['message'] = _t('잘못된 플러그인 이름입니다');
			func::printRespond($response);
		}

		if (!is_dir(ROOT . '/plugins/'.$pluginName)) {
			$response['message'] = _t('플러그인이 존재하지 않습니다');
			func::printRespond($response);
		}

		if (!file_exists(ROOT . '/plugins/'.$pluginName.'/index.xml')) {
			$response['message'] = _t('플러그인 정보를 찾을 수 없습니다');
			func::printRespond($response);
		}
Beispiel #8
0
				if (!isset($IV['userid']) || !isset($IV['userpw'])) {
					header("Location: {$path}/setup/?step=uninstall&error=10");
					exit;
				}

				if (!list($loginid, $password, $is_admin) = $db->pick("SELECT loginid, password, is_admin FROM {$database['prefix']}Users WHERE loginid='{$IV['userid']}'")) {
					header("Location: {$path}/setup/?step=uninstall&error=11");
					exit;
				}

				if ($password != Encrypt::hmac($IV['userid'], md5(md5($IV['userpw'])))) {
					header("Location: {$path}/setup/?step=uninstall&error=12");
					exit;
				}

				if (!Validator::getBool($is_admin)) {
					header("Location: {$path}/setup/?step=uninstall&error=13");
					exit;
				}

				$db->execute("DROP TABLE 
									{$database['prefix']}Booms,
									{$database['prefix']}Categories,
									{$database['prefix']}CategoryRelations,
									{$database['prefix']}DailyStatistics,
									{$database['prefix']}DeleteHistory,		
									{$database['prefix']}Exports,
									{$database['prefix']}FeedItems,
									{$database['prefix']}Feeds,	
									{$database['prefix']}Groups,
									{$database['prefix']}Medias,
		function buildCategoryRelations($itemId, $tags, $oldtags = null) {		
			global $database, $db;
			if(empty($tags) || !isset($tags) || !isset($itemId) || !Validator::getBool($itemId))
				return false;
	
			$tagChunk = array();
			foreach ($tags as $tag) {
				if (!Validator::is_empty($tag)) {
					$tag = trim($tag);
					array_push($tagChunk, "'$tag'");
				}
			}	
			
			$tagString = implode(',', $tagChunk);
			if(!$db->query('SELECT id FROM '.$database['prefix'].'Tags WHERE name IN ('.$tagString.')')) return false;
	
			$tagIds = array();
			
			while($taglist = $db->fetchRow()) {
				array_push($tagIds, $taglist[0]);
			}
				
			if(!$db->query('SELECT item FROM '.$database['prefix'].'TagRelations WHERE tag IN ('. implode(',', $tagIds) .') AND (type = "category")')) return false;
			
			$categoryIds = array();	
			while ($categorylist = $db->fetchRow()) { 
				array_push($categoryIds, $categorylist[0]); 
			}
			$db->free();

			$relationList = array();	
			foreach ($categoryIds as $categoryId) {
				array_push($relationList, "('$itemId', '$categoryId', UNIX_TIMESTAMP(), 'n')");
			}
			$relationStr = implode(',', $relationList); // ('itemId','tagId'),('itemId','tagId')...

			$db->execute("INSERT IGNORE INTO {$database['prefix']}CategoryRelations (item, category, linked, custom) VALUES $relationStr");
		
			foreach($categoryIds as $categoryId) {
				Category::rebuildCount($categoryId);
			}
			
			if (!isset($oldtags) || empty($oldtags)) return true;

			$deletedTags = array_diff($oldtags, $tags);
			if (count($deletedTags) > 0) {
				$delTags = array();
				$dTagStr = '\'' . implode('\' , \'', $deletedTags) . '\'';
				if (!$db->query("SELECT id FROM {$database['prefix']}Tags WHERE name IN ($dTagStr)")) return false;
				while ($dlist = $db->fetchRow()) { 
					array_push($delTags, $dlist[0]); 
				}
				$db->free();
			
				$delTagStr = implode(', ', $delTags);
			
				if(!$db->query('SELECT item FROM '.$database['prefix'].'TagRelations WHERE tag IN ('.$delTagStr.') AND (type = "category")')) return false;
			
				$delCategories = array();
		
				while ($dlist = $db->fetchRow()) { 
					array_push($delCategories, $dlist[0]); 
				}

				$db->free();
			
				$delCategoryStr = implode(', ', $delCategories);
		
				$db->execute("DELETE FROM {$database['prefix']}CategoryRelations WHERE item='$itemId' AND category IN ($delCategoryStr)");
			
				foreach($delCategories as $categoryId) {
					Category::rebuildCount($categoryId);
				}
			}

		}
Beispiel #10
0
			}
			
			$data = array();

			$data['class'] = ($read==$member['id']?' list_item_select':'');
			
			$data['datas'] = array();
			
			// 멤버 번호
			array_push($data['datas'], array('class'=>'member_number','data'=> $member['id'] ));

			// 멤버 가입일	
			array_push($data['datas'], array('class'=>'member_created','data'=> date('y.m.d H:i:s', $member['created']) ));
			
			// 멤버 아이디	
			array_push($data['datas'], array('class'=>'member_id','data'=> '<a href="'.$service['path'].'/admin/member/list/?read='.$member['id'].'">'.$member['loginid'].'</a>' . (!Validator::getBool($member['is_accepted'])?(' <span class="not_accept">('._t('미인증').')</span>'):'') ));
		
			// 멤버 별명
			array_push($data['datas'], array('class'=>'member_nickname','data'=> $member['name'] ));

			// 멤버 블로그
			ob_start();

			if($totalFeeds > 0) {
				if($totalFeeds == 1) {
?>
					<a href="<?php echo $service['path'];?>/admin/blog/list/?read=<?php echo $feeds[0]['id'];?>"><?php echo $feeds[0]['title'];?></a>
<?php
				} else {
?>
					<?php echo _f('"%1" 외 %2 개의 블로그', '<a href="'.$service['path'].'/admin/blog/list/?read='.$feeds[0]['id'].'">'.$feeds[0]['title'].'</a>', $totalFeeds-1);?>
Beispiel #11
0
		function getTitle($item, $feedId, $feedItemId = null) {
			$title = array();
			$autoUpdate = array();
			$title['result'] = $item['title'];

			/*list($autoUpdate['feed'], $title['feed']) = Feed::gets($feedId, 'autoUpdate,title');
			$autoUpdate['feed'] = Validator::getBool($autoUpdate['feed']);

			if (!$autoUpdate['feed'] && !Validator::is_empty($title['feed']))
				$title['result'] = $title['feed'];*/ // 피드의 제목을 피드아이템 제목에 덮어 씌우는일이 없도록..

			if (isset($feedItemId) || ($feedItemId !== false)) { // update
				requireComponent('Bloglounge.Data.FeedItems');
				list($autoUpdate['item'], $title['item']) = FeedItem::gets($feedItemId, 'autoUpdate,title');
				$autoUpdate['item'] = Validator::getBool($autoUpdate['item']);

				if (!$autoUpdate['item'] && !Validator::is_empty($title['item']))
					$title['result'] = $title['item'];
			}

			return $title['result'];
		}
		function cacheThumbnail($itemId, $item) {
			global $database, $db;
			if (!isset($item) || !is_array($item) || !defined('ROOT') || !isset($itemId) || !Validator::getBool($itemId))
				return false;

			$cacheDir = ROOT. '/cache/thumbnail';
			if (!is_dir($cacheDir)) func::mkpath($cacheDir);
			if (!is_writeable($cacheDir)) return false;

			$division = ord(substr(str_replace("http://","",$item['permalink']), 0, 1));

			requireComponent('LZ.PHP.Media');
			$media = new Media;
			$media->set('outputPath', $cacheDir.'/'.$division);

			$item['id'] = $itemId; // for uniqueId

			list($thumbnailLimit, $thumbnailSize, $thumbnailType) = Settings::gets('thumbnailLimit, thumbnailSize, thumbnailType');
			if($thumbnailLimit == 0) return false;

			if (!$result = $media->get($item, $thumbnailSize, $thumbnailLimit, $thumbnailType))
				return false;

			foreach($result['movies'] as $m_item) {
				$tFilename = $db->escape(str_replace($cacheDir, '', $m_item['filename']['fullpath']));
				$tSource = $db->escape($m_item['source']);

				if(!empty($tFilename)) {
					$width = $m_item['width'];
					$height = $m_item['height'];
					$via = $m_item['via'];					
					$insertId = $media->add($itemId, $tFilename, $tSource, $width, $height, 'movie', $via);
				}
			}

			foreach($result['images'] as $i_item) {
				$tFilename = $db->escape(str_replace($cacheDir, '', $i_item['filename']['fullpath']));
				$tSource = $db->escape($i_item['source']);

				if(!empty($tFilename) && $i_item['width'] > 100 && $i_item['height'] > 100) {
					$width = $i_item['width'];
					$height = $i_item['height'];
					$insertId = $media->add($itemId, $tFilename, $tSource, $width, $height, 'image');
				}
			}
	
			if(isset($insertId)) {
				$db->execute("UPDATE {$database['prefix']}FeedItems SET thumbnailId='$insertId' WHERE id='$itemId'");
			}

			return true;
		}
		function getList($id) {
			global $database, $db;

			if (!isset($id) || !Validator::getBool($id))
				return false;

			$result = $db->queryAll("SELECT t.name FROM {$database['prefix']}TagRelations tr LEFT JOIN {$database['prefix']}Tags t ON (t.id = tr.tag) LEFT JOIN {$database['prefix']}FeedItems fi ON (fi.id = tr.item) LEFT JOIN {$database['prefix']}Feeds f ON (f.id = fi.feed) WHERE tr.type = 'group_category' and f.group = $id GROUP BY t.id");

			return $result;
		}
Beispiel #14
0
<?php
			if($is_admin) {
?>
					<p class="checkbox_wrap">
						<input type="checkbox" name="isFocus" id="isFocus" <?php if (Validator::getBool($readFeedItem['focus'])) { ?>checked="checked"<?php } ?> /> <label for="isFocus"><?php echo _t('이 글을 포커스로 설정합니다.');?></label>
						<div class="help checkbox_help"><?php echo _t('현재 글을 포커스로 사용하시려면 선택하세요.');?></div>
					</p>
<?php
			}
?>
					<p class="checkbox_wrap">
						<input type="checkbox" name="autoUpdate" id="autoUpdate" <?php if (Validator::getBool($readFeedItem['autoUpdate'])) { ?>checked="checked"<?php } ?> /> <label for="autoUpdate"><?php echo _t('피드 정보로부터 제목, 글쓴이 이름을 자동으로 업데이트 합니다.');?></label>
						<div class="help checkbox_help"><?php echo _t('글 제목이나 글쓴이 이름을 고정하고 싶은 경우 이 기능을 해제하세요');?></div>
					</p>
					<p class="checkbox_wrap">
						<input type="checkbox" name="allowRedistribute" id="allowRedistribute" <?php if (Validator::getBool($readFeedItem['allowRedistribute'])) { ?>checked="checked"<?php } ?> /> <label for="allowRedistribute"><?php echo _t('이 글의 RSS 재출력과 외부 검색 노출을 허용합니다.');?></label>
						<div class="help checkbox_help"><?php echo _t('RSS 출력, 외부 검색엔진 수집등의 기능에 이 글의 정보가 포함됩니다');?></div>
					</p>
					
					<br />

					<div class="grayline"></div>

					<p class="button_wrap">
						<span class="normalbutton"><input type="submit" value="<?php echo _t('수정완료');?>" /></span>
						<a href="#" class="normalbutton" onclick="deleteItem(<?php echo $readFeedItem['id'];?>); return false;"><span><?php echo _t('삭제');?></span></a>
					</p>
				</form>
			</div>
		<?php echo drawAdminBoxEnd();?>
	</div>
Beispiel #15
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('confirmativePassword' => array('string', 'mandatory' => false), 'removeAttachments' => array(array('0', '1'), 'dafault' => null)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (empty($_POST['confirmativePassword']) || !User::confirmPassword(User::getBlogOwner(getBlogId()), $_POST['confirmativePassword'])) {
    Respond::ResultPage(1);
}
DataMaintenance::removeAll(Validator::getBool(@$_POST['removeAttachments']));
CacheControl::flushAll();
Respond::ResultPage(0);
Beispiel #16
0
	define('ROOT', '..');
	define('NO_SESSION', true);
	include ROOT . '/lib/include.php';
	
	requireComponent('Bloglounge.Data.RSSOut');

	if (!file_exists(ROOT . '/cache/rss/0.xml')) {
		RSSOut::stop();
	}

	$action = $accessInfo['action'];
	$config = new Settings;

	header('Content-Type: text/xml; charset=utf-8');

	if(Validator::getBool($config->useRssOut)===true) {
		switch($action) {
			case 'focus':
				RSSOut::refresh('focus', false);
			break;
			case 'category':
				
				requireComponent('Bloglounge.Data.Category');
				$category = Category::getByName(urldecode($accessInfo['value']));
				RSSOut::refresh('category', false, $category);
			break;
			default: // recent
				RSSOut::refresh('recent',false);
			break;
		}
	} else {
Beispiel #17
0
	$datas = array();

	$group_names = array();		
	$group_names[0] = '';
	foreach($groups as $group) {
		$group_names[$group['id']] = $group['name'];
	}

	if(count($feeds)>0) {
		foreach($feeds as $feed) {		
			$data = array();

			$stringDate = Func::dateToString($feed['lastUpdate']);
			$lastPost = Feed::getLatestPost($feed['id']);
			$isNew = Func::isNew($feed['created'],1);
			$noVerifier = Validator::getBool($config->useVerifier) && !Validator::getBool($feed['isVerified']) && ($feed['owner'] != 1);

			$data['id'] = 'list_item_'.$feed['id'];
			$data['class'] = ($feed['visibility']=='n'?'list_item_hide':'').($feed['id']==$read?' list_item_select':'').($noVerifier?' no_verifier':'');
			
			$data['datas'] = array();
			
			// 블로그 등록날짜
			array_push($data['datas'], array('class'=>'bloglist_date','data'=> $noVerifier ? _t('미인증') : date('y.m.d H:i:s', $feed['created']) ));
			array_push($data['datas'], array('class'=>'bloglist_group','data'=> empty($group_names[$feed['group']])?'<span class="empty">'._t('그룹없음').'</span>':UTF8::lessen($group_names[$feed['group']],10) ));

			// 블로그 제목
			ob_start();
?>
			
<?php
Beispiel #18
0
 static function getBit($value)
 {
     return Validator::getBool($value) ? 1 : 0;
 }
Beispiel #19
0
<?php
	define('ROOT', '../..');
	include ROOT . '/lib/includeForAjax.php';

	requireStrictRoute();

	$response = array();
	$response['error'] = 0;
	$response['message'] = '';

	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']) {
Beispiel #20
0
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('includeFileContents' => array(array('true', 'false'))));
require ROOT . '/library/preprocessor.php';
set_time_limit(0);
$includeFileContents = Validator::getBool(@$_GET['includeFileContents']);
$writer = new OutputWriter();
if (defined('__TEXTCUBE_BACKUP__')) {
    if (!file_exists(__TEXTCUBE_CACHE_DIR__ . '/backup')) {
        mkdir(__TEXTCUBE_CACHE_DIR__ . '/backup');
        @chmod(__TEXTCUBE_CACHE_DIR__ . '/backup', 0777);
    }
    if (!is_dir(__TEXTCUBE_CACHE_DIR__ . '/backup')) {
        exit;
    }
    if ($writer->openFile(__TEXTCUBE_CACHE_DIR__ . "/backup/{$blogid}.xml")) {
    } else {
        exit;
    }
} else {
    if ($writer->openStdout()) {
        header('Content-Disposition: attachment; filename="Textcube-Backup-' . getBlogName($blogid) . "-" . Timestamp::getDate() . '.xml"');
        header('Content-Description: Textcube Backup Data');
        header('Content-Transfer-Encoding: binary');
        header('Content-Type: application/xml');
    } else {
        exit;
    }
Beispiel #21
0
			
<?php
			if(!isAdmin() && Validator::getBool($config->useVerifier)) {
?>
			<div class="options_wrap">
				<h4><?php echo _t('주의사항');?></h4>
				<ol class="notice">
					<li><?php echo _t('블로그 추가를 완료하기 위해서는 인증단계를 거쳐야 합니다.');?></li>
					<li><?php echo _t('현재 블로그의 글을 페이지의 이동없이 이곳에서 바로 볼 수 있도록 설정되어있습니다.');?></li>
				</ol>
			</div>
<?php
			}
?>
<?php
			if(!isAdmin() && Validator::getBool($config->useVerifier)) {
?>
			<br />
			<span class="normalbutton"><input type="submit" value="<?php echo _t('인증하기');?>" /></span>
<?php
			} else {
?>
			<br />
			<span class="normalbutton"><input type="submit" value="<?php echo _t('블로그 추가');?>" /></span>
<?php
			}
?>
		</form>
<?php
		}
	} else {
		function isUser($id) {
			global $database, $db;
			$n = $db->count('SELECT id FROM '.$database['prefix'].'Users WHERE id="'.$db->escape($id).'" OR loginid="'.$db->escape($id).'"');
			return Validator::getBool($n);
		}
Beispiel #23
0
<?php
					}
?>
				</select>					
<?php
			$arg = ob_get_contents();
			ob_end_clean();
			echo _f('RSS피드로 수집된 글을 %1 출력합니다.', $arg);
?>
		</dd>
	</dl>	

	<dl class="normal">
		<dt><?php echo _t('인기글');?></dt>
		<dd>
			<input type="checkbox" name="restrictBoom" id="restrictBoom" value="y" <?php if (Validator::getBool($config->restrictBoom)) {?>checked="checked"<?}?>/>&nbsp;<label for="restrictBoom"><?php echo _t('로그인 한 사람만 추천, 반대 기능을 사용할 수 있도록 합니다.');?></label>
		</dd>
	</dl>	
	<dl class="normal">
		<dt></dt>
		<dd>
<?php
		$rankBy = $config->rankBy;
		$rankLife = $config->rankLife;
		ob_start();
?>
		<select name="rankBy" id="rankBy">
			<option value="click" <?php if ($rankBy == 'read') { ?>selected="selected"<?php } ?>><?php echo _t('읽은 사람');?></option>
			<option value="boom" <?php if ($rankBy == 'boom') { ?>selected="selected"<?php } ?>><?php echo _t('추천한 사람');?></option>
		</select>
<?php
Beispiel #24
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;
	}