헐랭이님 최신글에 페이징이 안나와요... -.-a 정보
헐랭이님 최신글에 페이징이 안나와요... -.-a본문
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
include_once("$g4[path]/lib/latest.lib.php");
my_new.php 앞부분에 위의 두개만 include 해주면 되는거 아니었나요??? get_paging이 안나오네요.
댓글 전체
my_new.php 에있는 소스전체를 긁어서 원하는 위치에 넣어주거나
이파일을 출력 시키고자 하는 위치에 인클루드 하면 됩니다.
이파일을 출력 시키고자 하는 위치에 인클루드 하면 됩니다.
my_new.php를 인클루드 했는데... 페이징만 안나오네요... -..-a
그래서 lib이 빠졌나 하구 lib 2개를 my_new.php에 인클루드 했는데... 역시 안나와요.
페이징 정보가 없어서 인거 같은데... -..- php는 넘 어려워요
그래서 lib이 빠졌나 하구 lib 2개를 my_new.php에 인클루드 했는데... 역시 안나와요.
페이징 정보가 없어서 인거 같은데... -..- php는 넘 어려워요
혹시.....현재 로그인한 회원의 최신글에 출력될 총갯수 리스트가
한페이지에 출력될 갯수이하 인지 확인해 보세요.
//환경설정하세요. by 헐랭이
$new_count = 5; //한번에 보여줄 갯수
$page_count = 5; //페이지출력수
한페이지에 출력될 갯수이하 인지 확인해 보세요.
//환경설정하세요. by 헐랭이
$new_count = 5; //한번에 보여줄 갯수
$page_count = 5; //페이지출력수
아래의 소스를 123test.php 라는 이름으로 만든후
G4 안으로 업로드한후 테스트 해보세요.
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "나의최근글";
include_once("./_head.php");
?>
<table width="95%" cellspacing="0" cellpadding="0">
<tr>
<td width="7" height="7"><img src="<?=$g4[path]?>/img/line_mid_p1.gif"></td>
<td background="<?=$g4[path]?>/img/line_mid_p5.gif"></td>
<td width="7"><img src="<?=$g4[path]?>/img/line_mid_p2.gif"></td>
</tr>
<tr>
<td background="<?=$g4[path]?>/img/line_mid_p8.gif"></td>
<td>
<?
// 나의 최근게시물
if ($member[mb_id])
{
//환경설정하세요. by 헐랭이
$new_count = 5; //한번에 보여줄 갯수
$page_count = 5; //페이지출력수
$sql2 = " select count(*) as cnt from $g4[board_new_table]
where wr_id = wr_parent and mb_id = '$member[mb_id]' ";
$row2 = sql_fetch($sql2);
$total_count = number_format($row2[cnt]);
$rows = $page_count;
$total_page = ceil($total_count / $rows);
if (!$page) { $page = 1; }
$from_record = ($page - 1) * $rows;
$sql = " select bo_table, wr_id, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
-- and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc limit $from_record, $new_count ";
$res = sql_query($sql);
echo "<table width=95% cellpadding=0 cellspacing=0 align=center>";
echo "<tr height=25><td><img src='$g4[path]/img/list_icon.gif'> <a href='$g4[bbs_path]/new.php?view=w&mb_id=$member[mb_id]'><span style='color:#333333;'><b>나의 최근게시물 ({$total_count}) </b></span></a></td></tr><tr><td height=1 bgcolor=#FF9900></td></tr>";
$list = array();
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$list[$i] = $row2;
$subj = get_text($list[$i][wr_subject]);
$comment = "";
if ($list[$i][wr_comment])
$comment = "<span class=small>({$list[$i][wr_comment]})</span>";
echo "<tr height=23><td class=bg_menu2 title='$subj'>";
echo "<nobr style='display:block;overflow:hidden;width:160px;'>";
echo "<img src='$g4[path]/img/list_icon2.gif'> <a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
echo "<span style='color:#666666;'>$comment $subj</span></a>";
echo "</nobr></td></tr>";
// $cnt++;
}
if (!$total_count) {
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
}else{
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
echo "</table>\n";
}
?>
</td>
<td background="<?=$g4[path]?>/img/line_mid_p6.gif"></td>
</tr>
<tr>
<td height="7"><img src="<?=$g4[path]?>/img/line_mid_p4.gif"></td>
<td background="<?=$g4[path]?>/img/line_mid_p7.gif"></td>
<td><img src="<?=$g4[path]?>/img/line_mid_p3.gif"></td>
</tr>
</table>
<?
include_once("./_tail.php");
?>
G4 안으로 업로드한후 테스트 해보세요.
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "나의최근글";
include_once("./_head.php");
?>
<table width="95%" cellspacing="0" cellpadding="0">
<tr>
<td width="7" height="7"><img src="<?=$g4[path]?>/img/line_mid_p1.gif"></td>
<td background="<?=$g4[path]?>/img/line_mid_p5.gif"></td>
<td width="7"><img src="<?=$g4[path]?>/img/line_mid_p2.gif"></td>
</tr>
<tr>
<td background="<?=$g4[path]?>/img/line_mid_p8.gif"></td>
<td>
<?
// 나의 최근게시물
if ($member[mb_id])
{
//환경설정하세요. by 헐랭이
$new_count = 5; //한번에 보여줄 갯수
$page_count = 5; //페이지출력수
$sql2 = " select count(*) as cnt from $g4[board_new_table]
where wr_id = wr_parent and mb_id = '$member[mb_id]' ";
$row2 = sql_fetch($sql2);
$total_count = number_format($row2[cnt]);
$rows = $page_count;
$total_page = ceil($total_count / $rows);
if (!$page) { $page = 1; }
$from_record = ($page - 1) * $rows;
$sql = " select bo_table, wr_id, wr_parent from $g4[board_new_table] a
where mb_id = '$member[mb_id]'
-- and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc limit $from_record, $new_count ";
$res = sql_query($sql);
echo "<table width=95% cellpadding=0 cellspacing=0 align=center>";
echo "<tr height=25><td><img src='$g4[path]/img/list_icon.gif'> <a href='$g4[bbs_path]/new.php?view=w&mb_id=$member[mb_id]'><span style='color:#333333;'><b>나의 최근게시물 ({$total_count}) </b></span></a></td></tr><tr><td height=1 bgcolor=#FF9900></td></tr>";
$list = array();
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$list[$i] = $row2;
$subj = get_text($list[$i][wr_subject]);
$comment = "";
if ($list[$i][wr_comment])
$comment = "<span class=small>({$list[$i][wr_comment]})</span>";
echo "<tr height=23><td class=bg_menu2 title='$subj'>";
echo "<nobr style='display:block;overflow:hidden;width:160px;'>";
echo "<img src='$g4[path]/img/list_icon2.gif'> <a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
echo "<span style='color:#666666;'>$comment $subj</span></a>";
echo "</nobr></td></tr>";
// $cnt++;
}
if (!$total_count) {
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
}else{
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
echo "</table>\n";
}
?>
</td>
<td background="<?=$g4[path]?>/img/line_mid_p6.gif"></td>
</tr>
<tr>
<td height="7"><img src="<?=$g4[path]?>/img/line_mid_p4.gif"></td>
<td background="<?=$g4[path]?>/img/line_mid_p7.gif"></td>
<td><img src="<?=$g4[path]?>/img/line_mid_p3.gif"></td>
</tr>
</table>
<?
include_once("./_tail.php");
?>
헉...잘되네요... 그런데 오해를 한 이유가 있어요.
운영자 아뒤에서만 안됩니다.
내가 쓴 글이 1,077개에요...
운영자 아뒤에서만 안됩니다.
내가 쓴 글이 1,077개에요...
운영자가 몇만개를 작성했더라도 전부다 가져오지는 않습니다.
소스에서 나오다시피 $g4[board_new_table] 에 기록된 리스트만
전부 가져 옵니다.^^
그러므로 환경설정에서 지정한 최근글 삭제일이 지난글은 가져오지 못합니다.
소스에서 나오다시피 $g4[board_new_table] 에 기록된 리스트만
전부 가져 옵니다.^^
그러므로 환경설정에서 지정한 최근글 삭제일이 지난글은 가져오지 못합니다.
나의 최근게시물 (1,077) ... 그런데 목록은 없어요.
if (!$total_count) {
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
}else{
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
이부분이 동작하지 않는 듯...
if (!$total_count) {
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
}else{
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
이부분이 동작하지 않는 듯...
헉~~ 쪽지 확인해 주세요.
알려주신 정보로 로그인이 안됩니다.
알려주신 정보로 로그인이 안됩니다.
이상한 현상이군요.
if (!$total_count) {
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
}else{
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
위 코드를
아래처럼 해보실래요.
if ($total_count) {
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
if (!$total_count) {
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
}else{
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
위 코드를
아래처럼 해보실래요.
if ($total_count) {
echo "<tr><td><span style='color:gray;'>";
$page = get_paging($page_count, $page, $total_page, "?page=");
echo "$page";
echo "</span></td></tr>";
}
-.- 그래도 안되요... 이거 get_paging이 버그인가요??
헐랭이님이 봐주셨는데도... 오류가 좀 이상해서... 해결이 안되었슴다... -.-
위의 헐랭이님 소스 긁어서 일반페이지로도 띄워보고 인클루드로 좌측에 붙여도 이상이 없이 잘 나오는데요...
페이징 부분도 문제 없이요....
헉~! 죄송합니다....좌측에 인클루드후 게시판을 가니 에러가....ㅠ.ㅠ
페이징 부분도 문제 없이요....
헉~! 죄송합니다....좌측에 인클루드후 게시판을 가니 에러가....ㅠ.ㅠ
헐랭이님도 확인하셨는데요... test 사용자에서는 잘 되요.
그런데... 운영자(게시판관리자) 아뒤에서는 페이징이 안되는 문제가 생긴다는 것이죠. -..-a
get_paging에서 return 되는 값이 문제인거 같아요... 왜 그런지는 모르겠지만...
그런데... 운영자(게시판관리자) 아뒤에서는 페이징이 안되는 문제가 생긴다는 것이죠. -..-a
get_paging에서 return 되는 값이 문제인거 같아요... 왜 그런지는 모르겠지만...