if($_list_check_included) return;
$_list_check_included = true;
/*********************************************************************************************
* 넘겨지는 데이타에 대한 일괄 정리
********************************************************************************************/
function list_check(&$data,$view_check=0) {
global $keyword, $sn, $ss, $sc, $setup, $member, $href, $id, $dir, $category_data, $is_admin, $_zbResizeCheck,
$name,$email,$subject, $sort, $prev_no, $no,$homepage, $memo, $hit, $vote, $ip, $comment_num, $sitelink1, $sitelink2,
$file_name1, $file_name2, $file_download1, $file_download2, $file_size1, $file_size2,
$upload_image1, $upload_image2, $category_name, $date, $reg_date, $insert, $icon, $face_image,$number,$loop_number,
$a_file_link1, $a_file_link2, $a_reply, $a_delete, $a_modify, $zbLayer, $_zbCheckNum,
$_listCheckTime;
$_listCheckTimeStart = getmicrotime();
if($view_check) $setup[only_board]=0;
// 제목에 5줄로 툴바 만듬
if($setup[use_status]) {
$tmpData = explode("\n",stripslashes($data[memo]));
$totalCommentLineNum = count($tmpData);
if($totalCommentLineNum>10) {
$showCommentStr_tail.="\n".($totalCommentLineNum - 10)." lines more... (total : $totalCommentLineNum lines)";
$tmpData_Count = 10;
} else $tmpData_Count = $totalCommentLineNum;
$showCommentStr = "";
for($i=0;$i<$tmpData_Count;$i++) {
$tmpStr = trim($tmpData[$i]);
if($tmpStr) $showCommentStr .= $tmpStr."\n";
}
$showCommentStr = str_replace("'","",$showCommentStr);
$showCommentStr = str_replace("\"","",$showCommentStr);
$showCommentStr .= $showCommentStr_tail;
}
$_zbCount = check_zbLayer($data);
// HTML 사용일 경우 현재 회원의 html 권한이 없거나 관리자가 아니라면 style 속성을 제거
if($data[use_html]&&$data[islevel]>$setup[grant_html]) {
$style_pattern = "/(\<.*?)style=(.*?)(\>?)/i";
$data[memo]=preg_replace($style_pattern,"\\1\\3",$data[memo]);
}
// ' 등의 특수문자때문에 붙인 \(역슬래쉬)를 떼어낸다
$name=$data[name]=stripslashes($data[name]);
$temp_name = get_private_icon($data[ismember], "2");
if($temp_name) $name="";
$subject=$data[subject]=stripslashes($data[subject]); // 제목
$subject=cut_str($subject,$setup[cut_length]); // 제목 자르는 부분
// 검색어에 해당하는 글자를 빨간;; 색으로 바꾸어줌;;
if($keyword) {
$keyword_pattern = "/".str_replace("\0","\\0",preg_quote($keyword,"/"))."/i";
if($sn=="on") $name = preg_replace($keyword_pattern, "$keyword", $name);
if($ss=="on") $subject = preg_replace($keyword_pattern, "$keyword", $subject);
}
$hit=$data[hit]; // 조회수
$vote=$data[vote]; // 투표수
$comment_num="[".$data[total_comment]."]"; // 간단한 답글 수
if($data[total_comment]==0) $comment_num="";
if($setup[use_alllist]) $view_file="zboard.php"; else $view_file="view.php";
// 제목에 링크 거는 부분;
if($member[level]<=$setup[grant_view]||$is_admin) {
//if($setup[use_status]&&!$data[is_secret]) $addShowComment = " onMouseOver=\"showComment('$showCommentStr',true)\" onMouseOut=\"showComment('',false)\" ";
if($setup[use_status]&&!$data[is_secret]) $addShowComment = " title=\"$showCommentStr\" ";
$subject="".$subject."";
}
if(!$setup[only_board]) {
$homepage=$data[homepage]=stripslashes($data[homepage]);
if($homepage) $homepage="$homepage";
// 이미지 박스 사용을 위해서 정규표현식 사용
if($data[ismember]) {
$imageBoxPattern = "/\[img\:(.+?)\.(jpg|gif)\,align\=([a-z]){0,}\,width\=([0-9]+)\,height\=([0-9]+)\,vspace\=([0-9]+)\,hspace\=([0-9]+)\,border\=([0-9]+)\]/i";
$data[memo]=preg_replace($imageBoxPattern,"
", stripslashes($data[memo]));
} else {
$data[memo]=stripslashes($data[memo]);
}
if($data[use_html]<2) $memo=$data[memo]=nl2br($data[memo]);
$memo=$data[memo];
// 자동링크 거는 부분;;
if($setup[use_autolink]) $memo=autolink($memo);
$memo .= "";
// 검색어가 있을경우 내용의 키워드를 변경
if($sc=="on" && $keyword) {
$keyword_pattern = "/".str_replace("\0","\\0",preg_quote($keyword,"/"))."/i";
$memo = preg_replace($keyword_pattern, "$keyword", $memo);
}
// 이미지 리사이즈를 위해서 처리하는 부분
$memo = preg_replace("/(\
?)/i","\\1 name=zb_target_resize style=\"cursor:hand\" onclick=window.open(this.src) \\2 \\3", $memo);
$memo = "
".$memo." |