최근게시물에 이미지가 있을때와 없을때 > 그누4 질문답변

그누4 질문답변

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

최근게시물에 이미지가 있을때와 없을때 정보

최근게시물에 이미지가 있을때와 없을때

본문

게시물에 이미지가 있을때 최근 게시물에 이미지가 나오고~

이미지가 없을때는 그냥 제목과 내용만 나오게 하고 싶습니다.

참고로 최근게시물에는 하나의 게시물만 나오게 할려구 합니다.

어떻게 하면 될까요~ ? ^^




<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$line_movie = '#aaaaaa';
$line_latest = 1; //한줄당 출력수 1 입력시 세로로 출력

$latest_bg = '#999999'; //둥근 테두리 배경색
$latest_line = '#ffffff'; //둥근 테두리 라인색

$movie_pic_width = 80; //그림 가로 크기
?>

<style>
.star_style1234 {
color:#c55555;
height:1;
filter:glow(strength=1,color=#555555);
}
</style>

<style>
.latest_line {
border-right:1px solid <?=$latest_line?>;
border-left:1px solid <?=$latest_line?>;
border-bottom:1px solid <?=$latest_line?>;
}
</style>


<table class='latest_line' width='100%' cellpadding='0' cellspacing='0' border='0'>
<tr><td colspan height=1 bgcolor='<?=$latest_line?>'></td></tr>

<tr>
<? for ($i=0; $i<count($list); $i++) {

if ($i%$line_latest==0) {
echo "</tr><Tr>";
}
    $title = get_text($list[$i][wr_subject]);
    $content = cut_str(strip_tags($list[$i][wr_content]), 76 ,"..");
$subject = cut_str($list[$i][subject], 26, '..');
$wr_1 = cut_str($list[$i][wr_1], 36, '..');
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);

    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$g4[path]/skin/latest/$bo_table/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

 $row5_sql = " SELECT wr_10 FROM g4_write_movie where wr_is_comment = '1' and wr_parent = '{$list[$i][wr_id]}' order by wr_10 ";
  $row5_result = mysql_query($row5_sql);

  $row6_sql = " SELECT wr_10 FROM g4_write_movie where wr_is_comment = '1' and wr_parent = '{$list[$i][wr_id]}' order by wr_10 ";
  $row6_result = mysql_query($row6_sql);

if ($row6 > 0) {
  $total_sum5 = round($p5/$row6, 2);
  $sum5 = round($p5/$row6, 1);

}
    echo <<<HEREDOC

    <td>
        <table border='0' cellpadding='2' cellspacing='2' align='center'>
        <tr>
          <td align='center' width='{$movie_pic_width}'>
<div style='border:1px solid #999999;' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$movie_pic_width}' border='0' align='absmiddle' title='$title'></a>
</div>
          </td>
          <td valign=top>
<table cellpadding='2' cellspacing='2' border='0'>
  <tr>
                      <td>
                          <a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><span style='font-size:9pt;font:bold;'>$subject</span></a>
        </td>
                    </tr>
                    <tr>
          <td valign=top>$content</td>
      </tr>
</table>
              </td>
          </tr>
        </table>
    </td>
HEREDOC;
}
?> </TR>
  </table>
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로