"; exit; } else { Misc::jvAlert('실패!','history.go(-1)'); } } if(!$_REQUEST['board_mode']) { $board_mode = "list"; } if($board_mode == "list") { if(!$_GET['start']) { $start = 0; } else { $start = $_GET['start']; } $board_scale = 20; $board_page = 10; /** * 한페이지당 글수 */ $scale=$board_scale; /* * 한페이지당 페이지수 */ $page_scale=$board_page; } else if($_GET['board_mode'] == "view") { $no = $_GET['no']; $board_qry1 = "update $tableName set count=count+1 where seq_no='$no'"; $board_rst1 = mysqli_query($dbConn,$board_qry1); $board_qry2 = "select * from $tableName where seq_no='$no'"; $board_rst2 = mysqli_query($dbConn,$board_qry2); $board_row2 = mysqli_fetch_assoc($board_rst2); //$t_date = date("Y-m-d",$row[wdate]); $today = explode(" ",$board_row2[wdate]); // 자동링크걸기 function auto_link($text) { $text = str_replace(";", "", $text); #******* www $text = eregi_replace("([^/])www([0-9a-zA-Z./@~?&=_-]+)","\\1http://www\\2", $text); #******* http $text = eregi_replace("http://([0-9a-zA-Z./@~?&=_-]+)", "http://\\1", $text); #******* ftp $text = eregi_replace("ftp://([0-9a-zA-Z./@~?&=_-]+)", "ftp://\\1", $text); #******* email $text = eregi_replace("([_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*)@([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)", "\\1@\\3", $text); return $text; } /* if($board_row2[html_check] == "1") { $board_row2[content] = stripslashes($board_row2[content]); $content = nl2br(htmlspecialchars($board_row2[content])); // HTML사용안할 경우 맞춤법에 맞지 않는 단어가 깨져 보이는 현상 제거 (BAWOO_30313) $content = eregi_replace("&#","&#",$content); $content = auto_link($content); } else { $content = stripslashes($board_row2[content]); //$content = $board_row2[content]; } */ $content = stripslashes($board_row2[content]); if($board_config[noname_level] == "2") { $writer_name = "******"; } else { if($board_row2[email]) { $email = "( $board_row2[email] )"; } $writer_name = "$board_row2[userid] $email"; } $title = Misc::cutLongString($board_row2[title], 48, $dot=true); if(!$board_row2[userfile1]) { $down_file1 = "첨부파일 없음"; } else { $down_file1 = "$board_row2[userfile1]"; } if(!$board_row2[userfile2]) { $down_file2 = "첨부파일 없음"; } else { $down_file2 = "$board_row2[userfile2]"; } $draw_file1 = Misc::getFileExtension($board_row2[userfile1]); if($draw_file1 == "gif" || $draw_file1 == "jpg" || $draw_file1 == "png" || $draw_file1 == "GIF" || $draw_file1 == "JPG" || $draw_file1 == "PNG" || $draw_file1 == "jpeg"){ $img_size = @getimagesize("./board_upload/$board_row2[userfile1]"); $board_photo_size = 500; // 가로이미지가 기준값보다 작을경우 그대로 출력 if($board_photo_size>$img_size[0]) { $board_photo_size = "width=$img_size[0]"; } else { $board_photo_size = "width=500"; } $draw1 = "

"; } $draw_file2 = Misc::getFileExtension($board_row2[userfile2]); if($draw_file2 == "gif" || $draw_file2 == "jpg" || $draw_file2 == "png" || $draw_file2 == "GIF" || $draw_file2 == "JPG" || $draw_file2 == "PNG" || $draw_file1 == "jpeg"){ $img_size2 = @getimagesize("../board_upload/$board_row2[userfile2]"); $board_photo_size2 = 500; // 가로이미지가 기준값보다 작을경우 그대로 출력 if($board_photo_size2>$img_size2[0]) { $board_photo_size2 = $img_size2[0]; } else { $board_photo_size2 = 500; } $draw2 = "

