Skip to content

Commit

Permalink
refs #514
Browse files Browse the repository at this point in the history
  * 1.8 트리와 동기화
  • Loading branch information
inureyes committed Apr 30, 2010
1 parent 635f510 commit 66a0d97
Show file tree
Hide file tree
Showing 43 changed files with 285 additions and 205 deletions.
15 changes: 15 additions & 0 deletions documents/changelog_ko.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
* 이 문서는 변경사항을 모두 포함하고 있지 않을 수 있습니다. 자세한 변경사항 열람을 위해서는 텍스트큐브 개발 사이트 (http://dev.textcube.org) 의 해당 버전의 로드맵과 티켓들을 확인해 주시기 바랍니다.
* 버그 로그는 일반적으로 이전 버전에서 발생했으나 해결된 부분을 포함하며, 이번 버전을 만드는 과정에서 발생하는 버그는 기록하지 않습니다.


== v1.8.3.1 개발 관련 노트 ==
=== 버그 수정 ===
* 관리패널 : Canon 관리패널 스킨을 사용하는 경우 xquared 에디터에서 툴바 위치가 제목을 가리는 문제 수정 (#1444)
* 관리패널 : 플러그인 아이콘이 패스 기반의 사용자에서 나타나지 않는 문제 수정 (#1444)
* 블로그 : 갤러리가 동작하지 않는 문제 수정 (#1444)
* 블로그 : 그림을 눌렀을 때 큰 창으로 팝업이 뜨지 않는 문제 수정 (#1444)
* 블로그 : 댓글 ajax가 패스 기반에서 동작하지 않는 문제 수정 (#1444)
* 에디터 : 업로드 레이아웃이 깨지는 문제 수정 (#1444)
* 에디터 : 플래시 업로더로 파일을 지울 경우 파일 업로드 로그가 모두 지워지는 문제 수정 (#1464)
* 에디터 : 플래시 업로더 사용시 삭제 버튼이 두 개 출력되는 문제 수정 (#777)
* 설치 : 설치시 PHP 버전 체크가 되지 않는 문제 수정 (#1444)
* 일반 : 댓글, 댓글 알리미, 받은 트랙백, 링크, 링크 카테고리, 트랙백 및 핑백 데이터를 복원할 때 복원이 제대로 되지 않는 문제 수정 (#1298)
* 모바일 : 아이폰 모드에서 퍼머링크를 따라 들어와 바로 글 보기가 동작하지 않는 문제 수정 (#1444)

== v1.8.3 개발 관련 노트 ==
=== 추가된 점 ===
* 블로그 : 최근 공지와 최근 글의 필자 치환자 추가 및 동작 추가 (#1437)
Expand Down
8 changes: 6 additions & 2 deletions framework/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ private function URIinterpreter() {
$interfacePath = 'interface/blog/'.$pathPart.'/index.php';
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].(isset($uri['fragment'][2]) ? '/'.$uri['fragment'][2] : '').(isset($uri['fragment'][3]) ? '/'.$uri['fragment'][3] : '');
if(isset($uri['fragment'][1])) {
if(in_array($uri['fragment'][1],array('archive','category','entry','guestbook','imageResizer','link','login','logout','pannels','protected','search','tag','trackback'))) {
$pathPart = $uri['fragment'][0].'/'.$uri['fragment'][1];
} else if($uri['fragment'][1] == 'comment') {
$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];
}
Expand Down
2 changes: 1 addition & 1 deletion framework/boot/20-Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ static function load($className) {
}
}
spl_autoload_register(array('Autoload', 'load'));
?>
?>
2 changes: 1 addition & 1 deletion framework/legacy/Textcube.Data.Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function getNextCategoryId($id = 0) {
if($id==0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1 : $id);
}

function getCount() {
Expand Down
19 changes: 13 additions & 6 deletions framework/legacy/Textcube.Data.Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ function add() {
if (!isset($this->isfiltered))
$this->isfiltered = 0;

//regacy
// legacy
if (isset($this->commenter)) {$this->replier = $this->commenter;/*unset($this->commenter);*/;}

if (!$query = $this->_buildQuery())
return false;
if (!$query->hasAttribute('written'))
$query->setAttribute('written', 'UNIX_TIMESTAMP()');
$query->setAttribute('written', Timestamp::getUNIXtime());

if (!$query->insert())
return $this->_error('insert');
Expand Down Expand Up @@ -137,7 +137,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1 : $id);
}

function _buildQuery() {
Expand All @@ -163,9 +163,16 @@ function _buildQuery() {
if (isset($this->commenter)) {
if (!Validator::number($this->commenter, 1))
return $this->_error('commenter');
if (!$this->name = User::getName($this->commenter))
return $this->_error('commenter');
$query->setAttribute('replier', $this->commenter);
if(!isset($this->name)) {
if (!$this->name = User::getName($this->commenter))
return $this->_error('commenter');
} else { // name information exists. however, replier maybe different from services.
// It is a limitation of spec.
if($this->name == User::getName($this->commenter)) { // If name == commenter, it is same service (maybe).
$query->setAttribute('replier', $this->commenter);
}
}
// $query->setAttribute('replier', $this->commenter);
}
if (isset($this->name)) {
$this->name = UTF8::lessenAsEncoding(trim($this->name), 80);
Expand Down
2 changes: 1 addition & 1 deletion framework/legacy/Textcube.Data.CommentNotified.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
2 changes: 1 addition & 1 deletion framework/legacy/Textcube.Data.CommentNotifiedSiteInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
2 changes: 1 addition & 1 deletion framework/legacy/Textcube.Data.GuestComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
4 changes: 2 additions & 2 deletions framework/legacy/Textcube.Data.Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ function getNextLinkId($id = 0) {
if($id==0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}
function getNextLinkPid($id = 0) {
global $database;
$maxId = POD::queryCell("SELECT MAX(pid) FROM {$database['prefix']}Links");
if($id==0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
4 changes: 2 additions & 2 deletions framework/legacy/Textcube.Data.LinkCategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ function getNextLinkCategoryId($id = 0) {
if($id==0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}
function getNextLinkCategoryPid($id = 0) {
global $database;
$maxId = POD::queryCell("SELECT MAX(pid) FROM {$database['prefix']}LinkCategories");
if($id==0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
4 changes: 2 additions & 2 deletions framework/legacy/Textcube.Data.RemoteResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down Expand Up @@ -275,7 +275,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
2 changes: 1 addition & 1 deletion framework/legacy/Textcube.Data.Trackback.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1: $id);
}

function _buildQuery() {
Expand Down
2 changes: 1 addition & 1 deletion framework/legacy/Textcube.Data.TrackbackLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function nextId($id = 0) {
if($id == 0)
return $maxId + 1;
else
return ($maxId > $id ? $maxId : $id);
return ($maxId > $id ? $maxId + 1 : $id);
}

function _buildQuery() {
Expand Down
2 changes: 1 addition & 1 deletion interface/blog/comment/add/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
$commentCount = 0;
$recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem)));
}
echo '<?xml version="1.0" encoding="utf-8"?><response><error>0</error><commentView>'.$commentView.'</commentView><commentCount>'.$commentCount.'</commentCount><commentBlock><![CDATA[', $commentBlock, ']]></commentBlock><recentCommentBlock><![CDATA[', $recentCommentBlock, ']]></recentCommentBlock></response>';
echo '<?xml version="1.0" encoding="utf-8"?><response><error>0</error><commentView><![CDATA['.$commentView.']]></commentView><commentCount>'.$commentCount.'</commentCount><commentBlock><![CDATA[', $commentBlock, ']]></commentBlock><recentCommentBlock><![CDATA[', $recentCommentBlock, ']]></recentCommentBlock></response>';
}
}
?>
10 changes: 7 additions & 3 deletions interface/owner/data/import/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function importer($path, $node, $line) {
$comment->latitude = $cursor['latitude'][0]['.value'];
$comment->content = $cursor['content'][0]['.value'];
if (!empty($cursor['isFiltered'][0]['.value']))
$comment->isfiltered = $cursor['isFiltered'][0]['.value'];
$comment->isfiltered = $cursor['isFiltered'][0]['.value'];
if (!$comment->add())
user_error(__LINE__ . $comment->error);
if (isset($node['comment'][$i]['comment'])) {
Expand All @@ -394,9 +394,13 @@ function importer($path, $node, $line) {
$childComment->password = $cursor['password'][0]['.value'];
$childComment->secret = $cursor['secret'][0]['.value'];
$childComment->written = $cursor['written'][0]['.value'];
if (isset($cursor['longitude'][0]['.value']))
$comment->longitude = $cursor['longitude'][0]['.value'];
if (isset($cursor['latitude'][0]['.value']))
$comment->latitude = $cursor['latitude'][0]['.value'];
$childComment->content = $cursor['content'][0]['.value'];
if (!empty($cursor['isFiltered'][0]['.value']))
$childComment->isFiltered = $cursor['isFiltered'][0]['.value'];
$childComment->isfiltered = $cursor['isFiltered'][0]['.value'];
if (!$childComment->add())
user_error(__LINE__ . $childComment->error);
}
Expand Down Expand Up @@ -688,7 +692,7 @@ function importer($path, $node, $line) {
$setting->tagsOnTagbox = $node['tagsOnTagbox'][0]['.value'];
$setting->alignOnTagbox = $node['alignOnTagbox'][0]['.value'];
$setting->expandComment = $node['expandComment'][0]['.value'];
$setting->expandTrackback = $node['expandCrackback'][0]['.value'];
$setting->expandTrackback = $node['expandTrackback'][0]['.value'];
if (!empty($node['recentNoticeLength'][0]['.value']))
$setting->recentNoticeLength = $node['recentNoticeLength'][0]['.value'];
$setting->recentEntryLength = $node['recentEntryLength'][0]['.value'];
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/plugin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function togglePlugin(plugin, num, width, height, obj, force) {
else
currentIcon.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<?php echo $context->getProperty('service.path');?>/plugins/' + plugin + '/images/icon_plugin_off.png", sizingMethod="scale")'
} else {
if (currentIcon.src == "<?php echo $context->getProperty('service.path') . $adminSkinSetting['skin'];?>/image/icon_plugin_on.png")
if (currentIcon.src == "<?php echo $context->getPropeerty('uri.host').$context->getProperty('service.path') . $adminSkinSetting['skin'];?>/image/icon_plugin_on.png")
currentIcon.src = '<?php echo $context->getProperty('service.path') . $adminSkinSetting['skin'];?>/image/icon_plugin_off.png';
else
currentIcon.src = '<?php echo $context->getProperty('service.path');?>/plugins/' + plugin + '/images/icon_plugin_off.png';
Expand Down
6 changes: 3 additions & 3 deletions library/model/blog.attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ function deleteAttachmentMulti($blogid, $parent, $names) {
continue;
$origname = $name;
$pool->reset('Attachments');
$pool->setAttribute('blogid','eq',$blogid);
$pool->setAttribute('parent','eq',$parent);
$pool->setAttribute('name','eq',$name,true);
$pool->setQualifier('blogid','eq',$blogid);
$pool->setQualifier('parent','eq',intval($parent));
$pool->setQualifier('name','eq',$name,true);
if($pool->delete()) {
unlink(ROOT . "/attach/$blogid/$origname");
} else {
Expand Down
2 changes: 1 addition & 1 deletion library/model/blog.entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ function syndicateEntry($id, $mode) {

$pool->reset('XMLRPCPingSettings');
$pool->setQualifier('blogid','equals',$context->getProperty('blog.id'));
$sites = $pool->getAll('url,type');
$sites = $pool->getAll('url,pingtype');

$entry = getEntry($context->getProperty('blog.id'), $id);
if (is_null($entry)) return false;
Expand Down
4 changes: 2 additions & 2 deletions library/model/blog.trash.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ function trashVan() {
global $database;
requireModel('common.setting');
if(Timestamp::getUNIXtime() - Setting::getServiceSetting('lastTrashSweep',0, true) > 86400) {
var_dump(Timestamp::getUNIXtime());
var_dump(Setting::getServiceSetting('lastTrashSweep',0, true));
// var_dump(Timestamp::getUNIXtime());
// var_dump(Setting::getServiceSetting('lastTrashSweep',0, true));
POD::execute("DELETE FROM {$database['prefix']}Comments where isfiltered < ".Timestamp::getUNIXtime()." - 1296000 AND isfiltered > 0");
POD::execute("DELETE FROM {$database['prefix']}RemoteResponses where isfiltered < ".Timestamp::getUNIXtime()." - 1296000 AND isfiltered > 0");
POD::execute("DELETE FROM {$database['prefix']}RefererLogs WHERE referred < ".Timestamp::getUNIXtime()." - 604800");
Expand Down
39 changes: 33 additions & 6 deletions library/view/iphoneView.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

function printIphoneEntryContentView($blogid, $entry, $keywords = array()) {
global $blogURL;
if (doesHaveOwnership() || ($entry['visibility'] >= 2) || (isset($_COOKIE['GUEST_PASSWORD']) && (trim($_COOKIE['GUEST_PASSWORD']) == trim($entry['password']))))
print '<div class="entry_body">'.(getEntryContentView($blogid, $entry['id'], $entry['content'], $entry['contentformatter'], $keywords)).'</div>';
else
{
if (doesHaveOwnership() || ($entry['visibility'] >= 2) || (isset($_COOKIE['GUEST_PASSWORD']) && (trim($_COOKIE['GUEST_PASSWORD']) == trim($entry['password'])))) {
$content = getEntryContentView($blogid, $entry['id'], $entry['content'], $entry['contentformatter'], $keywords, 'Post', false);
print '<div class="entry_body">' . printIphoneFreeImageResizer($content) . '</div>';
} else {
?>
<p><b><?php echo _text('Protected post!');?></b></p>
<form id="passwordForm" class="dialog" method="post" action="<?php echo $blogURL;?>/protected/<?php echo $entry['id'];?>">
Expand Down Expand Up @@ -232,18 +232,45 @@ function printIphoneHtmlHeader($title = '') {
}

function printIphoneAttachmentExtract($content){
global $service;
$blogid = getBlogId();
$result = null;

if(preg_match_all('/\[##_(1R|1L|1C|2C|3C|iMazing|Gallery)\|[^|]*\.(gif|jpg|jpeg|png|bmp|GIF|JPG|JPEG|PNG|BMP)\|.*_##\]/si', $content, $matches)) {
$split = explode("|", $matches[0][0]);
$result = $split[1];
}else if(preg_match_all('/<img[^>]+?src=("|\')?([^\'">]*?)("|\')/si', $content, $matches)) {
if(stristr($matches[2][0], 'http://') ){
} else if(preg_match_all('/<img[^>]+?src=("|\')?([^\'">]*?)("|\')/si', $content, $matches)) {
$pattern1 = $service['path'] . "/attach/{$blogid}/";
$pattern2 = "[##_ATTACH_PATH_##]";

if ((strpos($matches[2][0], $pattern1) === 0) || (strpos($matches[2][0], $pattern2) === 0)) {
$result = basename($matches[2][0]);
} else {
$result = $matches[2][0];
}
}
return $result;
}

function printIphoneFreeImageResizer($content) {
global $service, $blogURL;
$blogid = getBlogId();
$pattern1 = "@<img.+src=['\"](.+)['\"].*>@Usi";
$pattern2 = $service['path'] . "/attach/{$blogid}/";

if (preg_match_all($pattern1, $content, $matches)) {
foreach($matches[0] as $imageTag) {
preg_match($pattern1, $imageTag, $matche);
if (strpos($matche[1], $pattern2) === 0) {
$filename = basename($matche[1]);
$replaceTag = preg_replace($pattern1 , "<img src=\"{$blogURL}/imageResizer/?f={$filename}\" alt=\"\" />", $matche[0]);
$content = str_replace($matche[0], $replaceTag, $content);
}
}
}
return $content;
}

function printIphoneImageResizer($blogid, $filename, $cropSize){
global $serviceURL;
requireComponent('Textcube.Function.misc');
Expand Down
2 changes: 1 addition & 1 deletion library/view/ownerView.php
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ function refreshUploadButton() {
</div>
<script type="text/javascript">
//<![CDATA[
if (!DetectFlashVer(8, 0, 0) || !(isIE || isMoz || isMinSafari3) || <?php echo ($context->getProperty('service.flashuploader') ? 'true' : 'false');?>) {
if (!DetectFlashVer(8, 0, 0) || !(isIE || isMoz || isMinSafari3) || <?php echo ($context->getProperty('service.flashuploader', true) ? 'false' : 'true');?>) {
var deleteButtonContainer = document.getElementById('fileUploadNest');
deleteButtonContainer.innerHTML = '<input type="button" id="deleteBtn" class="input-button" value="<?php echo _t('삭제하기');?>" onclick="deleteAttachment();return false" />' + deleteButtonContainer.innerHTML;
}
Expand Down
5 changes: 3 additions & 2 deletions library/view/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function getUpperView($paging) {
<script type="text/javascript">
//<![CDATA[
var servicePath = "<?php echo $context->getProperty('service.path');?>";
var serviceURL = "<?php echo $context->getProperty('uri.service');?>";
var blogURL = "<?php echo $context->getProperty('uri.blog');?>";
var prevURL = "<?php echo isset($paging['prev']) ? escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['prev']}{$paging['postfix']}") : '';?>";
var nextURL = "<?php echo isset($paging['next']) ? escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['next']}{$paging['postfix']}") : '';?>";
Expand Down Expand Up @@ -1560,11 +1561,11 @@ function printFeedEntry($blogid, $group = 0, $feed = 0, $entry = 0, $unreadOnly
}

function printScript($filename, $obfuscate = true) {
global $service, $hostURL, $blogURL;
global $service, $hostURL, $blogURL, $serviceURL;
if (!$file = @file_get_contents(ROOT . "/resources/script/$filename"))
return '';
$file = "<script type=\"text/javascript\">//<![CDATA[" . CRLF
. "var servicePath=\"".$hostURL.$service['path']."\"; var blogURL=\"".$hostURL.$blogURL."/\";".$file;
. $file;
// if ($obfuscate) {
// }
return "$file //]]></script>";
Expand Down
1 change: 1 addition & 0 deletions plugins/FM_Modern/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ TTModernEditor.prototype.syncContents = function() {
}

TTModernEditor.prototype.syncTextarea = function() {
this.correctContent();
return this.syncContents();
}
// TTML로 작성된 파일을 HTML 뷰에 뿌려주기 위해 변환
Expand Down
2 changes: 1 addition & 1 deletion plugins/JP_TC_PluginForTwitter/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ function getUpdatingNewLineToTwitter($target, $mother) {
$data = Setting::fetchConfigVal($configVal);
getTwitterInitConfigVal($data);

if (!empty($data['username']) && !empty($data['password'])) {
if (!empty($data['username']) && !empty($data['password']) && !empty($data['synchronizeLine'])) {
$content = UTF8::lessenAsEncoding($mother->content,140);
$tw = new Twitter($data['username'], $data['password']);
$updated = $tw->updateStatus($content);
Expand Down
Loading

0 comments on commit 66a0d97

Please sign in to comment.