각그누보드로 통합게시판을...

각그누보드로 통합게시판을...

QA

각그누보드로 통합게시판을...

답변 1

본문

아는 분이 각 폴더마다 그누보드 설치해서 게시판글 끌어오게 만드는 통합게시판을 만들어줬는데요..

http://boardview.iposkorea.com/ 

 

이 주소인데 에러가 나요... 그 분이 퇴사하셔서 ㅠㅠ 제가 봐야하는데...

도와주세요...ㅠㅠㅠㅠ

 

 

index.php소스입니당...

 
<?
$search_category = $_GET['search_category'];
$search_text = $_GET['search_text'];
?>
<? include './function.php';?>
<? include './dbcon.php';?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<style >
body{margin:0px auto;}


.div_head{width:100%;height:68px;margin-bottom:18px;box-shadow:1px 1px 1px 1px #eaeaea;margin-top:4px;}
.div_head a{color:#3b3b3b;text-decoration:none;}
.img_logo{width:35px;}


.h2_title{font-family:'나눔고딕';font-weight:normal;margin-top:18px;font-weight:bold;}
.new{color:#ff8787;font-weight:bold;font-size:12px;}


.table_integrated {border-collapse: collapse;width:98%;}
.table_integrated tr:hover{background-color:#f7fdfe;}
.table_integrated td {border:1px solid #bdbdbd;color:#585858;font-size:15px;font-family:'나눔고딕';border-left:0px;border-right:0px;}
.table_integrated a{text-decoration:none;color:#585858;}
.table_integrated a:hover{text-decoration:underline;}
.tr_first {text-align:center;background-color: #fbfbfb;font-weight:bold;}
.tr_first:hover{background-color:#fbfbfb !important;}
.td_idx{padding-left:12px;width:40px;}
.a_go_detail{text-decoration:none;color:#585858;}


.a_pager {text-decoration:none;font-size:24px;color:#8c8c8c;display:inline-block;width:30px;}


.table_search select,input{font-family:'나눔고딕'}
.table_search select{height:25px;}
.table_search input{height:19px;}
.table_search input[type=submit],input[type=button] {height:25px;cursor:pointer;}
</style>
</head>
<body>
<?
$startRow = 0;
if($_GET['startRow'])
	$startRow = $_GET['startRow'];
$listInOne = 15;
$endRow = $listInOne;


$numRows = get_num_rows();
$qry_for_select_board = get_qry();
$res_for_select_board = mysql_query($qry_for_select_board." order by wr_datetime desc limit $startRow, $endRow");


echo "<center>";
echo "<div class='div_head'>
<table style='margin-top:-10px;' cellpadding='5'>
	<tr>
		<td><img class='img_logo' src='./img/logo_mini.gif'></td>
		<td ><h2 class='h2_title'><a href='http://boardview.iposkorea.com'>아이포스 게시판 통합 관리 (그누보드)</a></h2></td>
	</tr>
</table>
</div>";


echo "<table cellpadding='12' border=0 class='table_integrated'>";
echo "<tr class='tr_first'><td>번호</td><td>제목</td><td>작성자</td><td>업체</td><td>날짜</td><td>조회수</td></tr>";


$idx = $startRow;
while($arr_for_select_board = mysql_fetch_array($res_for_select_board))
{
	//테이블
	$strPos = strpos($arr_for_select_board[table_name],'write_')+6;
	$table = substr($arr_for_select_board[table_name],$strPos);


	//client_id는 테이블에 사용하는 g5_<client_id>write_board
	$client_id= str_replace('g5_','',$arr_for_select_board[table_name]);
	$client_id = str_replace('write_board','',$client_id);
	$client_id = str_replace('write_board2','',$client_id);
	$client_id = str_replace('write_qna','',$client_id);


	//Get URL
	$qry_for_url = "SELECT * FROM client_list where id='$client_id'";
	$res_for_url = mysql_query($qry_for_url);
	$arr_for_url = mysql_fetch_array($res_for_url);


	//번호카운팅
	$idx++;


	//새글(new)
	$new = "";
	$today = date('Y-m-d h:i:s');
	$wr_date = $arr_for_select_board[wr_datetime];
	$gap = _date_diff(strtotime($today),strtotime($wr_date));
	if($gap['days'] < 2)
		$new = "<font class='new'>N</font>";


	$wr_subect = $arr_for_select_board[wr_subject];
	$stx ="";
	if($search_category == 'subject'){
		$wr_subect = str_replace( $search_text, "<font color='#4483ff'><b>$search_text</b></font>", $wr_subect);
		//$search_text = urlencode($search_text);
		//$stx = "&sfl=wr_subject&stx=$search_text&sop=and";
	}
	else if($search_category == 'content'){
		$stx = "&sfl=wr_content&stx=$search_text&sop=and";
	}
	echo "<tr>";
	echo "<td align='left' class='td_idx'>$idx</td>
	<td>
		<a class='a_go_detail' target='_blank'
			href='{$arr_for_url[url]}/bbs/board.php?bo_table=board&wr_id={$arr_for_select_board[wr_id]}'>
			$wr_subect
		</a>
		$new
	</td>
	<td align='center'>{$arr_for_select_board[wr_name]}</td>
	<td align='center'><a target='_blank' href='{$arr_for_url[url]}'>$client_id</a></td>
	<td align='center'>{$arr_for_select_board[wr_datetime]}</td>
	<td align='center'>{$arr_for_select_board[wr_hit]}</td>";
	echo "</tr>";


	$qry_for_get_reply = "SELECT * FROM $arr_for_select_board[table_name] WHERE wr_num='$arr_for_select_board[wr_num]' AND wr_reply in ('A') order by wr_datetime";
	$res_for_get_reply = mysql_query($qry_for_get_reply);
	$rows_for_get_reply = mysql_num_rows($res_for_get_reply);
	//echo $qry_for_get_reply."; ";
	$idx_reply = 0;
	if($rows_for_get_reply > 0)
	{
		while($arr_for_get_reply = mysql_fetch_array($res_for_get_reply))
		{
			$wr_date = $arr_for_get_reply[wr_datetime];
			$gap = _date_diff(strtotime($today),strtotime($wr_date));
			if($gap['days'] < 2)
				$new = "<font class='new'>N</font>";


			$idx_reply++;
			echo "<tr>";
			echo "<td align='left' class='td_idx'>{$idx}_{$idx_reply}</td>
			<td>
				  
				<img src='./img/icon_reply.gif'>
				<a class='a_go_detail' target='_blank'
					href='$arr_for_url[url]/bbs/board.php?bo_table=board&wr_id=$arr_for_get_reply[wr_id]'>$arr_for_get_reply[wr_subject]
				</a>$new
			</td>
			<td align='center'>$arr_for_get_reply[wr_name]</td>
			<td align='center'><a target='_blank' href='{$arr_for_url[url]}'>$client_id</a></td>
			<td align='center'>$arr_for_get_reply[wr_datetime]</td>
			<td align='center'>$arr_for_get_reply[wr_hit]</td>";
			echo "</tr>";
		}
	}
}
echo "</table>";
echo "</center>";
?>


<?php
//페이징
echo "<br>";
echo "<center>";
//전체자료개수(1page당 10개 rows, 1chpater는 4)
//$numRows = $numRows;//전체 리스트 갯수 가져오기(select all)
$chapterSize = 20;//▶ 이거로 넘어갈때 몇개씩 이냐(  < 1,2,3,4,5,6,7,8,9,10 > )
$beginPage = floor($startRow/($chapterSize*$listInOne));//(0/50),(10/50),(20/50),(30/50),(40/50) -> 0
$beginPage *= $chapterSize;
$endPage = ceil($numRows/$listInOne);
if(($endPage-$beginPage) > $chapterSize)
	$endPage = $beginPage+$chapterSize;
$nowPage = $startRow/$listInOne;
//이전 페이지가 있으면 (맨처음 <를 가지는 $beginPage의 값은 10(10~19까지의 tutor list)이기 때문에 맨처음 <를 가지는 값 이상(10포함)이면 <(전페이지)를 갖는다
if($beginPage >= $chapterSize)
{?><a class='a_pager' href="http://boardview.iposkorea.com/index.php?startRow=<?=($beginPage-$chapterSize)*$listInOne?>"><</a><?php }
//출력 (숫자)
for($i=$beginPage;$i<$endPage;$i++)
{
	if($i == $nowPage){
		?><a class='a_pager' href="http://boardview.iposkorea.com/index.php?startRow=<?=($i*$listInOne)?>&search_category=<?php echo $search_category;?>&search_text=<?php echo $search_text;?>" style="color:#FF6C6C;font-weight:bold;"><?=$i+1?></a> <?php }
	else {
		?><a class='a_pager' href="http://boardview.iposkorea.com/index.php?startRow=<?=($i*$listInOne)?>&search_category=<?php echo $search_category;?>&search_text=<?php echo $search_text;?>"><?=$i+1?></a> <?php }
}
//다음 행이 있는지 확인하고 있으면 다음 챕터로 이동할 수 있게
$nextStartRow = $i*$listInOne;
if($nextStartRow < $numRows)
{?><a class='a_pager' href="http://boardview.iposkorea.com/index.php?startRow=<?=($nextStartRow)?>">></a><?php }
echo "</center>";
echo "<br>";
?>


<center>
<script type="text/javascript">
function ckFrm(frm)
{
	var search_text = frm.search_text.value;
	if(search_text.length < 1){
		alert("검색어를 입력하세요!");
		frm.search_text.focus();
		return false;
	}
	return true;
}
function go_new()
{
	location.href='http://boardview.iposkorea.com/index.php?startRow=0&latest=y';
}
</script>
<form class="" action="./index.php" method="get" onsubmit="return ckFrm(this)">
<table class='table_search'>
<tr>
	<td>
		<select class="select_search" name="search_category">
		<option value='subject'>제목</option>
		<option value='content'>내용</option>
		</select>
	</td>
	<td>
		<input type="text" size='30' name="search_text" placeholder="검색어를 입력하세요.">
	</td>
	<td>
		<input type='submit' value='검색'>
	</td>
</tr>
</table>
</form>
</center>
</body>
 
</html>
 


index.php소스입니당...

[code] 

<?

// 날짜 차이 구하기

function dateDiff($sStartDate, $sEndDate) {

$sStartTime = strtotime($sStartDate);

$sEndTime = strtotime($sEndDate);


if($sStartTime > $sEndTime)

return false;


$sDiffTime = $sEndTime - $sStartTime;


$aReturnValue['d'] = floor($sDiffTime/60/60/24);

$aReturnValue['H'] = sprintf("%02d", ($sDiffTime/60/60)%24);

$aReturnValue['i'] = sprintf("%02d", ($sDiffTime/60)%60);

$aReturnValue['s'] = sprintf("%02d", ($sDiffTime%60));


return $aReturnValue;

}


function _date_range_limit($start, $end, $adj, $a, $b, $result)

{

    if ($result[$a] < $start) {

        $result[$b] -= intval(($start - $result[$a] - 1) / $adj) + 1;

        $result[$a] += $adj * intval(($start - $result[$a] - 1) / $adj + 1);

    }


    if ($result[$a] >= $end) {

        $result[$b] += intval($result[$a] / $adj);

        $result[$a] -= $adj * intval($result[$a] / $adj);

    }


    return $result;

}


function _date_range_limit_days($base, $result)

{

    $days_in_month_leap = array(31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

    $days_in_month = array(31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);


    _date_range_limit(1, 13, 12, "m", "y", &$base);


    $year = $base["y"];

    $month = $base["m"];


    if (!$result["invert"]) {

        while ($result["d"] < 0

이 질문에 댓글 쓰기 :

답변 1

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hosting_users/hsquarec/www/board_manage/function.php on line 129 


접속하면 위와 같이 오류가 나오네요.


이부분 부터 확인하세요.

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 18
© SIRSOFT
현재 페이지 제일 처음으로