"; } } else if($_GET['board_mode'] == "modify") { if(empty($_SESSION['isd_userid'])){ echo "Permission Error!"; exit; } $no = $_GET['no']; $board_qry2 = "select * from $tableName where seq_no='$no'"; $board_rst2 = mysqli_query($dbConn,$board_qry2); $board_row2 = mysqli_fetch_assoc($board_rst2); if($board_config[noname_level] == "2") { $writer_name = "******"; } else { $writer_name = "$board_row2[name]"; } } else if($_POST['board_mode'] == "modify_write") { if(empty($_SESSION['isd_userid'])){ echo "Permission Error!"; exit; } $no = $_POST['no']; $password = $_POST['password']; $qry5 = "select * from $tableName where seq_no='$no'"; $rst5 = mysqli_query($dbConn,$qry5); $row5 = mysqli_fetch_array($rst5); if($_POST['photo_del1'] != "1") { if(empty($_FILES['userfile1']['name'])) { $attc1_name[savedName] = $row5[userfile1]; } else { $tmpName1 = $_FILES['userfile1']['tmp_name']; if(is_uploaded_file($tmpName1)){ $pds_file1 = $_FILES['userfile1']['name']; $board_pds_pos = "./board_upload"; $attc1_name = Misc::uploadFileUnsafely($tmpName1 , $pds_file1 , $board_pds_pos); } } } else { @unlink("./board_upload/$row5[userfile1]"); $attc1_name[savedName] = ""; } if($_POST['photo_del2'] != "1") { if(empty($_FILES['userfile2']['name'])) { $attc2_name[savedName] = $row5[userfile2]; } else { $tmpName2 = $_FILES['userfile2']['tmp_name']; if(is_uploaded_file($tmpName2)){ $pds_file2 = $_FILES['userfile2']['name']; $board_pds_pos = "./board_upload"; $attc2_name = Misc::uploadFileUnsafely($tmpName2 , $pds_file2 , $board_pds_pos); } } } else { @unlink("./board_upload/$row5[userfile2]"); $attc2_name[savedName] = ""; } $content = addslashes($_POST['content']); $title = addslashes($_POST['title']); $name = addslashes($_POST['name']); $qry2 = "update $tableName set title='$title', content='$content', name='$name', userfile1 = '$attc1_name[savedName]', userfile2 = '$attc2_name[savedName]' where seq_no = '$no'"; $rst2 = mysqli_query($dbConn,$qry2); if($rst2) { $table_id = $_POST['table_id']; echo ""; exit; } else { Misc::jvAlert('실패!','history.go(-1)'); } } else if($_POST['board_mode'] == "cmt_save") { if(empty($_SESSION['isd_userid'])){ echo "Permission Error!"; exit; } $table_id = $_POST['table_id']; $no = $_POST['no']; $comment = addslashes($_POST['comment']); $qry1 = "insert into chan_shop_boardcomment values ('','NY','$table_id','$no','$comment',now(),'$userInfo[userid]','$userInfo[userName]')"; $rst1 = mysqli_query($dbConn,$qry1); if($rst1) { // 최종수정일 다시 입력 $update_date = time(); $u_qry1 = "update chan_shop_board set update_date = '$update_date' where seq_no = '$no'"; $u_rst1 = mysqli_query($dbConn,$u_qry1); if($table_id == "shopping") { echo ""; } else if($table_id == "1and1") { echo ""; } else { echo ""; } exit; } else { Misc::jvAlert('실패!','history.go(-1)'); } } else if($_GET['board_mode'] == "cmt_del") { $seqNo = $_GET['seqNo']; $no = $_GET['no']; $table_id = $_GET['table_id']; $qry1 = "delete from chan_shop_boardcomment where seq_no = '$seqNo'"; $rst1 = mysqli_query($dbConn,$qry1); if($rst1) { if($table_id == "shopping") { echo ""; } else if($table_id == "1and1") { echo ""; } else { echo ""; } exit; } else { Misc::jvAlert('실패!','history.go(-1)'); } } else if($_POST['board_mode'] == "write") { if(empty($_SESSION['isd_userid'])){ echo "Permission Error!"; exit; } $table_id = $_POST['table_id']; // 쓰기처리 $str_query=mysqli_query($dbConn,"select max(seq_no) as seqNo,min(fid) as fid from $tableName"); if(!str_query) { Misc::jvAlert('고유값이 없습니다.','history.go(-1)'); } $row = mysqli_fetch_assoc($str_query); if($row['seqNo']){ $new_seq_no = $row['seqNo'] + 1; } else { $new_seq_no = 1; } if($row['fid']){ $new_fid = --$row['fid']; } else { $new_fid = -1; } $tmpName1 = $_FILES['userfile1']['tmp_name']; if(is_uploaded_file($tmpName1)){ $pds_file1 = $_FILES['userfile1']['name']; $board_pds_pos = "./board_upload"; $attc_name1 = Misc::uploadFileUnsafely($tmpName1 , $pds_file1 , $board_pds_pos); } $tmpName2 = $_FILES['userfile2']['tmp_name']; if(is_uploaded_file($tmpName2)){ $pds_file2 = $_FILES['userfile2']['name']; $board_pds_pos = "./board_upload"; $attc_name2 = Misc::uploadFileUnsafely($tmpName2 , $pds_file2 , $board_pds_pos); } // query insert $ip = $_SERVER['REMOTE_ADDR']; $wdate = time(); $user_id = $_SESSION['member_id']; $user_name = $_POST['name']; $phone1 = $_POST['phone1']; $phone2 = $_POST['phone2']; $phone3 = $_POST['phone3']; $phone = $phone1."-".$phone2."-".$phone3; $email = $_POST['email']; $title = addslashes($_POST['title']); $content = addslashes($_POST['content']); $update_date = time(); $query = "insert into $tableName ( fid, thread, division, tablename, category, main_category, userid, name, email, title, content, userfile1, userfile2, html_check, passwd, count, ip, vote, reply_mail, wdate, status ) values ( '$new_fid', 'A', '".$_POST['division']."', '$table_id', '".$_POST['category']."', '".$_POST['main_category']."', '$user_id', '$user_name', '$email', '$title', '$content', '$attc_name1[savedName]', '$attc_name2[savedName]', '$html_check', '$passwd', 0, '$ip', '$vote', '$reply_mail', now(), '$status')"; $result = mysqli_query($dbConn,$query); if($result) { echo ""; exit; } else { print_r($query); exit; Misc::jvAlert('Fail!','history.go(-1)'); } } else if($board_mode == "reply") { $str1_query = "select thread,right(thread,1) from $tableName where fid=$fid and length(thread) = length('$thread')+1 and locate('$thread',thread)=1 order by thread desc limit 1"; $result = mysqli_query($dbConn,$str1_query); $rows = mysqli_num_rows($result); if($rows) { $row = mysqli_fetch_assoc($result); $thread_head = substr($row[0],0,-1); $thread_foot = ++$row[1]; //print_r("1:".$thread_head."|".$thread_foot); //exit; $new_thread = $thread_head.$thread_foot; } else { $new_thread = $thread."A"; //print_r("2:".$new_thread); //exit; } // query insert $ip = $REMOTE_ADDR; $wdate = time(); $user_id = $_SESSION['member_id']; $user_name = $user_name; $tmpName1 = $_FILES['userfile1']['tmp_name']; if(is_uploaded_file($tmpName1)){ $pds_file1 = $_FILES['userfile1']['name']; $board_pds_pos = "./board_upload"; $attc_name1 = Misc::uploadFileUnsafely($tmpName1 , $pds_file1 , $board_pds_pos); } $tmpName2 = $_FILES['userfile2']['tmp_name']; if(is_uploaded_file($tmpName2)){ $pds_file2 = $_FILES['userfile2']['name']; $board_pds_pos = "./board_upload"; $attc_name2 = Misc::uploadFileUnsafely($tmpName2 , $pds_file2 , $board_pds_pos); } $query = "insert into $tableName ( seq_no, fid, thread, division, tablename, category, userid, name, email, title, content, userfile1, userfile2, html_check, passwd, count, ip, vote, reply_mail, wdate ) values ( '', '$fid', '$new_thread', '답변', '$table_id', '$category', '$user_id', '$user_name', '$email', '$title', '$content', '$attc_name1[savedName]', '$attc_name2[savedName]', '$html_check', '', 0, '$ip', '$vote', '$reply_mail', now())"; $result = mysqli_query($dbConn,$query); if($result) { echo ""; exit; } else { Misc::jvAlert('실패!','history.go(-1)'); } } /** * 게시판 내용뿌려주기 함수 */ function board_contentPrint($division = false){ global $dbConn,$start,$total,$scale,$page_scale,$result,$code,$tableName,$Mode,$how,$S_date,$S_content, $page_total,$table_id,$division,$directory,$flag,$userInfo; $que = "select * from $tableName where tablename = '$table_id' && category<>'1' $division_qry $userid_qry $user_qry order by seq_no desc limit $start,$scale"; //print_r($que); $page=floor($start/($scale*$page_scale)); $result=mysqli_query($dbConn,$que); $result_rows=mysqli_num_rows($result); $total=$result_rows; $last=floor($total/$scale); /** * 페이징을 위한 토탈을 구한다. */ $page_total_qry = mysqli_query($dbConn,"select count(*) as cnt from $tableName where tablename = '$table_id' && category<>'1' $user_qry $division_qry $userid_qry"); $page_total_row = mysqli_fetch_assoc($page_total_qry); $page_total = $page_total_row['cnt']; //echo "total".$page_total; $page_last = floor($page_total/$scale); /** * 총 페이지수 */ $total_page_num = ceil($page_total/$scale); $now_page_num = floor($start/$scale) + 1; if($start) { $n=$page_total-$start; } else { $n=$page_total; } /** * 공지사항 뿌려주기 */ $category_qry = "select * from $tableName where tablename = '$table_id' && category='1' order by seq_no desc"; $category_rst = mysqli_query($dbConn,$category_qry); while($category_row = mysqli_fetch_array($category_rst)) { $Notice_today = explode(" ",$category_row[wdate]); echo " $category_row[seq_no] 공지 $category_row[title] $new_icon $cm_number $Notice_today[0] $category_row[count] "; } if($page_total != "0") { for($i=$start; $i<$start+$scale; $i++) //$start 에서 scale 까지만 { if($i<$page_total) { //mysql_data_seek($result, $i); $row=mysqli_fetch_assoc($result); $today = explode(" ",$row[wdate]); $write_date = date("Y-M-d", strtotime($today)); $post_date = explode("-",$write_date); $img_url = _WEB_BASE_DIR; $yesterday1 = date("Y-m-d H:i:s",time()-86400); if($row[wdate] > $yesterday1) { $new_icon = ""; } else { $new_icon = " "; } // 코멘트 갯수세기 $cm_qry1 = "select count(*) as cnt from chan_shop_boardcomment where board_no = '$row[seq_no]'"; $cm_rst1 = mysqli_query($dbConn,$cm_qry1); $cm_row1 = mysqli_fetch_assoc($cm_rst1); $cm_num1 = $cm_row1['cnt']; if($cm_num1>0) { $cm_number = "+$cm_num1"; } else { $cm_number = ""; } // 레벨 $member_icon[level] $row[name] = Misc::cutLongString($row[name], 12, $dot=true); $table_content=" $n $row[title] $today[0] $row[name] $row[count] "; // table 뿌려주기 echo $table_content; } $n--; } } }//contentPrint function end function contentPrint_photo($division = false){ global $dbConn,$start,$total,$scale,$page_scale,$result,$code,$tableName,$Mode,$how,$S_date,$S_content, $page_total,$_GET,$board_config,$flag,$oN,$table_id; $scale = 120; $table_id = "deny_item"; if($division) { $division_qry = "&& division = '$division'"; } $que = "select * from $tableName where tablename = '$table_id' && category<>'1' $division_qry $user_qry order by fid asc,thread limit $start,$scale"; //print_r($que); $page=floor($start/($scale*$page_scale)); $result=mysqli_query($dbConn,$que); $result_rows=mysqli_num_rows($result); $total=$result_rows; $last=floor($total/$scale); $page_total_qry = mysqli_query($dbConn,"select count(*) as cnt from $tableName where tablename = '$table_id' && category<>'1' $user_qry $division_qry"); $page_total_row = mysqli_fetch_assoc($page_total_qry); $page_total = $page_total_row['cnt']; $page_last = floor($page_total/$scale); $total_page_num = ceil($page_total/$scale); $now_page_num = floor($start/$scale) + 1; $cols = 4; for($i=0; $i < $total;) { echo ""; for($j=0; $j < $cols; $j++,$i++) { $obj = mysqli_fetch_assoc($result); if($obj[seq_no]) { if($obj[userfile1]) { $img_size = @getimagesize("./board_upload/$obj[userfile1]"); $board_photo_size = 190; if($board_photo_size > $img_size[0]) { $board_photo_size = $img_size[0]; } if($img_size[0] > $img_size[1]) { $s_size = "width=$board_photo_size"; } else { $s_size = "height=190"; } $img = ""; } else { $img = ""; } //$obj[title] = Misc::cutLongString($obj[title], 24, $dot=true); $obj[title] = stripslashes($obj[title]); $link = "$img"; echo "
$obj[title]
"; } else { echo " "; } } echo " "; } }//contentPrint function end /** * 게시물 페이징 */ function board_pageNavigation(){ global $page_total,$page,$start,$scale,$page_scale,$board_id,$page_last,$Mode,$S_date,$S_content,$how,$table_id,$division,$choose_lang,$directory; $Parameter_value = "division=$division&table_id=$table_id&directory=$directory&Mode=$Mode&S_date=$S_date&how=$how&S_content=$S_content"; if($page_total>$scale) //검색 결과가 페이지당 출력수보다 크면 { if($start+1>$scale*$page_scale) { $pre_start=$page*$scale*$page_scale-$scale; echo "
  • "; echo "... "; } for($vj=0; $vj<$page_scale; $vj++) { $ln=($page * $page_scale+$vj)*$scale; $vk=$page*$page_scale+$vj+1; if($ln<$page_total) { if($ln!=$start) { echo "
  • $vk
  • "; } else { echo "
  • $vk
  • "; } } } if($page_total>(($page+1)*$scale*$page_scale)) { $n_start=($page+1)*$scale*$page_scale; $last_start=$page_last*$scale; echo " ... "; echo "
  • "; } } }// pageNavigation function end ?> L&P CPAs
    ADMIN SIGN UP


    Fatal error: Uncaught Error: Undefined constant "title" in /home/u138015700/domains/lnpcpas.com/public_html/board_view.php:20 Stack trace: #0 {main} thrown in /home/u138015700/domains/lnpcpas.com/public_html/board_view.php on line 20