항

게시판 리스트에 관한 질문입니다.

· 2012-09-24 (월) 16:56:47 · 1643 · 5
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :


비공개 게시판을 사용하는데요.....


저희 클라이언트가 굳이.....


본인이 글쓰기 한 내용만 리스트에 보이도록 하고 싶다네요.ㅠ.ㅠ


관리자일 경우엔 모두 출력하구요...


list.skin.php를 보긴 보는데....


어떻게 고쳐야 할지.....괜히 고쳤다가 다른 게시판까지 먹통될까봐 겁이 나네요...


고수님들...저좀 도와주세요....ㅠ.ㅠ
|

댓글 5개

2012-09-25 (화) 15:42:19
팁자료실에 있는 걸 제가 놓쳤네요....알려주셔서 감사해요...
적용해 보도록 하겠습니다.

감사합니당~~^^
//##########################################################################################
if(!$is_admin) { // 관리자가 아닐경우 자기가 작성한 글만 보이도록 한다.

// 분류 선택 또는 검색어가 있다면
if ($sca || $stx)
{
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);

// 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
$sql = " select MIN(wr_num) as min_wr_num from $write_table ";
$row = sql_fetch($sql);
$min_spt = $row[min_wr_num];

if (!$spt) $spt = $min_spt;

//$sql_search .= " and (wr_num between '".$spt."' and '".($spt + $config[cf_search_part])."') ";
$sql_search .= " and mb_id = '$member[mb_id]' and wr_is_comment = 0 and (wr_num between '".$spt."' and '".($spt + $config[cf_search_part])."') ";

// 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
$sql = " select distinct wr_parent from $write_table where $sql_search ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
}
else
{
$sql_search = "";

// 게시판의 글 수
//$sql = " select count(*) as cnt from $g4[write_prefix]$bo_table where wr_is_comment = 0 ";
$sql = " select count(*) as cnt from $g4[write_prefix]$bo_table where mb_id = '$member[mb_id]' and wr_is_comment = 0 ";
$row = sql_fetch($sql);
$total_count = $row[cnt];

//$total_count = $board[bo_count_write];
}

$total_page = ceil($total_count / $board[bo_page_rows]); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $board[bo_page_rows]; // 시작 열을 구함

if ($board[bo_gallery_cols])
$td_width = (int)(100 / $board[bo_gallery_cols]);

// 정렬
if (!$sst)
{
$sst = "wr_num, wr_reply";
$sod = "";
}
$sql_order = " order by $sst $sod ";

if ($sca || $stx)
{
$sql = " select distinct wr_parent from $write_table where $sql_search $sql_order limit $from_record, $board[bo_page_rows] ";
}
else
{
//$sql = " select * from $write_table where wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
$sql = " select * from $write_table where mb_id = '$member[mb_id]' and wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
}
$result = sql_query($sql);

$list = array();
$i = 0;

if (!$sca && !$stx)
{
$arr_notice = split("\n", trim($board[bo_notice]));
for ($k=0; $k<count($arr_notice); $k++)
{
$row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' ");
if (!$row[wr_id])
continue;

$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
$list[$i][is_notice] = true;

$i++;
}
}

$k = 0;

while ($row = sql_fetch_array($result))
{
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from $write_table where wr_id = '$row[wr_parent]' ");

$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
if (strstr($sfl, "subject"))
$list[$i][subject] = search_font($stx, $list[$i][subject]);
$list[$i][is_notice] = false;
$list[$i][num] = number_format($total_count - ($page - 1) * $board[bo_page_rows] - $k);

$i++;
$k++;
}

$write_pages = get_paging($config[cf_write_pages], $page, $total_page, "./board.php?bo_table=$bo_table".$qstr."&page=");

} // if(!$is_admin) // 관리자가 아닐경우 자기가 작성한 글만 보이도록 한다.
//##########################################################################################
2012-09-25 (화) 16:01:58
감사합니다.^^
게시판 구분하는 부분이 없어서 첫 줄에 if문 달고....
나머지는 hero412님이 주신 코드 사용하니 잘 돌아가네요...
감사합니다.^^
list.skin.php 맨 상단에 부쳐넣기 해보세요. 윗쪽 댓글
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12-09-24 조회 1,073
12-09-24 조회 1,768
12-09-24 조회 3,300
12-09-24 조회 1,029
12-09-24 조회 825
12-09-24 조회 1,896
12-09-24 조회 1,644
12-09-24 조회 882
12-09-24 조회 684
12-09-24 조회 1,112
12-09-24 조회 1,558
12-09-24 조회 925
12-09-24 조회 1,637
12-09-24 조회 1,191
12-09-24 조회 1,623
12-09-24 조회 1,204
12-09-24 조회 907
12-09-24 조회 2,425
12-09-24 조회 1,192
12-09-24 조회 1,775