diff --git a/documents/changelog_ko.txt b/documents/changelog_ko.txt index fbaa16854..744d4993d 100644 --- a/documents/changelog_ko.txt +++ b/documents/changelog_ko.txt @@ -5,13 +5,14 @@ === 추가된 점 === * 블로그 : 최근 공지와 최근 글의 필자 치환자 추가 및 동작 추가 (#1437) * 관리패널 : 모바일용 관리 모드 추가 (베타) (#1418) - * 일반 : camouflage 기능 추가 (알파) (#1431) + * 일반 : 다양한 배포본 개발을 돕는 camouflage 기능 추가 (알파) (#1431) === 변경된 점 === * 일반 : 스태틱 리소스의 더 많은 부분을 serviceURL에서 불러오도록 함 (대용량 서비스 구축시 리소스 서버 분리시 적용) (#1441) === 버그 수정 === - * 일반 : 공지사항 등의 피드 로드가 갱신되지 않는 오류 수정 (#1440) + * 일반 : 공지사항 등의 내부 피드 로드가 갱신되지 않는 오류 수정 (#1440) + * 일반 : RSS/ATOM 을 읽을 때 Cron이 실행되어 특정 경우 응답이 늦어 일부 리더 및 서비스에서 피드를 읽지 못하는 문제 수정 (#1178) * 블로그 : 댓글 ajax 블록 로드시에 ATOM/RSS 피드 치환자가 동작하지 않는 문제 수정 (#1435) * 블로그 : 댓글 페이지 사용시 클릭했을때 2번째 페이지가 보이지 않는 문제 수정 (#1201) * 블로그 : 댓글을 폈을 때 접히지 않는 문제 수정 (#1201) @@ -20,6 +21,7 @@ * 에디터 : html 코드의 웹표준 변환이 제대로 변환되지 않는 문제 수정 (#1438) * 에디터 : 위지윅 에디터의 STD 참조 자바스크립트 에러 문제 수정 (#1439) * TTXML : 카테고리복원, 방명록 정보, 스팸필터 정보 복원시 잘못될 수 있는 문제 수정 (#1298) + * TTXML : 댓글 알리미 정보가 복원되지 않는 문제 수정 (#1298) * OpenID : Transaction 관련을 $_SESSION에서 파일로 옮겨 세션 의존으로 인하여 생기는 문제 수정 (#1385) === 스킨 치환자 추가 안내 === diff --git a/framework/Dispatcher.php b/framework/Dispatcher.php index 17cc43755..992357033 100644 --- a/framework/Dispatcher.php +++ b/framework/Dispatcher.php @@ -141,7 +141,7 @@ private function URIinterpreter() { case 'entry': case 'feeder': case 'foaf': case 'guestbook': case 'iMazing': case 'keylog': case 'line': case 'location': case 'locationSuggest': case 'logout': case 'notice': case 'page': case 'plugin': case 'pluginForOwner': - case 'search': case 'suggest': case 'tag': case 'ttxml': + case 'search': case 'stream': case 'suggest': case 'tag': case 'ttxml': $pathPart = $uri['fragment'][0]; $interfacePath = 'interface/blog/'.$pathPart.'.php'; break; @@ -157,7 +157,7 @@ private function URIinterpreter() { break; case 'i': case 'm': if(isset($uri['fragment'][1]) && in_array($uri['fragment'][1],array('archive','category','comment','entry','guestbook','imageResizer','link','login','logout','pannels','protected','search','tag','trackback'))) { - $pathPart = $uri['fragment'][0].'/'.$uri['fragment'][1]; + $pathPart = $uri['fragment'][0].'/'.$uri['fragment'][1].(isset($uri['fragment'][2]) ? '/'.$uri['fragment'][2] : '').(isset($uri['fragment'][3]) ? '/'.$uri['fragment'][3] : ''); } else { $pathPart = $uri['fragment'][0]; } diff --git a/framework/boot/10-CoreClasses.php b/framework/boot/10-CoreClasses.php index 31d0e9bce..c89132eb5 100644 --- a/framework/boot/10-CoreClasses.php +++ b/framework/boot/10-CoreClasses.php @@ -406,7 +406,7 @@ static function getISO8601($timezone = null) { static function set($timezone) { if ( isset( $_ENV['OS'] ) && strncmp($_ENV['OS'], 'Windows', 7) == 0) $timezone = Timezone::getAlternative($timezone); - + date_default_timezone_set($timezone); return putenv('TZ=' . $timezone); } @@ -593,7 +593,7 @@ static function getISO8601($time = null) { } static function getUNIXtime($time = null) { - return (isset($time) ? date('U', $time) : date('U')); + return intval(isset($time) ? date('U', $time) : date('U')); } static function getHumanReadable($time = null, $from = null) { diff --git a/framework/boot/30-Auth.php b/framework/boot/30-Auth.php index 2204792ef..436197244 100644 --- a/framework/boot/30-Auth.php +++ b/framework/boot/30-Auth.php @@ -235,7 +235,7 @@ function authorize( $domain, $userid ) { } $data = DBModel::getInstance(); $data->reset('Privileges'); - $data->setQualifier('userid','equals',$userid); + $data->setQualifier('userid','equals',intval($userid)); $result = $data->getAll('blogid,acl'); foreach( $result as $rec ) { @@ -257,9 +257,9 @@ function authorize( $domain, $userid ) { $blogid = getBlogId(); $data->reset('Privileges'); $data->setQualifier('blogid','equals',$blogid); - $data->setQualifier('userid','equals',$userid); + $data->setQualifier('userid','equals',intval($userid)); $data->setAttribute('lastLogin',Timestamp::getUNIXtime()); - $data->update(); + $data->update(); // POD::execute("UPDATE {$this->context->getProperty('database.prefix')}Privileges SET lastLogin = ".Timestamp::getUNIXtime()." WHERE blogid = $blogid AND userid = $userid"); return; } @@ -378,7 +378,7 @@ function authenticate( $blogid, $loginid, $password, $blogapi = false ) { if(!empty($userid) && !is_null($userid)) { $query = DBModel::getInstance(); $query->reset('UserSettings'); - $query->setQualifier('userid','equals',$userid); + $query->setQualifier('userid','equals',intval($userid)); $query->setQualifier('name','equals','AuthToken',true); $authtoken = $query->getCell('value'); if (!empty($authtoken) && ($authtoken === $password)) { // If user requested auth token, use it to confirm. diff --git a/framework/cache/Memcache.php b/framework/cache/Memcache.php index b6671940a..f58b90852 100644 --- a/framework/cache/Memcache.php +++ b/framework/cache/Memcache.php @@ -32,7 +32,7 @@ public function set($key, $value, $expirationDue = 0) { $key = $this->getNamespaceHash('global').$key; } } - $this->memcache->set($key,$value,$expirationDue); + $this->memcache->set($key,$value,0,$expirationDue); } public function get($key, $clear = false) { if(strpos($key,'.') === false) { // If key doesn't contain namespace, diff --git a/framework/data/Cubrid/Adapter.php b/framework/data/Cubrid/Adapter.php index 0a918dade..49bd854b7 100644 --- a/framework/data/Cubrid/Adapter.php +++ b/framework/data/Cubrid/Adapter.php @@ -59,7 +59,7 @@ public static function tableList($condition = null) { } public static function reservedFieldNames() { - return array('date','value','data','count','year','month', 'type'); + return array('date','value','data','count','year','month', 'type', 'size'); } public static function reservedFunctionNames() { @@ -81,39 +81,45 @@ public static function query($query, $compatibility = true) { '/(ASC|DESC) LIMIT ([0-9]+) OFFSET 0/si', '/(ASC|DESC) LIMIT ([0-9]+) OFFSET ([0-9]+)/si', '/(ASC|DESC) LIMIT 1(^[0-9])/si', - '/(ASC|DESC) LIMIT ([0-9]+)/si' + '/(ASC|DESC) LIMIT ([0-9]+)/si', + '/RAND\(\) LIMIT ([0-9]+)/si' ); $descPagingInst = array( '$1 FOR ORDERBY_NUM() BETWEEN 1 AND $2', '$1 FOR ORDERBY_NUM() BETWEEN ($3+1) AND ($2+$3)', '$1 FOR ORDERBY_NUM() = 1', - '$1 FOR ORDERBY_NUM() BETWEEN 1 AND $2' + '$1 FOR ORDERBY_NUM() BETWEEN 1 AND $2', + 'RANDOM() FOR ORDERBY_NUM() BETWEEN 1 AND $1' ); } else if(stripos($query, "GROUP BY")!==false) { $origPagingInst = array( '/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+) OFFSET 0/si', '/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+) OFFSET ([0-9]+)/si', '/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT 1(^[0-9])/si', - '/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+)/si' + '/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+)/si', + '/GROUP BY(.*)(ORDER BY)(.*)RAND\(\) LIMIT ([0-9]+)/si' ); $descPagingInst = array( 'GROUP BY $1 HAVING GROUPBY_NUM() = $5 $2 $3 $4', 'GROUP BY $1 HAVING GROUPBY_NUM() BETWEEN ($6+1) AND $5 $2 $3 $4', 'GROUP BY $1 HAVING GROUPBY_NUM() = 1 $2 $3 $4', - 'GROUP BY $1 HAVING GROUPBY_NUM() BETWEEN 1 AND $5 $2 $3 $4' + 'GROUP BY $1 HAVING GROUPBY_NUM() BETWEEN 1 AND $5 $2 $3 $4', + 'GROUP BY $1 HAVING GROUPBY_NUM() BETWEEN 1 AND $4 $2 RANDOM() $3' ); } else { $origPagingInst = array( '/WHERE(.*)LIMIT ([0-9]+) OFFSET 0/si', '/WHERE(.*)LIMIT ([0-9]+) OFFSET ([0-9]+)/si', '/WHERE(.*)LIMIT 1(^[0-9])/si', - '/WHERE(.*)LIMIT ([0-9]+)/si' + '/WHERE(.*)LIMIT ([0-9]+)/si', + '/SUM\((size|value)\)/si' ); $descPagingInst = array( 'WHERE ROWNUM BETWEEN 1 AND $2 AND $1', 'WHERE ROWNUM BETWEEN ($3+1) AND ($2+$3) AND $1', 'WHERE ROWNUM = 1 AND $1', - 'WHERE ROWNUM BETWEEN 1 AND $2 AND $1' + 'WHERE ROWNUM BETWEEN 1 AND $2 AND $1', + 'SUM("$1")' ); } $query = preg_replace($origPagingInst, $descPagingInst,$query); @@ -178,10 +184,8 @@ public static function query($query, $compatibility = true) { $result = cubrid_execute(self::$dbProperties['handle'],$query); } self::$lastQueryType = strtolower(substr($query, 0,6)); - if( stristr($query, 'update ') || - stristr($query, 'insert ') || - stristr($query, 'delete ') || - stristr($query, 'replace ') ) { + if( in_array(self::$lastQueryType, array('insert','update','delete','replac'))) { + self::commit(); self::clearCache(); } return $result; @@ -283,7 +287,7 @@ public static function queryColumn($query, $useCache=true) { } /*@static@*/ - public static function queryAll ($query, $type = 'both', $count = -1) { + public static function queryAll($query, $type = 'both', $count = -1) { return self::queryAllWithCache($query, $type, $count); //return self::queryAllWithoutCache($query, $type, $count); // Your choice. :) } @@ -359,7 +363,6 @@ public static function cacheSave() { } public static function commit() { - global $fileCachedResult; @cubrid_commit(self::$dbProperties['handle']); } diff --git a/framework/data/DBModel.php b/framework/data/DBModel.php index bc7add91b..3cb10c831 100644 --- a/framework/data/DBModel.php +++ b/framework/data/DBModel.php @@ -151,12 +151,16 @@ public function setQualifier($name, $condition, $value = null, $escape = false) default: $this->_relations[$name] = 'LIKE'; } - $this->_qualifiers[$name] = ($escape === false && (!is_string($value) || in_array($value,$this->_reservedFunctions)) ? + if($name == 'blogid') { // Legacy support for plugins (with string-type blogid) + $this->_qualifiers[$name] = intval($value); + } else { + $this->_qualifiers[$name] = ($escape === false && (!is_string($value) || in_array($value,$this->_reservedFunctions)) ? $value : ($escape ? '\'' . POD::escapeString( (($this->_relations[$name] == 'LIKE') ? '%'.$value.'%' : $value) ) . '\'' : "'" . $value . "'")); + } } } @@ -224,6 +228,7 @@ public function insert() { foreach($pairs as $key => $value) if (is_null($value)) $pairs[$key] = 'NULL'; $this->_query = 'INSERT INTO ' . $this->table . ' (' . implode(',', $this->_capsulateFields(array_keys($attributes))) . ') VALUES (' . implode(',', $pairs) . ')'; + if (POD::query($this->_query)) { // $this->id = POD::insertId(); return true; diff --git a/framework/legacy/Needlworks.Cache.PageCache.php b/framework/legacy/Needlworks.Cache.PageCache.php index b29639bfe..38497fc6c 100644 --- a/framework/legacy/Needlworks.Cache.PageCache.php +++ b/framework/legacy/Needlworks.Cache.PageCache.php @@ -460,7 +460,7 @@ function flushEntry($entryId = null) { global $database; if(empty($entryId)) $entryId = ''; - else $entryId = $entryId.'-'; + else $entryId = intval($entryId); $Entries = POD::queryColumn("SELECT name FROM {$database['prefix']}PageCacheLog WHERE blogid = ".getBlogId()." diff --git a/framework/legacy/Textcube.Control.Session.Memcached.php b/framework/legacy/Textcube.Control.Session.Memcached.php index ba1768841..c84c2f015 100644 --- a/framework/legacy/Textcube.Control.Session.Memcached.php +++ b/framework/legacy/Textcube.Control.Session.Memcached.php @@ -43,7 +43,7 @@ public static function read($id) { public static function write($id, $data) { if(is_null(self::$mc)) self::initialize(); - return self::$mc->set(self::$context->getProperty('service.domain')."/sessions/{$id}/{$_SERVER['REMOTE_ADDR']}",$data,self::$context->getProperty('service.timeout')); + return self::$mc->set(self::$context->getProperty('service.domain')."/sessions/{$id}/{$_SERVER['REMOTE_ADDR']}",$data,0,self::$context->getProperty('service.timeout')); } public static function destroy($id, $setCookie = false) { @@ -67,9 +67,9 @@ private static function newAnonymousSession() { if (($id = self::getAnonymousSession()) !== false) return $id; $id = dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)); - $result = self::$mc->set(self::$context->getProperty('service.domain')."/sessions/{$id}/{$_SERVER['REMOTE_ADDR']}",true,self::$context->getProperty('service.timeout')); + $result = self::$mc->set(self::$context->getProperty('service.domain')."/sessions/{$id}/{$_SERVER['REMOTE_ADDR']}",true,0,self::$context->getProperty('service.timeout')); if ($result > 0) { - $result = self::$mc->set(self::$context->getProperty('service.domain')."/anonymousSession/{$_SERVER['REMOTE_ADDR']}",$id,self::$context->getProperty('service.timeout')); + $result = self::$mc->set(self::$context->getProperty('service.domain')."/anonymousSession/{$_SERVER['REMOTE_ADDR']}",$id,0,self::$context->getProperty('service.timeout')); return $id; } } @@ -132,7 +132,7 @@ public static function authorize($blogid, $userid) { $_SESSION['userid'] = $userid; $id = session_id(); if( self::isGuestOpenIDSession($id) ) { - $result = self::$mc->set(self::$context->getProperty('service.domain')."/authorizedSession/{$id}/{$_SERVER['REMOTE_ADDR']}",$userid,self::$context->getProperty('service.timeout')); + $result = self::$mc->set(self::$context->getProperty('service.domain')."/authorizedSession/{$id}/{$_SERVER['REMOTE_ADDR']}",$userid,0,self::$context->getProperty('service.timeout')); if ($result) { return true; } @@ -141,7 +141,7 @@ public static function authorize($blogid, $userid) { if (self::isAuthorized(session_id())) return true; for ($i = 0; $i < 3; $i++) { $id = dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)); - $result = self::$mc->set(self::$context->getProperty('service.domain')."/authorizedSession/{$id}/{$_SERVER['REMOTE_ADDR']}",$userid,self::$context->getProperty('service.timeout')); + $result = self::$mc->set(self::$context->getProperty('service.domain')."/authorizedSession/{$id}/{$_SERVER['REMOTE_ADDR']}",$userid,0,self::$context->getProperty('service.timeout')); if ($result) { @session_id($id); diff --git a/framework/legacy/Textcube.Data.CommentNotified.php b/framework/legacy/Textcube.Data.CommentNotified.php index c457d35be..a901a8f97 100644 --- a/framework/legacy/Textcube.Data.CommentNotified.php +++ b/framework/legacy/Textcube.Data.CommentNotified.php @@ -112,9 +112,9 @@ function add() { if (!$query = $this->_buildQuery()) return false; if (!$query->hasAttribute('written')) - $query->setAttribute('written', 'UNIX_TIMESTAMP()'); + $query->setAttribute('written', Timestamp::getUNIXtime()); if (!$query->hasAttribute('modified')) - $query->setAttribute('modified', 'UNIX_TIMESTAMP()'); + $query->setAttribute('modified', Timestamp::getUNIXtime()); if (!$query->insert()) { return $this->_error('insert'); diff --git a/framework/legacy/Textcube.Function.Setting.php b/framework/legacy/Textcube.Function.Setting.php index 29819d3bd..b44d8442f 100644 --- a/framework/legacy/Textcube.Function.Setting.php +++ b/framework/legacy/Textcube.Function.Setting.php @@ -37,7 +37,7 @@ function getBlogSettingGlobal($name, $default = null, $blogid = null, $directAcc if($directAccess == true) { $query = DBModel::getInstance(); $query->reset('BlogSettings'); - $query->setQualifier('blogid', 'equals', $blogid); + $query->setQualifier('blogid', 'equals', intval($blogid)); $query->setQualifier('name', 'equals', $name, true); return $query->getCell('value'); } @@ -65,7 +65,7 @@ function getBlogSettingsGlobal($blogid = null) { } $query = DBModel::getInstance(); $query->reset('BlogSettings'); - $query->setQualifier('blogid', 'equals', $blogid); + $query->setQualifier('blogid', 'equals', intval($blogid)); $blogSettings = $query->getAll(); if( $blogSettings ) { $result = array(); @@ -354,7 +354,7 @@ function getSkinSettings($blogid, $forceReload = false) { } $query = DBModel::getInstance(); $query->reset('SkinSettings'); - $query->setQualifier('blogid', 'equals', $blogid); + $query->setQualifier('blogid', 'equals', intval($blogid)); $skinSettings = $query->getAll(); if( $skinSettings ) { $result = array(); diff --git a/framework/legacy/Textcube.Model.Paging.php b/framework/legacy/Textcube.Model.Paging.php index 2f72fa5d8..2939ea75b 100644 --- a/framework/legacy/Textcube.Model.Paging.php +++ b/framework/legacy/Textcube.Model.Paging.php @@ -3,7 +3,7 @@ /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) class Paging { - function initPaging($url, $prefix = '?page=') { + function init($url, $prefix = '?page=') { return array('url' => rtrim($url,'?'), 'prefix' => $prefix, 'postfix' => '', 'total' => 0, 'pages' => 0, 'page' => 0, 'before' => array(), 'after' => array()); } @@ -94,19 +94,21 @@ function getPagingView( & $paging, & $template, & $itemTemplate, $useCache = fal $itemsView = ob_get_contents(); ob_end_clean(); $view = $template; - Misc::dress('prev_page', isset($paging['prev']) ? ($mode == 'href' ? "href='" : "href='#' onclick='")."$url$prefix{$paging['prev']}$postfix'" : '', $view, $useCache); + Misc::dress('prev_page', isset($paging['prev']) ? ($mode == 'href' ? "href=\"" : "href=\"#\" onclick=\"")."$url$prefix{$paging['prev']}$postfix\" rel=\"prev\"" : '', $view, $useCache); + Misc::dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view, $useCache); Misc::dress('paging_rep', $itemsView, $view, $useCache); - Misc::dress('next_page', isset($paging['next']) ? ($mode == 'href' ? "href='" : "href='#' onclick='")."$url$prefix{$paging['next']}$postfix'" : '', $view, $useCache); + Misc::dress('next_page', isset($paging['next']) ? ($mode == 'href' ? "href=\"" : "href=\"#\" onclick=\"")."$url$prefix{$paging['next']}$postfix\" rel=\"next\"" : '', $view, $useCache); + Misc::dress('next_page_title', isset($paging['next_title']) ? $paging['next'] : '', $view, $useCache); Misc::dress('no_more_prev', isset($paging['prev']) ? '' : 'no-more-prev', $view, $useCache); Misc::dress('no_more_next', isset($paging['next']) ? '' : 'no-more-next', $view, $useCache); return $view; } - function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=', $countItem = null, $onclick = null) { - global $folderURL, $service; + function fetch($sql, $page, $count, $url = null, $prefix = '?page=', $countItem = null, $onclick = null) { + $context = Model_Context::getInstance(); if ($url === null) - $url = $folderURL; + $url = $context->getProperty('uri.folder'); $paging = array('url' => $url, 'prefix' => $prefix, 'postfix' => '', 'onclick' => $onclick); if (empty($sql)) return array(array(), $paging); @@ -134,5 +136,14 @@ function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=', $ if ($countItem !== null) $count = $countItem; return array(POD::queryAll("$sql LIMIT $count OFFSET $offset"), $paging); } + /** Legacy methods **/ + + function initPaging($url, $prefix = '?page=') { + return self::init($url, $prefix); + } + + function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=', $countItem = null, $onclick = null) { + return self::fetch($sql, $page, $count, $url, $prefix, $countItem, $onclick); + } } ?> diff --git a/framework/legacy/Textcube.Model.Statistics.php b/framework/legacy/Textcube.Model.Statistics.php index 13a7591c0..7f8500bc1 100644 --- a/framework/legacy/Textcube.Model.Statistics.php +++ b/framework/legacy/Textcube.Model.Statistics.php @@ -64,7 +64,7 @@ function getRefererStatistics($blogid) { function getRefererLogsWithPage($page, $count) { global $database, $blogid; - return Paging::fetchWithPaging("SELECT host, url, referred FROM {$database['prefix']}RefererLogs WHERE blogid = $blogid ORDER BY referred DESC", $page, $count); + return Paging::fetch("SELECT host, url, referred FROM {$database['prefix']}RefererLogs WHERE blogid = $blogid ORDER BY referred DESC", $page, $count); } function getRefererLogs() { diff --git a/framework/utils/Browser.php b/framework/utils/Browser.php index 946392832..af557a0ef 100644 --- a/framework/utils/Browser.php +++ b/framework/utils/Browser.php @@ -49,6 +49,7 @@ public function getVersion() { } public function isMobile() { + return (in_array($this->getBrowserName(),array('mSafari'))); } public function isSafari() { } diff --git a/framework/utils/Unicode.php b/framework/utils/Unicode.php index 913af8895..f7618f9de 100644 --- a/framework/utils/Unicode.php +++ b/framework/utils/Unicode.php @@ -197,7 +197,7 @@ static function lessenAsByte($str, $bytes, $tail = '...') { elseif($siclVerifyInt===3) // Head byte of multi-bytes characters. $siclLocationSubtInt=1; elseif($siclVerifyInt===2) { // Middle of multi-bytes character. - for($siclLoopInt=2;$siclLengthInt>=$siclLoopInt;$siclLoopInt++) { // Seeking for head byte. + for($siclLoopInt=2;$bytes>=$siclLoopInt;$siclLoopInt++) { // Seeking for head byte. if((ord($str[$bytes-$siclLoopInt])>>6)!==2) break; } diff --git a/interface/blog/stream.php b/interface/blog/stream.php new file mode 100644 index 000000000..074a61751 --- /dev/null +++ b/interface/blog/stream.php @@ -0,0 +1,68 @@ + array( + 'page' => array ('int','min'=>1), + 'lines' => array ('int','min'=>1, 'default'=>15), + 'category' => array('string','mandatory'=>false), + 'keyword' => array('string','mandatory'=>false) + ) +); +require ROOT . '/library/preprocessor.php'; +requireStrictRoute(); + +$conditions = array(); +$conditions['blogid'] = getBlogId(); +$conditions['page'] = $_POST['page']; +if(isset($_POST['category'])) $conditions['category'] = $_POST['category']; +if(isset($_POST['keyword'])) $conditions['keyword'] = $_POST['keyword']; +$conditions['linesforpage'] = $_POST['lines']; + +$skin = new Skin($context->getProperty('skin.skin')); + +$line = Model_Line::getInstance(); +$stream = $line->getWithConditions($conditions); + +$contentView = ''; + +foreach ($stream as $item) { + $time = Timestamp::getHumanReadable($item['created']); + if($item['root'] == 'default') $item['root'] = 'Textcube Line'; + $contentView .= str_replace( + array( + '[##_line_rep_regdate_##]', + '[##_line_rep_content_##]', + '[##_line_rep_author_##]', + '[##_line_rep_source_##]', + '[##_line_rep_permalink_##]' + ), + array( + fireEvent('ViewLineDate', $time, $item['created']), + fireEvent('ViewLineContent', $item['content']), + fireEvent('ViewLineAuthor', htmlspecialchars($item['author'])), + fireEvent('ViewLineSource', htmlspecialchars($item['root'])), + fireEvent('ViewLinePermalink', $item['permalink']) + ), + $skin->lineItem + ); +} + +if(empty($stream)) { + $contentView = ''; + $buttonView = ''; +} else { + $buttonView = str_replace( + array( + '[##_line_onclick_more_##]' + ), + array( + 'getMoreLineStream('.($conditions['page']+1).','.$conditions['linesforpage'].',\'bottom\');return false;' + ), + $skin->lineButton + ); +} +$result = array('error'=>0,'contentView'=> $contentView,'buttonView'=>$buttonView); +Respond::PrintResult($result); +?> diff --git a/interface/common/blog/end.php b/interface/common/blog/end.php index a48426bbb..8925ed12e 100644 --- a/interface/common/blog/end.php +++ b/interface/common/blog/end.php @@ -102,7 +102,9 @@ $postfix = isset($paging['postfix']) ? $paging['postfix'] : ''; // prev_page, next_page for legacy support. dress('prev_page', isset($paging['prev']) ? "href='$url$prefix{$paging['prev']}$postfix'" : '',$view); + dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '',$view); dress('next_page', isset($paging['next']) ? "href='$url$prefix{$paging['next']}$postfix'" : '',$view); + dress('next_page_title', isset($paging['next_title']) ? $paging['next_title'] : '',$view); } else if(isset($cache) && strpos($cache->name,'Paging')!==false && $cache->load()) { dress('paging', $cache->contents, $view, false, true); } diff --git a/interface/common/blog/line.php b/interface/common/blog/line.php index e6f2f5efc..eb51492c9 100644 --- a/interface/common/blog/line.php +++ b/interface/common/blog/line.php @@ -31,7 +31,19 @@ $skin->lineItem ); } + $itemsView = '
'.CRLF.$itemsView.CRLF.'
'; dress('line_rep', $itemsView, $lineView); + $buttonView = str_replace( + array( + '[##_line_onclick_more_##]' + ), + array( + 'getMoreLineStream(2,20,\'bottom\');return false;' + ), + $skin->lineButton + ); + $buttonView = '
'.CRLF.$buttonView.CRLF.'
'; + dress('line_button', $buttonView, $lineView); $lineView = fireEvent('ViewLine', $lineView, $lines); dress('line_rssurl',$context->getProperty('uri.default').'/rss/line',$lineView); dress('line_atomurl',$context->getProperty('uri.default').'/atom/line',$lineView); @@ -39,6 +51,7 @@ // if(empty($lines)) $lineView = $lineView.CRLF.'[##_paging_line_##]'; dress('line', $lineView, $view); + if(isset($cache)) { $cache->contents = $lineView; $cache->dbContents = $paging; diff --git a/interface/common/owner/footer.php b/interface/common/owner/footer.php index fd5d684bc..2164e2467 100644 --- a/interface/common/owner/footer.php +++ b/interface/common/owner/footer.php @@ -138,7 +138,7 @@ getBrowserName() == 'mSafari') { + if($browser->isMobile()) { ?> window.addEventListener('load', function(){setTimeout(scrollTo, 0, 0, 1);}, false); getProperty('service.path').$context->getProperty('panel.skin');?>/basic.css" /> getBrowserName() == 'mSafari') { + if($browser->isMobile()) { ?> getProperty('uri.blog')."/comment/comment/$replyId"); + printIphoneErrorPage(_text('댓글 작성 오류.'), _text('이름을 입력해 주세요.'), $context->getProperty('uri.blog')."/comment/comment/$replyId"); } else if (!doesHaveOwnership() && empty($_GET["comment_$replyId"])) { - printIphoneErrorPage(_text('Comment write error.'), _text('Please enter content.'), $context->getProperty('uri.blog')."/comment/comment/$replyId"); + printIphoneErrorPage(_text('댓글 작성 오류.'), _text('내용을 입력해 주세요.'), $context->getProperty('uri.blog')."/comment/comment/$replyId"); } else { $comment = array(); $comment['entry'] = $entryId; @@ -36,17 +36,17 @@ $result = addComment($blogid, $comment); if (in_array($result, array('ip', 'name', 'homepage', 'comment', 'openidonly', 'etc'))) { if ($result == 'openidonly') { - $blockMessage = _text('You have to log in with and OpenID to leave a comment.'); + $blockMessage = _text('댓글을 쓰기 위해서는 OpenID로 로그인해야 합니다.'); } else { - $blockMessage = _textf('Blocked %1', $result); + $blockMessage = _textf('%1 은 차단되었습니다.', $result); } - printIphoneErrorPage(_text('Comment write blocked.'), $blockMessage, $context->getProperty('uri.blog')."/comment/$entryId"); + printIphoneErrorPage(_text('댓글 작성이 차단되었습니다.'), $blockMessage, $context->getProperty('uri.blog')."/comment/$entryId"); } else if ($result === false) { - printIphoneErrorPage(_text('Comment write error.'), _text('Cannot write comment.'), $context->getProperty('uri.blog')."/comment/$entryId"); + printIphoneErrorPage(_text('댓글 작성 오류.'), _text('댓글을 작성할 수 없었습니다.'), $context->getProperty('uri.blog')."/comment/$entryId"); } else { setcookie('guestName', $comment['name'], time() + 2592000, $context->getProperty('uri.blog')); setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $context->getProperty('uri.blog')); - printIphoneSimpleMessage(_text('Comment registered.'), _text('Go to comments page'), $context->getProperty('uri.blog')."/comment/$entryId"); + printIphoneSimpleMessage(_text('댓글이 등록되었습니다.'), _text('댓글 페이지로 이동'), $context->getProperty('uri.blog')."/comment/$entryId"); } } ?> diff --git a/interface/i/comment/comment/index.php b/interface/i/comment/comment/index.php index 2f536f8c6..97244a617 100644 --- a/interface/i/comment/comment/index.php +++ b/interface/i/comment/comment/index.php @@ -11,7 +11,7 @@ ?>
" title="Comment reply" selected="false">