최근게시물에 랜덤이미지 추출하는법 정보
최근게시물에 랜덤이미지 추출하는법본문
갤러리게시판에 있는 게시물을 랜덤으로
최근 게시물에 뿌리고 싶습니다.
latest.skin.php에 어디를 손봐야 하나요.
초보라 죄송합니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$arr_new_cols=3; //한 줄에 출력할 이미지 개수
$imgwidth = 300; //이미지 가로사이즈
$imgheigh = 200; //이미지 세로사이즈
$tablewidth = 1000; // 전체테이블사이즈
$top_title = 최강통합갤러리; // 상단제목 설정하세요
$data_path = $g4[path]."/data/file";
$thumb_path = $data_path."/thumb/"; //불당썸네일 경로
?>
<style type="text/css">
BODY,TD,SELECT,input,form,TEXTAREA,center,option,pre,blockquote,span {font-size:9pt; font-family:나눔고딕; color:#666666;line-height:140%;}
a {selector-dummy: expression(this.hideFocus=true);}
A:link {color:666666;text-decoration:none;}
A:visited {color:666666;text-decoration:none;}
A:active {color:666666;text-decoration:none;}
A:hover {color:30C0FF;text-decoration:none;}
.sml8 {font-size:8pt; font-family:돋움; color:#2080D0; letter-spacing:-1;line-height:140%;};
</style>
<script language="javascript" src="<?=$latest_skin_path?>/img/common.js"></script>
<script language="javascript" src="<?=$latest_skin_path?>/img/viewTitle.js" type="text/javascript"></script>
<table width="<?=$tablewidth?>" border=0 cellspacing=0 cellpadding=0 align=center>
<tr><td><img src=<?=$latest_skin_path?>/img/bul2.gif align=absmiddle>
<script type="text/javascript">showTitle("", "<?=$latest_skin_path?>/img/viewTitle2.swf", 550, 30, "<?=$top_title?>", "", "left", "0x343434");</script>
</td></td></tr>
<tr>
<td height=13 background=<?=$latest_skin_path?>/img/title_bg.gif></td>
</tr>
</table>
<br>
<table width="<?=$tablewidth?>" cellpadding=0 cellspacing=0 style="margin-top:7px;" align=center>
<tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($i >= 0)
$title = get_text($list[$i][subject]);
//한 줄에 $arr_new_cols 만큼 출력
if($i%$arr_new_cols == 0 && $i>0)
echo "</tr><tr>";
$content = cut_str(get_text($list[$i][wr_content]), 80);
$bo_table=$board_list[$i][bo_table];
$image = urlencode($list[$i][file][0][file]); //이미지파일명
$thumb = $data_path."/".$bo_table."/".$image;
echo <<<HEREDOC
<td align='center'>
<a href='{$list[$i][href]}' >
<img src='$thumb' border='0' title='$title' class="img" width='$imgwidth' height='$imgheigh'></a>
<div><span class=sml8><a href=$g4[path]/bbs/board.php?bo_table={$board_list[$i][bo_table]}>[{$board_list[$i][bo_subject]}]</a></span><br><a href='{$list[$i][href]}' >{$subject} {$title}</a> {$list[$i][icon_new]}</div><br>
</td>
HEREDOC;
}
/* end for */
?>
<? if (count($list) == 0) { ?><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td><? } ?>
</tr>
</table>
최근 게시물에 뿌리고 싶습니다.
latest.skin.php에 어디를 손봐야 하나요.
초보라 죄송합니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$arr_new_cols=3; //한 줄에 출력할 이미지 개수
$imgwidth = 300; //이미지 가로사이즈
$imgheigh = 200; //이미지 세로사이즈
$tablewidth = 1000; // 전체테이블사이즈
$top_title = 최강통합갤러리; // 상단제목 설정하세요
$data_path = $g4[path]."/data/file";
$thumb_path = $data_path."/thumb/"; //불당썸네일 경로
?>
<style type="text/css">
BODY,TD,SELECT,input,form,TEXTAREA,center,option,pre,blockquote,span {font-size:9pt; font-family:나눔고딕; color:#666666;line-height:140%;}
a {selector-dummy: expression(this.hideFocus=true);}
A:link {color:666666;text-decoration:none;}
A:visited {color:666666;text-decoration:none;}
A:active {color:666666;text-decoration:none;}
A:hover {color:30C0FF;text-decoration:none;}
.sml8 {font-size:8pt; font-family:돋움; color:#2080D0; letter-spacing:-1;line-height:140%;};
</style>
<script language="javascript" src="<?=$latest_skin_path?>/img/common.js"></script>
<script language="javascript" src="<?=$latest_skin_path?>/img/viewTitle.js" type="text/javascript"></script>
<table width="<?=$tablewidth?>" border=0 cellspacing=0 cellpadding=0 align=center>
<tr><td><img src=<?=$latest_skin_path?>/img/bul2.gif align=absmiddle>
<script type="text/javascript">showTitle("", "<?=$latest_skin_path?>/img/viewTitle2.swf", 550, 30, "<?=$top_title?>", "", "left", "0x343434");</script>
</td></td></tr>
<tr>
<td height=13 background=<?=$latest_skin_path?>/img/title_bg.gif></td>
</tr>
</table>
<br>
<table width="<?=$tablewidth?>" cellpadding=0 cellspacing=0 style="margin-top:7px;" align=center>
<tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($i >= 0)
$title = get_text($list[$i][subject]);
//한 줄에 $arr_new_cols 만큼 출력
if($i%$arr_new_cols == 0 && $i>0)
echo "</tr><tr>";
$content = cut_str(get_text($list[$i][wr_content]), 80);
$bo_table=$board_list[$i][bo_table];
$image = urlencode($list[$i][file][0][file]); //이미지파일명
$thumb = $data_path."/".$bo_table."/".$image;
echo <<<HEREDOC
<td align='center'>
<a href='{$list[$i][href]}' >
<img src='$thumb' border='0' title='$title' class="img" width='$imgwidth' height='$imgheigh'></a>
<div><span class=sml8><a href=$g4[path]/bbs/board.php?bo_table={$board_list[$i][bo_table]}>[{$board_list[$i][bo_subject]}]</a></span><br><a href='{$list[$i][href]}' >{$subject} {$title}</a> {$list[$i][icon_new]}</div><br>
</td>
HEREDOC;
}
/* end for */
?>
<? if (count($list) == 0) { ?><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td><? } ?>
</tr>
</table>
Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, null given in /home/kagla/new-sir/old/lib/common.lib.php:2339 Stack trace: #0 /home/kagla/new-sir/old/lib/common.lib.php(2339): mysqli_fetch_assoc() #1 /home/kagla/new-sir/old/skin/board/v16/view.skin.php(795): sql_fetch_array() #2 /home/kagla/new-sir/old/bbs/view.php(403): include_once('...') #3 /home/kagla/new-sir/old/bbs/board.php(300): include_once('...') #4 {main} thrown in /home/kagla/new-sir/old/lib/common.lib.php on line 2339