notice 오류 해결

This commit is contained in:
gnuboard
2012-12-26 11:53:02 +09:00
parent 6907449605
commit b65315fcca
10 changed files with 59 additions and 46 deletions

View File

@ -2,8 +2,8 @@
/*******************************************************************************
** 공통 변수, 상수, 코드
*******************************************************************************/
//error_reporting(E_ALL);
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL);
//error_reporting(E_ALL ^ E_NOTICE);
// 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정
header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"');
@ -92,11 +92,11 @@ if( !get_magic_quotes_gpc() )
}
}
if ($_GET['g4_path'] || $_POST['g4_path'] || $_COOKIE['g4_path']) {
if (isset($_GET['g4_path']) || isset($_POST['g4_path']) || isset($_COOKIE['g4_path'])) {
unset($_GET['g4_path']);
unset($_POST['g4_path']);
unset($_COOKIE['g4_path']);
unset($g4_path);
if (isset($g4_path)) unset($g4_path);
}
@ -311,7 +311,7 @@ if (strpos($_SERVER[PHP_SELF], $g4['admin']) === false)
*/
// 4.00.03 : [보안관련] PHPSESSID 가 틀리면 로그아웃한다.
if ($_REQUEST['PHPSESSID'] && $_REQUEST['PHPSESSID'] != session_id())
if (isset($_REQUEST['PHPSESSID']) && $_REQUEST['PHPSESSID'] != session_id())
goto_url($g4['bbs_path'].'/logout.php');
// QUERY_STRING
@ -361,11 +361,11 @@ if (isset($page)) { // 리스트 페이지
$qstr .= '&page=' . urlencode($page);
}
if ($wr_id) {
if (isset($wr_id)) {
$wr_id = (int)$wr_id;
}
if ($bo_table) {
if (isset($bo_table)) {
$bo_table = preg_match("/^[a-zA-Z0-9_]+$/", $bo_table) ? $bo_table : '';
}
@ -382,7 +382,7 @@ else {
// 자동로그인 부분에서 첫로그인에 포인트 부여하던것을 로그인중일때로 변경하면서 코드도 대폭 수정하였습니다.
if ($_SESSION['ss_mb_id']) // 로그인중이라면
if (array_key_exists('ss_mb_id', $_SESSION)) // 로그인중이라면
{
$member = get_member($_SESSION['ss_mb_id']);
@ -440,11 +440,18 @@ else
if (!get_cookie('ck_first_call')) set_cookie('ck_first_call', $g4['server_time'], 86400 * 365);
if (!get_cookie('ck_first_referer')) set_cookie('ck_first_referer', $_SERVER['HTTP_REFERER'], 86400 * 365);
// 회원이 아니라면 권한을 방문객 권한으로 함
if (!($member['mb_id']))
$member['mb_level'] = 1;
else
// 회원, 비회원 구분
$is_member = $is_guest = false;
$is_admin = "";
if (array_key_exists('mb_id', $member)) {
$is_member = true;
$is_admin = is_admin($member['mb_id']);
$member['mb_dir'] = substr($member['mb_id'],0,2);
} else {
$is_guest = true;
$member['mb_id'] = "";
$member['mb_level'] = 1; // 비회원의 경우 회원레벨을 가장 낮게 설정
}
//$member['mb_level_title'] = $g4['member_level'][$member['mb_level']]; // 권한명
@ -463,16 +470,6 @@ if (isset($bo_table)) {
if (isset($gr_id))
$group = sql_fetch(" select * from {$g4['group_table']} where gr_id = '$gr_id' ");
// 회원, 비회원 구분
$is_member = $is_guest = false;
if ($member['mb_id'])
$is_member = true;
else
$is_guest = true;
$is_admin = is_admin($member['mb_id']);
if ($is_admin != 'super') {
// 접근가능 IP
$cf_possible_ip = trim($config['cf_possible_ip']);

View File

@ -18,7 +18,7 @@ include_once($g4['path'].'/lib/popular.lib.php');
<div id="logo"><a href="<?=$g4['path']?>/">초기화면</a></div>
<ul>
<? if ($member['mb_id']) { ?>
<? if ($is_member) { ?>
<li><a href="<?=$g4['bbs_path']?>/logout.php">로그아웃</a></li>
<li><a href="<?=$g4['bbs_path']?>/member_confirm.php?url=register_form.php">정보수정</a></li>
<? if ($is_admin) { ?><li><a href="<?=$g4['path']?>/adm">관리자</a></li><? } ?>
@ -39,7 +39,7 @@ include_once($g4['path'].'/lib/popular.lib.php');
<input type="submit" value="검색">
</fieldset>
</form>
<? if (!$bo_table) {?><h1><?=$g4['title']?></h1><? } ?>
<? if (!isset($bo_table)) {?><h1><?=$g4['title']?></h1><? } ?>
</header>
<div>

View File

@ -8,7 +8,7 @@ if (!$g4['title'])
$g4['title'] = $config['cf_title'];
// 쪽지를 받았나?
if ($member['mb_memo_call']) {
if (isset($member['mb_memo_call']) && $member['mb_memo_call']) {
$mb = get_member($member['mb_memo_call'], "mb_nick");
sql_query(" update {$g4['member_table']} set mb_memo_call = '' where mb_id = '{$member['mb_id']}' ");
@ -48,7 +48,7 @@ header("Pragma: no-cache"); // HTTP/1.0
<head>
<meta charset="<?=$g4['charset']?>">
<title><?=$g4['title']?></title>
<? if ($administrator) { ?>
<? if (isset($administrator)) { ?>
<link rel="stylesheet" href="<?=$g4['path']?>/css/adm.css?=<?=date("md")?>">
<? } else { ?>
<link rel="stylesheet" href="<?=$g4['path']?>/css/def.css?=<?=date("md")?>">

View File

@ -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;

View File

@ -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');

View File

@ -2,4 +2,4 @@
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<div><a href="<?=$g4['bbs_path']?>/current_connect.php">현재접속자 <?=$row[total_cnt]?> 중 회원 <?=$row[mb_cnt]?></a></div>
<div><a href="<?=$g4['bbs_path']?>/current_connect.php">현재접속자 <?=$row['total_cnt']?> 중 회원 <?=$row['mb_cnt']?></a></div>

View File

@ -22,11 +22,11 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
if (isset($list[$i]['icon_new'])) echo " " . $list[$i]['icon_new'];
if (isset($list[$i]['icon_file'])) echo " " . $list[$i]['icon_file'];
if (isset($list[$i]['icon_link'])) echo " " . $list[$i]['icon_link'];
if (isset($list[$i]['icon_hot'])) echo " " . $list[$i]['icon_hot'];
if (isset($list[$i]['icon_secret'])) echo " " . $list[$i]['icon_secret'];
?>
</li>
<? } ?>

View File

@ -19,7 +19,7 @@ $po = sql_fetch(" select * from $g4[poll_table] where po_id = '$po_id' ");
<input type="hidden" name="po_id" value="<?=$po_id?>">
<input type="hidden" name="skin_dir" value="<?=$skin_dir?>">
<? if ($is_admin == "super") { ?><a href="<?=$g4[admin_path]?>/poll_form.php?w=u&amp;po_id=<?=$po_id?>">설문조사 관리</a><? } ?>
<?=$po[po_subject]?>
<?=$po['po_subject']?>
<ul>
<? for ($i=1; $i<=9 && $po["po_poll{$i}"]; $i++) { ?>
<li><input type="radio" name="gb_poll" value="<?=$i?>" id='gb_poll_<?=$i?>'> <label for='gb_poll_<?=$i?>'><?=$po['po_poll'.$i]?></label></li>

View File

@ -6,7 +6,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<h2>사이트 인기검색어</h2>
<ul>
<? for ($i=0; $i<count($list); $i++) { ?>
<li><a href="<?=$g4[bbs_path]?>/search.php?sfl=wr_subject&amp;sop=and&amp;stx=<?=urlencode($list[$i][pp_word])?>"><?=$list[$i][pp_word]?></a></li>
<li><a href="<?=$g4['bbs_path']?>/search.php?sfl=wr_subject&amp;sop=and&amp;stx=<?=urlencode($list[$i]['pp_word'])?>"><?=$list[$i]['pp_word']?></a></li>
<? } ?>
</ul>
</section>

View File

@ -1,2 +1,5 @@
<table>
<thead>
<?
$str = "xx";
$len = 2;
echo ord($str{$len});
?>