Skip to content

Commit

Permalink
refs #514 : merged with 1.8-stable. now swapping with 1.8s tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Apr 27, 2011
2 parents c4aeee0 + 4819743 commit a42f436
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 64 deletions.
3 changes: 3 additions & 0 deletions documents/changelog_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
== v1.8.6 개발 관련 노트 ==
=== 추가된 점 ===
* 스킨 : 댓글 다 보여주기 / 페이징 여부에 상관없이 댓글 정렬 순서를 스킨/스킨 상세 설정 에서 조정할 수 있도록 함.(#1570)
* 블로그 : 안드로이드에서 iPhone/iPod Touch와 동일한 UI 지원 (#1576)

=== 변경된 점 ===
* 일반 : jQuery 라이브러리의 버전 업데이트 (#1560)
Expand All @@ -13,6 +14,8 @@
* 일반 : PHP 5.3 이상에서 DirectoryIterator가 더이상 순차적 파일 이름 정렬을 보장하지 않아 발생할 수 있는 라이브러리 로드 문제 수정 (#1564)
* 리더 : 플래시를 통하여 악의적 공격이 가능할 수 있는 문제 수정 (#1107)
* OpenID : 방문자 계정을 생성하여 XSS 삽입 방식의 공격이 가능할 수 있는 문제 수정 (#1558)
* Setup : 설치시 MySQL쿼리의 문법 오류 수정 (#1577)
* 스킨 : 스킨 편집시 마지막으로 편집한 탭의 내용이 저장되지 않는 문제 수정 (#1580)

== v1.8.5 개발 관련 노트 ==
=== 변경된 점 ===
Expand Down
2 changes: 1 addition & 1 deletion framework/data/DBModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ protected function _capsulateFields($requestedFieldArray) {
protected function getQualifierModel($name, $condition, $value = null, $escape = false, $autoquote = true) {
//OR, setQualifier(string(name_condition_value), $escape = null) - Descriptive mode (NOT implemented)
if (is_null($condition)) {
$qualifiers = null;
$qualifiers = $relations = null;
} else {
switch(strtolower($condition)) {
case 'equals':
Expand Down
3 changes: 2 additions & 1 deletion framework/id/textcube/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
// Define basic signatures.
define('TEXTCUBE_NAME', 'Textcube');
define('TEXTCUBE_VERSION', '1.8.7 : Beta 1');
define('TEXTCUBE_REVISION', 'root-main-branch1.8-r29');
define('TEXTCUBE_COPYRIGHT', 'Copyright © 2004-2011. Needlworks / Tatter Network Foundation. All rights reserved. Licensed under the GPL.');
define('TEXTCUBE_HOMEPAGE', 'http://www.textcube.org/');
define('TEXTCUBE_RESOURCE_URL', 'http://resources.textcube.org/1.8.4');
define('TEXTCUBE_RESOURCE_URL', 'http://resources.textcube.org/1.8.6');
define('TEXTCUBE_NOTICE_URL','http://feeds.feedburner.com/textcube/');
define('CRLF', "\r\n");
define('TAB', " ");
Expand Down
66 changes: 36 additions & 30 deletions framework/legacy/Needlworks.PHP.Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,48 @@ function requireLibrary($name) {

/** Autoload components */
class Autoload_Legacy {
private static $db = array(
'POD','DBQuery');
private static $data = array(
'Attachment','BlogSetting','BlogStatistics','Category','Comment','CommentNotified',
'CommentNotifiedSiteInfo','DailyStatistics','DataMaintenance','Feed',
'Filter','GuestComment','Keyword','Link','LinkCategories','Notice','PluginSetting','Post',
'RefererLog','RefererStatistics','ServiceSetting','SkinSetting','SubscriptionLog',
'SubscriptionStatistics','Tag','Trackback','TrackbackLog','UserInfo','UserSetting'
);
private static $model = array(
'Message','Paging','PluginCustomConfig','Statistics','User'
);
private static $base = array(
'Base64Stream','HTTPRequest','OutputWriter','XMLRPC','XMLRPCFault',
'XMLCustomType','XMLTree','Pop3','CommunicationFeed');
private static $function = array(
'Image','Setting','Respond','Misc');
private static $openid = array(
'OpenID', 'OpenIDSession', 'OpenIDConsumer');
private static $control = array(
'Session','RSS');
public static function load($name) {
private function initialize() {
$this->db = array(
'POD','DBQuery');
$this->data = array(
'Attachment','BlogSetting','BlogStatistics','Category','Comment','CommentNotified',
'CommentNotifiedSiteInfo','DailyStatistics','DataMaintenance','Feed',
'Filter','GuestComment','Keyword','Link','LinkCategories','Notice','PluginSetting','Post',
'RefererLog','RefererStatistics','ServiceSetting','SkinSetting','SubscriptionLog',
'SubscriptionStatistics','Tag','Trackback','TrackbackLog','UserInfo','UserSetting'
);
$this->model = array(
'Message','Paging','PluginCustomConfig','Statistics','User'
);
$this->base = array(
'Base64Stream','HTTPRequest','OutputWriter','XMLRPC','XMLRPCFault',
'XMLCustomType','XMLTree','Pop3','CommunicationFeed');
$this->function = array(
'Image','Setting','Respond','Misc');
$this->openid = array(
'OpenID', 'OpenIDSession', 'OpenIDConsumer');
$this->control = array(
'Session','RSS');
}
public function load($name) {
global $service, $database;
$name = ucfirst($name);
if(in_array($name,self::$data)) {
if(!isset($this->data)) {
$this->initialize();
}
if(in_array($name,$this->data)) {
require_once(ROOT . "/framework/legacy/Textcube.Data.".$name.".php");
} else if (in_array($name,self::$model)) {
} else if (in_array($name,$this->model)) {
require_once(ROOT . "/framework/legacy/Textcube.Model.".$name.".php");
} else if (in_array($name,self::$base)) {
} else if (in_array($name,$this->base)) {
if(in_array($name, array('XMLRPC','XMLRPCFault','XMLCustomType')))
require_once(ROOT . "/framework/legacy/Needlworks.PHP.XMLRPC.php");
else require_once(ROOT . "/framework/legacy/Needlworks.PHP.".$name.".php");
} else if (in_array($name,self::$function)) {
} else if (in_array($name,$this->function)) {
require_once(ROOT . "/framework/legacy/Textcube.Function.".$name.".php");
} else if (in_array($name,self::$openid)) {
} else if (in_array($name,$this->openid)) {
require_once(ROOT . "/framework/legacy/Textcube.Control.Openid.php");
} else if (in_array($name,self::$control)) {
} else if (in_array($name,$this->control)) {
if($name == 'Session' && isset($service['memcached']) && $service['memcached'] == true)
require_once(ROOT . "/framework/legacy/Textcube.Control.".$name.".Memcached.php");
else require_once(ROOT . "/framework/legacy/Textcube.Control.".$name.".php");
Expand All @@ -86,5 +91,6 @@ public static function load($name) {
}
}
}
spl_autoload_register(array('Autoload_Legacy', 'load'));
?>
$autoloadInstance_Legacy = new Autoload_Legacy();
spl_autoload_register(array($autoloadInstance_Legacy, 'load'));
?>
6 changes: 3 additions & 3 deletions framework/utils/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ function __construct() {
public function getBrowserName() {
/// Blocking (is in development)
$ctx = Model_Context::getInstance();
if($ctx->getProperty('service.usemobileadmin',true) === false) {
return 'unknown';
}
// if($ctx->getProperty('service.usemobileadmin',true) === false) {
// return 'unknown';
// }
if(!is_null($this->browserName)) return $this->browserName;
if(isset($_SERVER['HTTP_USER_AGENT'])) {
if(strpos($_SERVER['HTTP_USER_AGENT'],'iPhone') ||
Expand Down
3 changes: 2 additions & 1 deletion interface/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
require ROOT . '/library/preprocessor.php';

// Redirect for ipod touch / iPhone
if(Setting::getBlogSettingGlobal('useiPhoneUI',true) && (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'],'iPod') || strpos($_SERVER['HTTP_USER_AGENT'],'iPhone')))){
$browserUtil = Utils_Browser::getInstance();
if(Setting::getBlogSettingGlobal('useiPhoneUI',true) && ($browserUtil->isMobile() == true)){
if(isset($suri['id'])) {
$slogan = getSloganById($blogid, $suri['id']);
if(!empty($slogan)) {
Expand Down
3 changes: 0 additions & 3 deletions interface/owner/skin/edit/download/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
);

require ROOT . '/library/preprocessor.php';
if (false) {
fetchConfigVal();
}

if (!file_exists(ROOT . "/skin/customize/".getBlogId()."/".$_GET['file']))
exit;
Expand Down
60 changes: 39 additions & 21 deletions interface/owner/skin/edit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,58 @@ function setSkin(mode) {
if ((mode == 'skin' && skinHTMLSaved == false) || (mode == 'style' && skinStyleSaved == false)) {
if(mode == 'skin' && currentTag != 'all') {
skinData = skinCode;
currentCode = document.getElementById(mode).value;
var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/skin/edit/crop/");
request.onSuccess = function() {
skinData = this.getText("/response/skinCode");
saveSkinCode(mode,skinData,file);
}
request.onError = function() {
if (this.getText("/response/msg"))
alert(this.getText("/response/msg"));
else
alert('<?php echo _t('실패했습니다.');?>');
}
request.send('skinCode='+encodeURIComponent(skinCode)
+'&currentTag='+encodeURIComponent(currentTag)
+'&currentCode='+encodeURIComponent(currentCode)
+'&nextTag=all');
} else {
skinData = skin.value;
saveSkinCode(mode,skinData,file);
}

var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/skin/edit/skin/");
request.onSuccess = function() {
PM.showMessage("<?php echo _t('저장되었습니다');?>", "center", "bottom");

if (mode == 'skin') {
skinHTMLSaved = true;
if(document.getElementById('skin-download').innerHTML == '') {
document.getElementById('skin-download').innerHTML = '<a href="<?php echo $blogURL;?>/owner/skin/edit/download/?file=skin.html"><?php echo _t('내려받기');?></a>';
}
} else {
skinStyleSaved = true;
}
}
function saveSkinCode(mode,skinData,file) {
var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/skin/edit/skin/");
request.onSuccess = function() {
PM.showMessage("<?php echo _t('저장되었습니다');?>", "center", "bottom");

if (mode == 'skin') {
skinHTMLSaved = true;
if(document.getElementById('skin-download').innerHTML == '') {
document.getElementById('skin-download').innerHTML = '<a href="<?php echo $blogURL;?>/owner/skin/edit/download/?file=skin.html"><?php echo _t('내려받기');?></a>';
}
} else {
skinStyleSaved = true;
}
request.onError = function() {
if (this.getText("/response/msg"))
alert(this.getText("/response/msg"));
else
alert('<?php echo _t('실패했습니다.');?>');
}
request.send('mode='+mode+'&body='+encodeURIComponent(skinData)+'&file='+ file.value);
}
request.onError = function() {
if (this.getText("/response/msg"))
alert(this.getText("/response/msg"));
else
alert('<?php echo _t('실패했습니다.');?>');
}
request.send('mode='+mode+'&body='+encodeURIComponent(skinData)+'&file='+ file.value);
}

var currentTag = 'all';
var currentCode = '';

function changeTab(mode,tag) {
currentCode = document.getElementById(mode).value;
var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/skin/edit/crop/");
request.onSuccess = function() {
PM.showMessage("<?php echo _t('불러왔습니다.');?>", "center", "top");
PM.showMessage("<?php echo _t('불러왔습니다.');?>", "center", "bottom");
document.getElementById(mode).value = (this.getText("/response/code") ? this.getText("/response/code") : '');
skinCode = this.getText("/response/skinCode");
document.getElementById('skin-'+currentTag).className = '';
Expand Down
2 changes: 1 addition & 1 deletion library/preprocessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
$bootFiles = array(); // From PHP 5.3, DirectoryIterator does not gurantee the order.
foreach (new DirectoryIterator(ROOT.'/framework/boot') as $fileInfo) {
if($fileInfo->isFile()) array_push($bootFiles, $fileInfo->getPathname());
if($fileInfo->isFile() && substr($fileInfo->getBasename(),-3) == 'php') array_push($bootFiles, $fileInfo->getPathname());
}
sort($bootFiles);
foreach ($bootFiles as $bf) {
Expand Down
4 changes: 2 additions & 2 deletions resources/setup/initialize.MySQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ CREATE TABLE [##_dbPrefix_##]Lines (
root varchar(11) NOT NULL default 'default',
category varchar(11) NOT NULL default 'public',
author varchar(32) NOT NULL default '',
content mediumtext NOT NULL default '',
content mediumtext NOT NULL,
permalink varchar(128) NOT NULL default '',
created int(11) NOT NULL default 0,
PRIMARY KEY (id),
Expand Down Expand Up @@ -415,7 +415,7 @@ CREATE TABLE [##_dbPrefix_##]Widgets (
height int(11) DEFAULT NULL,
scrolling int(1) default 0,
feature varchar(32) default 'opensocial',
content text NOT NULL default '',
content text NOT NULL,
PRIMARY KEY(id),
KEY(blogid)
) [##_charset_##];
Expand Down
2 changes: 1 addition & 1 deletion rewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

define('ROOT', '.');
define('ROOT',dirname(__FILE__));
require_once(ROOT.'/framework/Dispatcher.php');
/** Dispatching Interface request via URI */
$dispatcher = Dispatcher::getInstance();
Expand Down

0 comments on commit a42f436

Please sign in to comment.