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 Jan 20, 2010
1 parent 5dd0e61 commit ca24856
Show file tree
Hide file tree
Showing 54 changed files with 3,276 additions and 148 deletions.
8 changes: 6 additions & 2 deletions documents/changelog_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
== v1.8.2 개발 관련 노트 ==
=== 추가된 점 ===
* 설치 : 설치시 PHP 버전을 확인하여 동작 가능 여부를 알려줌 (#1406)

* 플러그인 : 플러그인 언어 리소스가 플러그인이 생성하는 관리 패널 영역까지 적용됨 (#1412)

=== 변경된 점 ===
* 일반 : 컨텐츠 포매팅 시 이미지 및 첨부파일을 절대 경로를 참조하도록 기본 값을 수정 (#1407)

Expand All @@ -13,7 +14,10 @@
* 관리패널 : 서비스 - 언어 설정에서 셀렉트박스에 언어 목록이 이상하게 출력되는 문제 수정 (#1403)
* 관리패널 : line 기능을 주소 검색줄에 추가하는 버튼이 오동작하는 문제 수정 (#1148)
* 일반 : 세션 관련 Config 객체 (1.8 베타때 사용되었음) 사용하는 부분을 모두 다시 구현 (#1322)

* 일반 : 체크업으로 데이터베이스 업데이트 시 오타 난 부분 수정 (#1410)
* 일반 : memcached 기반의 캐시 운영시 플러싱 오류 수정 (#1362)
* 모바일 : 아이폰 모드에서 그림 출력 및 페이지 출력이 이상하게 되는 문제 수정 (#1408, #1415)
* 설치 : MySQLi 모드 설치시 캐릭터셋 설정이 빠지는 문제 수정 (#1066)


== v1.8.1 개발 관련 노트 ==
Expand Down
18 changes: 10 additions & 8 deletions framework/legacy/Textcube.Control.Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ final class Session {
private static $sessionDBRepair = false;
private static $sConfig = null;
private static $context = null;
private static $pool = null;

function __construct() {
$sessionMicrotime = Timer::getMicroTime();
}

private static function initialize() {
self::$context = Model_Context::getInstance();
self::$pool = DBModel::getInstance();
}

public static function open($savePath, $sessionName) {
Expand Down Expand Up @@ -78,25 +80,24 @@ public static function write($id, $data) {

public static function destroy($id, $setCookie = false) {
if(is_null(self::$context)) self::initialize();
@self::query('cell',"DELETE FROM ".self::$context->getProperty('database.prefix')."Sessions
self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."Sessions
WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'");
self::gc();
}

public static function gc($maxLifeTime = false) {
if(is_null(self::$context)) self::initialize();
@self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."Sessions
self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."Sessions
WHERE updated < (UNIX_TIMESTAMP() - ".self::$context->getProperty('service.timeout').")");
$result = @self::query('all',"SELECT DISTINCT v.id, v.address
$result = self::query('all',"SELECT DISTINCT v.id, v.address
FROM ".self::$context->getProperty('database.prefix')."SessionVisits v
LEFT JOIN ".self::$context->getProperty('database.prefix')."Sessions s ON v.id = s.id AND v.address = s.address
WHERE s.id IS NULL AND s.address IS NULL");
if ($result) {
$gc = array();
foreach ($result as $g)
array_push($gc, $g);
foreach ($gc as $g)
@self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."SessionVisits WHERE id = '{$g[0]}' AND address = '{$g[1]}'");
foreach ($result as $g) {
self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."SessionVisits WHERE id = '{$g['id']}' AND address = '{$g['address']}'");
}
}
return true;
}
Expand Down Expand Up @@ -231,7 +232,8 @@ private static function query($mode='query',$sql) {
$result = self::DBQuery($mode,$sql);
if($result === false) {
if (self::$sessionDBRepair === false) {
@POD::query("REPAIR TABLE ".self::$context->getProperty('database.prefix')."Sessions, ".self::$context->getProperty('database.prefix')."SessionVisits");
@POD::query("REPAIR TABLE ".self::$context->getProperty('database.prefix')."Sessions");
@POD::query("REPAIR TABLE ".self::$context->getProperty('database.prefix')."SessionVisits");
$result = self::DBQuery($mode,$sql);
self::$sessionDBRepair = true;
}
Expand Down
59 changes: 59 additions & 0 deletions framework/utils/Browser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/// Copyright (c) 2004-2010, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

final class Utils_Browser extends Singleton
{
private static $browserName;
public static function getInstance() {
return self::_getInstance(__CLASS__);
}

function __construct() {
$this->browserName = null;
}

public function getBrowserName() {
if(!is_null($this->browserName)) return $this->browserName;
if(isset($_SERVER['HTTP_USER_AGENT'])) {
if(strpos($_SERVER['HTTP_USER_AGENT'],'iPhone') ||
strpos($_SERVER['HTTP_USER_AGENT'],'iPod')) {
$this->browserName = 'mSafari';
} else if(strpos($_SERVER['HTTP_USER_AGENT'],'Firefox') ||
strpos($_SERVER['HTTP_USER_AGENT'],'iceweasel') ||
strpos($_SERVER['HTTP_USER_AGENT'],'Minefield')) {
$this->browserName = 'firefox';
} else if(strpos($_SERVER['HTTP_USER_AGENT'],'Safari')) {
$this->browserName = 'Safari';
} else if(strpos($_SERVER['HTTP_USER_AGENT'],'Chrome')) {
$this->browserName = 'Chrome';
} else if (strpos($_SERVER['HTTP_USER_AGENT'],'Webkit')) {
$this->browserName = 'Webkit';
} else if (strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) {
$this->browserName = 'IE';
} else if (strpos($_SERVER['HTTP_USER_AGENT'],'Opera')) {
$this->browserName = 'Opera';
} else {
$this->browserName = 'unknown';
}
}
return $this->browserName;
}
public function getVersion() {
}

public function isMobile() {
}
public function isSafari() {
}
public function isIE() {
}
public function isOpera() {
}

function __destruct() {
// Nothing to do: destruction of this class means the end of execution
}
}
?>
20 changes: 20 additions & 0 deletions interface/blog/checkup.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,26 @@ function clearCache() {
}
}

if (!POD::queryExistence("DESC {$database['prefix']}FeedSettings loadimage")) {
$changed = true;
echo '<li>', _text('피드 설정 테이블의 테이블 구조 오류를 보정합니다.'), ': ';
if (POD::execute("ALTER TABLE {$database['prefix']}FeedSettings CHANGE loadimge loadimage int(11) NOT NULL DEFAULT 1")) {
showCheckupMessage(true);
} else {
showCheckupMessage(false);
}
}

if (!POD::queryExistence("DESC {$database['prefix']}OpenIDUsers loginCount")) {
$changed = true;
echo '<li>', _text('OpenID 사용자 테이블의 테이블 구조 오류를 보정합니다.'), ': ';
if (POD::execute("ALTER TABLE {$database['prefix']}OpenIDUsers CHANGE loginCount logincount int(11) default NULL")) {
showCheckupMessage(true);
} else {
showCheckupMessage(false);
}
}

if (!POD::queryExistence("DESC {$database['prefix']}Filters filtertype")) {
$changed = true;
echo '<li>', _text('필터 호환성을 위하여 필드의 이름을 변경합니다.'), ': ';
Expand Down
8 changes: 5 additions & 3 deletions interface/blog/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
);
define('__TEXTCUBE_LOGIN__',true);
require ROOT . '/library/preprocessor.php';

$ctx = Model_Context::getInstance();
$userURL = $ctx->getProperty('user.homepage');
$blogURL = $ctx->getProperty('uri.blog');
if (substr($blogURL, -1) != '/') $blogURL .= '/';
if (!isset($user['homepage']) ) $user['homepage'] = '/';
if (substr($user['homepage'], -1) != '/') $user['homepage'] .= '/';
if (!isset($userURL) ) $userURL = '/';
if (substr($userURL, -1) != '/') $userURL .= '/';

if (isset($_GET['requestURI']))
$_POST['requestURI'] = $_GET['requestURI'];
Expand Down
6 changes: 6 additions & 0 deletions interface/common/owner/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@
}
<?php
echo activateDetailPanelJS();
$browser = Utils_Browser::getInstance();
if($browser->getBrowserName() == 'mSafari') {
?>
window.addEventListener('load', function(){setTimeout(scrollTo, 0, 0, 1);}, false);
<?php
}
?>
//]]>
</script>
Expand Down
6 changes: 6 additions & 0 deletions interface/common/owner/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@
<title><?php echo htmlspecialchars($blog['title']);?> &gt; <?php echo $blogMenu['title'];?></title>
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $service['path'].$adminSkinSetting['skin'];?>/basic.css" />
<?php
$browser = Utils_Browser::getInstance();
if($browser->getBrowserName() == 'mSafari') {
?>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<?php
}
// common CSS.
foreach($blogMenu['loadCSS'] as $loadCSS) {
?>
Expand Down
1 change: 1 addition & 0 deletions interface/i/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<?php
if (doesHaveOwnership()) {
?>
<li><a href="<?php echo $defaultURL;?>/owner/center/dashboard" onclick="window.location.href='<?php echo $defaultURL;?>/owner/center/dashboard'" class="link dashboard"><?php echo _text('관리 패널');?></a></li>
<li><a href="<?php echo $blogURL;?>/logout" class="link logout"><?php echo _text('로그아웃');?></a></li>
<?php
}else{
Expand Down
1 change: 1 addition & 0 deletions interface/i/login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<?php echo _text('로그인 하였습니다.');?>
</div>
<a href="#" onclick="self.location.reload();" class="whiteButton margin-top10"><?php echo _text('첫 페이지로 돌아가기');?></a>
<a href="<?php echo $defaultURL."/owner/center/dashboard";?>" onclick="window.location.href='<?php echo $defaultURL."/owner/center/dashboard";?>'" class="whiteButton margin-top10"><?php echo _text('관리 패널로 들어가기');?></a>
</div>
<?php
}
Expand Down
27 changes: 23 additions & 4 deletions interface/login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo _text('Textcube - Login');?></title>

<?php
$browser = Utils_Browser::getInstance();
if($browser->getBrowserName() === 'mSafari') {
?>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<?php
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo $context->getProperty('service.path').$adminSkinSetting['skin'];?>/basic.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $context->getProperty('service.path').$adminSkinSetting['skin'];?>/login.css" />
<!--[if lte IE 6]>
Expand All @@ -111,6 +118,14 @@

function execLoadFunction() {
document.forms[0].<?php echo (empty($_COOKIE['TSSESSION_LOGINID']) ? 'loginid' : 'password');?>.focus();
<?php
$browser = Utils_Browser::getInstance();
if($browser->getBrowserName() == 'mSafari') {
?>
setTimeout(scrollTo, 0, 0, 1);
<?php
}
?>
}
//]]>
</script>
Expand Down Expand Up @@ -210,12 +225,12 @@ function checkTextcubeVersion() {
</div>

<?php if (!empty($openid_help_link) || !empty($openid_signup_link)) { ?>
<ul>
<ul id="openid-intro">
<?php if( !empty( $openid_help_link ) ) { ?>
<li id="openid-help"><a href="<?php echo $openid_help_link; ?>" ><?php echo _text('오픈아이디란?') ?></a></li>
<?php } ?>
<?php if( !empty( $openid_signup_link ) ) { ?>
<li><a href="<?php echo $openid_signup_link; ?>"><?php echo _text('오픈아이디 발급하기'); ?></a></li>
<li id="openid-generate"><a href="<?php echo $openid_signup_link; ?>"><?php echo _text('오픈아이디 발급하기'); ?></a></li>
<?php } ?>
</ul>
<?php } ?>
Expand All @@ -242,6 +257,10 @@ function focus_openid(){
</div> <!-- data-outbox -->
</div> <!-- all-wrap -->
</div> <!-- temp-wrap -->
<?php if( function_exists('__tcSqlLogDump') ) { __tcSqlLogDump(); } ?>
<?php
if( function_exists('__tcSqlLogDump') ) {
__tcSqlLogDump();
}
?>
</body>
</html>
Loading

0 comments on commit ca24856

Please sign in to comment.