notice 오류 해결
This commit is contained in:
@ -100,7 +100,11 @@ function set_cookie($cookie_name, $value, $expire)
|
||||
// 쿠키변수값 얻음
|
||||
function get_cookie($cookie_name)
|
||||
{
|
||||
return base64_decode($_COOKIE[md5($cookie_name)]);
|
||||
$cookie = md5($cookie_name);
|
||||
if (array_key_exists($cookie, $_COOKIE))
|
||||
return base64_decode($_COOKIE[md5($cookie_name)]);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@ -1000,10 +1004,15 @@ function cut_str($str, $len, $suffix="…")
|
||||
global $g4;
|
||||
|
||||
if (strtoupper($g4['charset']) == 'UTF-8') {
|
||||
$c = substr(str_pad(decbin(ord($str{$len})),8,'0',STR_PAD_LEFT),0,2);
|
||||
if ($c == '10')
|
||||
for (;$c != '11' && $c{0} == 1;$c = substr(str_pad(decbin(ord($str{--$len})),8,'0',STR_PAD_LEFT),0,2));
|
||||
return substr($str,0,$len) . (strlen($str)-strlen($suffix) >= $len ? $suffix : '');
|
||||
if (strlen($str) >= $len) {
|
||||
//echo $str,', ',strlen($str),', ',$len;
|
||||
$c = substr(str_pad(decbin(ord($str[$len-1])),8,'0',STR_PAD_LEFT),0,2);
|
||||
if ($c == '10')
|
||||
for (;$c != '11' && $c{0} == 1;$c = substr(str_pad(decbin(ord($str{--$len})),8,'0',STR_PAD_LEFT),0,2));
|
||||
return substr($str,0,$len) . (strlen($str)-strlen($suffix) >= $len ? $suffix : '');
|
||||
} else {
|
||||
return $str;
|
||||
}
|
||||
} else {
|
||||
$s = substr($str, 0, $len);
|
||||
$cnt = 0;
|
||||
|
||||
@ -4,15 +4,19 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 외부로그인
|
||||
function outlogin($skin_dir='basic')
|
||||
{
|
||||
global $config, $member, $g4, $urlencode, $is_admin;
|
||||
global $config, $member, $g4, $urlencode, $is_admin, $is_member;
|
||||
|
||||
$nick = cut_str($member['mb_nick'], $config['cf_cut_name']);
|
||||
$point = number_format($member['mb_point']);
|
||||
if (array_key_exists('mb_nick', $member)) {
|
||||
$nick = cut_str($member['mb_nick'], $config['cf_cut_name']);
|
||||
}
|
||||
if (array_key_exists('mb_point', $member)) {
|
||||
$point = number_format($member['mb_point']);
|
||||
}
|
||||
|
||||
$outlogin_skin_path = $g4['path'].'/skin/outlogin/'.$skin_dir;
|
||||
|
||||
// 읽지 않은 쪽지가 있다면
|
||||
if ($member['mb_id']) {
|
||||
if ($is_member) {
|
||||
$sql = " select count(*) as cnt from {$g4['memo_table']} where me_recv_mb_id = '{$member['mb_id']}' and me_read_datetime = '0000-00-00 00:00:00' ";
|
||||
$row = sql_fetch($sql);
|
||||
$memo_not_read = $row['cnt'];
|
||||
@ -25,7 +29,7 @@ function outlogin($skin_dir='basic')
|
||||
}
|
||||
|
||||
ob_start();
|
||||
if ($member['mb_id'])
|
||||
if ($is_member)
|
||||
include_once ($outlogin_skin_path.'/outlogin.skin.2.php');
|
||||
else // 로그인 전이라면
|
||||
include_once ($outlogin_skin_path.'/outlogin.skin.1.php');
|
||||
|
||||
Reference in New Issue
Block a user