갤러리 및 동영상게시판의 최근글. > 그누4 질문답변

그누4 질문답변

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

갤러리 및 동영상게시판의 최근글. 정보

갤러리 및 동영상게시판의 최근글.

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : www.ican2080.com

해결책이 안나와 계속 같은질문만 올리게되어 눈치보이네요;;
갤러리와 동영상 게시판의 최근글에서 썸네일이 출력 안되는 문제입니다.

--------------latest.skin.php//최근글 스킨의 latest.skin소스입니다.-------------
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>

<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr><td align=center>

<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr height=25><td align=left valign=bottom colspan=3>&nbsp;&nbsp;<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td></tr>
<tr><td width=78 height=4><img src="<?=$latest_skin_path?>/img/bgl.gif" border=0></td>
<td width=34 height=4><img src="<?=$latest_skin_path?>/img/bgm.gif" border=0></td>
<td width=100%  height=4 background="<?=$latest_skin_path?>/img/bgr.gif"></td></tr></table>

</td></tr>
<tr><td align=center>

<table width=100%>
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
    if ($i > 0)
        echo '<td width=20>&nbsp;</td>';

    $title = get_text($list[$i][wr_subject]);
    $content = cut_str(get_text($list[$i][wr_content]), 80);
    $img = "$g4[path]/data/file/$bo_table/thumb/".$list[$i][file][0][file];
    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

    echo <<<HEREDOC
<td align=center>

<table border=0 cellpadding=0 cellspacing=0 align=center width=100%>
<tr><td height=5 align=center></td></tr>
<tr><td align=center><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' border='0' width=120 height=100 align='absmiddle' title='$title'></a></td></tr>
<tr><td height=5 align=center></td></tr>
<tr><td height=20 align=center><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>{$list[$i][subject]}</a></td></tr></table>

</td>
HEREDOC;
}
?>
</tr>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align='center' height=25>게시물이 없습니다.</td></tr>
<? } ?>
</table>

</td></tr></table>
-----------------------------------------------------------------


메인에

include_once("$g4[path]/lib/latest_notice.php");
..........
........
......
<?=latest("ver01gallery","photos",2,15,80,1);?><br><?=latest("ver01gallery","clips",2,15,80,1);?>
이런식으로 넣어줬습니다.


그리고 아래는 latest.notice.php의 소스입니다.
<?php
if (!defined('_GNUBOARD_')) exit;

// 최신글 추출
function quoting(&$item1, $key) { $item1 = "'$item1'"; }
function latest_notice($skin_dir="", $bo_tables, $rows=10, $subject_len=40, $options="") {

    global $g4;

    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/basic";

    if( !is_array( $bo_tables)) return 'A second parameter error:bo_tables should be an array.';

    array_walk( $bo_tables , 'quoting');
    $bo_tables_cond= implode(',', $bo_tables);
    $notice_res= sql_query( "select bo_table, bo_notice from {$g4['board_table']} where bo_table in ( $bo_tables_cond ) " );

    $notice_wr_id_cond=array();
    $notice_bo_tables=array();

    while( $row= sql_fetch_array( $notice_res)) {
        $this_notice= trim($row['bo_notice']);
        if( empty( $this_notice)) continue;
        $notice_wr_id_cond[]= implode( ',', split("\n", $this_notice));
        $notice_bo_tables[]= $row['bo_table'];
    }

    $sqls= array();

    foreach( $notice_bo_tables as $idx => $notice_bo_table) {
        $sqls[]= " select wr_id , wr_subject from {$g4['write_prefix']}$notice_bo_table where wr_id in ( {$notice_wr_id_cond[$idx]} )";
    }

    $list = array();

    $result = sql_query( implode( ' union all ', $sqls));
    for ($i=0; ($row = sql_fetch_array($result)) && $i < $rows; $i++)
        $list[$i] = get_list($row, array( 'bo_table'=>$notice_bo_table), $latest_skin_path, $subject_len);

    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}
?>
  • 복사

댓글 전체

$img = "$g4[path]/data/file/$bo_table/thumb/".$list[$i][file][0][file];
되는 소스를 받아 오신 건가요?
  $img = "$g4[path]/data/file/$bo_table/thumb/".$list[$i][wr_id];

썸네일 만드는 방식이 뭔지 모르니 찍기?만 하네요.

list.skin.php도 보여 주여야 빠른 답변을 얻으실 수 있습니다.
© SIRSOFT
현재 페이지 제일 처음으로