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 Sep 12, 2010
1 parent 5829530 commit a121301
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 54 deletions.
1 change: 1 addition & 0 deletions documents/changelog_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* 일반 : paging 루틴 개선 (#1454)
* 일반 : 댓글에 댓글 달기 창의 높이 조정 (#1465)
* 일반 : 댓글 알리미 발송/수신시 스팸 필터를 거칠 수 있도록 수정 (#1472)
* 일반 : 이미지 관리 모델의 재작성 (#1482)
* 블로그 : 검색 form에 name 속성 추가 (#1481)
* 블로그 : 다중 블로그 모드에서 로그인 시 권한에 따라 안내 메세지를 출력하도록 추가 (#1485)
* 스킨 : 댓글을 단 후 에러메세지가 null로 출력되는 경우 상세하게 출력되도록 일부 루틴 추가 (#1496)
Expand Down
2 changes: 1 addition & 1 deletion framework/id/textcube/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
$service['debug_rewrite_module'] = false;
$service['useNumericURLonRSS'] = false;
$service['forceinstall'] = false;
//$service['adminskin'] = 'whitedream';
$service['adminskin'] = 'canon';
?>
11 changes: 6 additions & 5 deletions framework/legacy/Needlworks.Cache.PageCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ function flushSearchKeywordRSS($search = null) {
WHERE blogid = ".getBlogId()."
AND (name like 'searchATOM-".$search."%'
OR name like 'searchRSS-".$search."%')");
CacheControl::purgeItems($searchEntries);
if(!empty($searchEntries)) CacheControl::purgeItems($searchEntries);
return true;
}

Expand All @@ -461,23 +461,24 @@ function flushEntry($entryId = null) {

if(empty($entryId)) $entryId = '';
else $entryId = intval($entryId);

$Entries = POD::queryColumn("SELECT name
FROM {$database['prefix']}PageCacheLog
WHERE blogid = ".getBlogId()."
AND (name like 'entry-".$entryId."%' OR name = 'commentRSS-".$entryId."' OR name = 'commentATOM-".$entryId."')");
CacheControl::purgeItems($Entries);
AND (name like 'entry-".$entryId."-%' OR name like '%RSS-".$entryId."' OR name like '%ATOM-".$entryId."')");
if(!empty($Entries)) CacheControl::purgeItems($Entries);
if(!empty($entryId)) {
$entry = POD::queryCell("SELECT userid, category FROM {$database['prefix']}Entries
WHERE blogid = ".getBlogId()." AND id = $entryId");
if(!empty($entry)) {
CacheControl::flushAuthor($entry['userid']);
CacheControl::flushCategory($entry['category']);
CacheControl::flushDBCache();
CacheControl::flushDBCache('entry');
}
} else {
CacheControl::flushAuthor();
CacheControl::flushCategory();
CacheControl::flushDBCache();
CacheControl::flushDBCache('entry');
}
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion framework/legacy/Textcube.Function.Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function getContentWidth() {
$context = Model_Context::getInstance();

if($context->getProperty('skin.contentWidth') == NULL) { // Legacy code. ( < 1.8.4 does not have contentWidth information in DB)
$contentWidth = 450;
$contentWidth = 550;
if($skin = $context->getProperty('skin.skin')) {
if($xml = @file_get_contents(ROOT."/skin/blog/$skin/index.xml")) {
$xmls = new XMLStruct();
Expand All @@ -176,6 +176,7 @@ function getContentWidth() {
}
}
Setting::setSkinSetting('contentWidth',$contentWidth);
return $contentWidth;
} else return $context->getProperty('skin.contentWidth');
}

Expand Down
4 changes: 2 additions & 2 deletions framework/legacy/Textcube.Function.Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$__serviceSetting = array();
class Setting {
function fetchConfigVal( $DATA ){
return unserialize($DATA);
return is_null($DATA) ? null:unserialize($DATA);
// if (is_null($DATA)) return null; // Compartibility. If data is stored as array (new method), return it.
// if (is_array($DATA)) return $DATA;
// return Setting::fetchConfigVal_Legacy($DATA);
Expand Down Expand Up @@ -372,7 +372,7 @@ function getSkinSettings($blogid, $forceReload = false) {
'commentsOnRecent' => 5,
'commentsOnGuestbook' => 5,
'commentsOnEntry' => 15,
'contentWidth' => 450,
// 'contentWidth' => 550,
'archivesOnPage' => 5,
'tagsOnTagbox' => 30,
'tagboxAlign' => 3,
Expand Down
2 changes: 2 additions & 0 deletions interface/blog/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
'count' => $listWithPaging[1]['total'],
'category' => $category);
$paging = $listWithPaging[1];
$listView = null;
} else {
$paging = $cache->dbContents;
$listView = $cache->contents;
}
require ROOT . '/interface/common/blog/begin.php';
require ROOT . '/interface/common/blog/list.php';
Expand Down
4 changes: 2 additions & 2 deletions interface/common/blog/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)


if (isset($cache->contents)) {
dress('list', $cache->contents, $view);
if (!empty($listView)) {
dress('list', $listView, $view);
} else if (isset($list) && isset($skin)) {
$listView = $skin->list;
$itemsView = '';
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/communication/comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function toggleThisTr(tr, isActive) {
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false);
?>
</span>
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/communication/notify/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function toggleThisTr(tr, isActive) {
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print getPagingView($paging, $pagingTemplate, $pagingItemTemplate);
?>
</span>
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/communication/trackback/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ function toggleThisTr(tr, isActive) {
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false);
?>
</span>
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/communication/trash/comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function toggleThisTr(obj) {
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false);
?>
</span>
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/communication/trash/trackback/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function toggleThisTr(obj) {
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false);
?>
</span>
Expand Down
2 changes: 2 additions & 0 deletions interface/owner/entry/preview/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
requireModel('blog.entry');
requireModel('blog.response.remote');
requireModel('blog.sidebar');
define('__TEXTCUBE_NO_ENTRY_CACHE__', true);

$entries = array();
if (is_null($entry = getEntry($blogid, $suri['id'], true)))
$entry = getEntry($blogid, $suri['id'], false);
Expand Down
7 changes: 0 additions & 7 deletions interface/owner/plugin/currentSetting/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
);
require ROOT . '/library/preprocessor.php';

if (false) { // For optimization process
textTreat();
textareaTreat();
selectTreat();
checkboxTreat();
radioTreat();
}
$targetURL = $context->getProperty('uri.host').preg_replace( '/(currentSetting)$/' , 'receiveConfig' , $context->getProperty('uri.folder') );
$pluginName = $_GET['Name'];
$tabName = $_GET['Tab'];
Expand Down
6 changes: 3 additions & 3 deletions interface/owner/setting/blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,9 @@ function setLocale() {
<dl id="blog-frontpage-line" class="line">
<dt><span class="label"><?php echo _t('블로그 첫 페이지');?></span></dt>
<dd>
<input type="radio" id="frontpageEntry" class="radio" name="frontpage"<?php echo ($blog['frontpage']=='entry' ? ' checked="checked"' : '');?> /><label for="visibilityPrivate"><span class="text"><?php echo _t('블로그 첫 페이지에서 최근 글을 보여주도록 합니다.');?></span></label><br />
<input type="radio" id="frontpageCover" class="radio" name="frontpage"<?php echo ($blog['frontpage']=='cover' ? ' checked="checked"' : '');?> /><label for="visibilityMember"><span class="text"><?php echo _t('블로그 첫 페이지에서 표지를 보여주도록 합니다.');?></span></label><br />
<input type="radio" id="frontpageLine" class="radio" name="frontpage"<?php echo ($blog['frontpage']=='line' ? ' checked="checked"' : '');?> /><label for="visibilityPublic"><span class="text"><?php echo _t('블로그 첫 페이지에서 라인을 보여주도록 합니다.');?></span></label>
<input type="radio" id="frontpageEntry" class="radio" name="frontpage"<?php echo ($blog['frontpage']=='entry' ? ' checked="checked"' : '');?> /><label for="frontpageEntry"><span class="text"><?php echo _t('블로그 첫 페이지에서 최근 글을 보여주도록 합니다.');?></span></label><br />
<input type="radio" id="frontpageCover" class="radio" name="frontpage"<?php echo ($blog['frontpage']=='cover' ? ' checked="checked"' : '');?> /><label for="frontpageCover"><span class="text"><?php echo _t('블로그 첫 페이지에서 표지를 보여주도록 합니다.');?></span></label><br />
<input type="radio" id="frontpageLine" class="radio" name="frontpage"<?php echo ($blog['frontpage']=='line' ? ' checked="checked"' : '');?> /><label for="frontpageLine"><span class="text"><?php echo _t('블로그 첫 페이지에서 라인을 보여주도록 합니다.');?></span></label>
</dd>
<dd>
<p><label for="visibility"><?php echo _t('블로그 첫 페이지를 설정합니다.').' '._t('블로그 주소로 접근할 경우 처음 보이는 페이지를 선택합니다.');?></label></p>
Expand Down
36 changes: 20 additions & 16 deletions library/function/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ function getAttachmentExtracts($content, $blogid = null){
}

function getImageResizer($filename, $options = null, $blogid = null) {
// version 1.2.2
// version 1.2.5
// usages :
// $options = array('size'=>100) // resize & crop to square
// $options = array('width'=>100) // resize by width
// $options = array('width'=>100, 'height'=>50) // resize & crop by width and height
// $options = array('force'=>true) // refresh image
// $options = array('absolute'=>true) // use absolute path
// result : $url, $width, $height, $path

$context = Model_Context::getInstance();

Expand All @@ -108,7 +108,7 @@ function getImageResizer($filename, $options = null, $blogid = null) {
$originWidth = $imageInfo[0];
$originHeight = $imageInfo[1];

if (!extension_loaded('gd')) return array($originURL, $originWidth, $originHeight);
if (!extension_loaded('gd')) return array($originURL, $originWidth, $originHeight, $originSrc);

if (!is_dir(ROOT."/cache/thumbnail")) {
@mkdir(ROOT."/cache/thumbnail");
Expand All @@ -119,56 +119,60 @@ function getImageResizer($filename, $options = null, $blogid = null) {
@chmod(ROOT."/cache/thumbnail/" . $blogid, 0777);
}

$objResize = new Utils_Image();
requireComponent('Textcube.Function.Image');
$objResize = new Image();
$objResize->imageFile = $originSrc;
if (isset($options['size']) && is_numeric($options['size'])) {
if ($imageInfo[0] > $imageInfo[1])
list($tempWidth, $tempHeight) = $objResize->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], NULL, $options['size']);
else
list($tempWidth, $tempHeight) = $objResize->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], $options['size'], null);

$resizeWidth = $resizeHeight = $options['size'];
$resizeFilename = preg_replace("/\\.([[:alnum:]]+)$/i", ".w{$resizeWidth}-h{$resizeHeight}.\\1", $filename);
} else if (isset($options['width']) && is_numeric($options['width']) && isset($options['height']) && is_numeric($options['height'])) {
if ($options['width'] / $options['height'] > intval($imageInfo[0]) / intval($imageInfo[1]))
list($tempWidth, $tempHeight) = $objResize->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], $options['width'], NULL);
else
list($tempWidth, $tempHeight) = $objResize->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], NULL, $options['height']);
$resizeWidth = $tempWidth;
$resizeHeight = $tempHeight;
$resizeFilename = preg_replace("/\\.([[:alnum:]]+)$/i", ".w{$options['width']}-h{$options['height']}.\\1", $filename);

$resizeWidth = $options['width'];
$resizeHeight = $options['height'];
} else {
if (isset($options['width']) && is_numeric($options['width'])) {
list($tempWidth, $tempHeight) = $objResize->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], $options['width'], NULL);
} elseif (isset($options['height']) && is_numeric($options['height'])) {
list($tempWidth, $tempHeight) = $objResize->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], NULL, $options['height']);
} else {
unset($objResize);
return array($originURL, $originWidth, $originHeight);
return array($originURL, $originWidth, $originHeight, $originSrc);
}

$resizeWidth = $tempWidth;
$resizeHeight = $tempHeight;
$resizeFilename = preg_replace("/\\.([[:alnum:]]+)$/i", ".w{$resizeWidth}-h{$resizeHeight}.\\1", $filename);
}
$resizeFilename = preg_replace("/\\.([[:alnum:]]+)$/i", ".w{$resizeWidth}-h{$resizeHeight}.\\1", $filename);
$resizeSrc = ROOT . "/cache/thumbnail/{$blogid}/{$resizeFilename}";
$resizeURL = ($absolute ? $context->getProperty('uri.service'):$context->getProperty('uri.path')) . "/cache/thumbnail/{$blogid}/{$resizeFilename}";

if($force) @unlink($resizeSrc);

if (file_exists($resizeSrc)) {
unset($objResize);
return array($resizeURL, $resizeWidth, $resizeHeight);
return array($resizeURL, $resizeWidth, $resizeHeight, $resizeSrc);
}
if ($objResize->resample($tempWidth, $tempHeight)) {
if (isset($options['size']) && is_numeric($options['size']))
@$objResize->cropRectBySize($options['size'], $options['size']);
if (isset($options['width']) && is_numeric($options['width']) && isset($options['height']) && is_numeric($options['height']))
if (isset($options['width']) && is_numeric($options['width']) && isset($options['height']) && is_numeric($options['height'])) {
@$objResize->cropRectBySize($options['width'], $options['height']);
} else if (isset($options['size']) && is_numeric($options['size'])) {
@$objResize->cropRectBySize($options['size'], $options['size']);
}
if ($objResize->saveAsFile($resizeSrc)) {
@chmod($resizeSrc, 0666);
unset($objResize);
return array($resizeURL, $resizeWidth, $resizeHeight);
return array($resizeURL, $resizeWidth, $resizeHeight, $resizeSrc);
}
}
unset($objResize);
return array($originURL, $originWidth, $originHeight);
return array($originURL, $originWidth, $originHeight, $originSrc);
}
?>
11 changes: 6 additions & 5 deletions library/model/blog.entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ function addEntry($blogid, $entry, $userid = null) {
if($entry['visibility'] < 0) {
$closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime',INT_MAX);
if($published < $closestReservedTime) {
setBlogSetting('closestReservedPostTime',$published);
Setting::setBlogSetting('closestReservedPostTime',$published,true);
}
}
} else {
Expand Down Expand Up @@ -623,15 +623,17 @@ function addEntry($blogid, $entry, $userid = null) {
POD::query("UPDATE {$database['prefix']}Attachments SET parent = $id WHERE blogid = $blogid AND parent = 0");
POD::query("DELETE FROM {$database['prefix']}Entries WHERE blogid = $blogid AND id = $id AND draft = 1");
updateCategoryByEntryId($blogid, $id, 'add');
CacheControl::flushEntry($id);
clearFeed();

if ($entry['visibility'] == 3)
syndicateEntry($id, 'create');
if ($entry['visibility'] >= 2) {
CacheControl::flushAuthor($userid);
CacheControl::flushDBCache('entry');
$gCacheStorage->purge();
clearFeed();
}

if (!empty($entry['tag'])) {
$tags = getTagsWithEntryString($entry['tag']);
Tag::addTagsWithEntryId($blogid, $id, $tags);
Expand Down Expand Up @@ -728,7 +730,7 @@ function updateEntry($blogid, $entry, $updateDraft = 0) {
if($entry['visibility'] < 0) {
$closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime',9999999999);
if($published < $closestReservedTime) {
setBlogSetting('closestReservedPostTime',$published);
Setting::setBlogSetting('closestReservedPostTime',$published,true);
}
}
break;
Expand Down Expand Up @@ -762,8 +764,7 @@ function updateEntry($blogid, $entry, $updateDraft = 0) {
'visibility'=>array($oldEntry['visibility'],$entry['visibility'])
));

CacheControl::flushAuthor($entry['userid']);
CacheControl::flushDBCache('entry');
CacheControl::flushEntry($entry['id']);
$gCacheStorage->purge();
if ($entry['visibility'] == 3)
syndicateEntry($entry['id'], 'modify');
Expand Down
5 changes: 3 additions & 2 deletions library/model/common.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ function handleDataSet( $plugin , $DATA ) {
if( ! $xmls->open($DATA) ) {
unset($xmls);
return array('error' => '3' ,'customError' => '' ) ;
}unset($xmls);
}
unset($xmls);
if( ! in_array($plugin, $activePlugins) )
return array('error' => '9' , 'customError'=> _f('%1 : 플러그인이 활성화되어 있지 않아 설정을 저장하지 못했습니다.',$plugin));
$reSetting = true;
Expand All @@ -589,7 +590,7 @@ function handleDataSet( $plugin , $DATA ) {
}
}

$reSetting = call_user_func( $configMappings[$plugin]['dataValHandler'] , $DATA);
$reSetting = call_user_func( $configMappings[$plugin]['dataValHandler'] , serialize(Setting::fetchConfigXML($DATA)));
$pluginURL = $pluginPath = $pluginName = "";
if(!is_null($languageDomain)) $locale->domain = $languageDomain;
}
Expand Down
1 change: 0 additions & 1 deletion library/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@
}
$pageCache->contents = serialize($p);
$pageCache->update();
//Setting::setBlogSettingGlobal('PluginSettings',serialize($p));
}
if(empty($formatterCount)) { // Any formatter is used, add the ttml formatter.
activatePlugin('FM_TTML');
Expand Down
2 changes: 1 addition & 1 deletion library/preprocessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
if(!is_null($context->getProperty('service.adminskin'))) {
$context->setProperty('panel.skin',"/skin/admin/".$context->getProperty('service.adminskin'));
} else {
$context->setProperty('panel.skin',"/skin/admin/".Setting::getBlogSettingGlobal("adminSkin", "whitedream"));
$context->setProperty('panel.skin',"/skin/admin/".Setting::getBlogSettingGlobal("adminSkin", "canon"));
}
}
// content 본문에 removeAllTags()가 적용되는 것을 방지하기 위한 프로세스를 위한 변수.
Expand Down
4 changes: 2 additions & 2 deletions library/view/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,10 @@ function getEntryContentView($blogid, $id, $content, $formatter, $keywords = arr
requireModel('blog.keyword');
requireLibrary('blog.skin');

$cacheKey = 'entry-'.$id.$type.($bRssMode ? 'format' : 'summarize').($useAbsolutePath ? 'absoultePath' : 'relativePath').(defined('__TEXTCUBE_MOBILE__') ? 'mobile' : '');
$cacheKey = 'entry-'.$id.'-'.$type.($bRssMode ? 'format' : 'summarize').($useAbsolutePath ? 'absoultePath' : 'relativePath').(defined('__TEXTCUBE_MOBILE__') ? 'mobile' : '');
$cache = pageCache::getInstance();
$cache->name = $cacheKey;
if($cache->load()) { // If cached content exists.
if(!defined('__TEXTCUBE_NO_ENTRY_CACHE__') && $cache->load()) { // If cached content exists.
$view = $cache->contents;
} else { // No cache is found.
$content = fireEvent('Format' . $type . 'Content', $content, $id);
Expand Down
1 change: 0 additions & 1 deletion skin/admin/whitedream/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,6 @@ table.data-inbox tbody tr td.inactive-class
right : 25px;
text-align : right;
top : 5.5em;
width : 25em;
z-index : 1;
}

Expand Down

0 comments on commit a121301

Please sign in to comment.