nine님의 원본출력 갤러리게시판 list에서 그림파일외의 자료 업로드시 엑스박스 문제

nine님의 원본출력 갤러리게시판 list에서 그림파일외의 자료 업로드시 엑스박스 문제

QA

nine님의 원본출력 갤러리게시판 list에서 그림파일외의 자료 업로드시 엑스박스 문제

답변 1

본문

원본글 URL) nine님의 [네이비st] 원본출력 베이직 갤러리 게시판
 
 
문의 1)
그림파일 외의 파일을 업로드시에 리스트에서 엑스박스로 표시됩니다. (.ppt / .pdf 등의 파일..)
아래 코드에서 이미지파일이 아닐때 noimage를 표시해주도록 체크해주는것 같은데
ppt 및 pdf파일을 올렸을때 noimage.jpg가 뜨지않고 엑스박스가 뜹니다.
오른쪽 클릭후 확인해보면 이미지경로가 /noimage.jpg가 아닌 업로드한 파일 /file.pdf 경로로 나타납니다.
아래 부분이 이미지파일이 아닐때는 noimage로 나타나게 해줄수는 없을까요?
 
해당 부분 전체 소스 입니다.

<?
for ($i=0; $i<count($list); $i++) 
{ 
    $title = "자세히보기";
    $content = cut_str(get_text($list[$i][wr_content]), 80);
 $subject = cut_str(get_text($list[$i][subject]), 30, '...');  //제목길이
 $img_width  = '150';  // 이미지 가로크기 
 $img_height = '150';  // 이미지 세로크기 
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$board_skin_path/img/noimage.jpg";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"; 
    $view_href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"; 
    if ($is_admin) 
        $view_href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
    $checkbox = "";
    if ($is_checkbox)
        $checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
 $comment_cnt = "";
        if ($list[$i][comment_cnt]) 
           $comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:10px;'><font face='Tahoma' color='#EE5A00'>{$list[$i][comment_cnt]}</span></a>";
    $tr = ""; 
    if ($i && $i%$board[bo_gallery_cols]==0) 
        $tr = "</tr><tr>"; 
    echo "$tr"; 
    echo <<<HEREDOC
    <td width="{$td_width}%" valign="top" align="center">
        <table border="0" cellpadding="0" cellspacing="0">
        <tr> 
            <td style='word-break:break-all; padding-bottom:8px;'><a href="{$href}"><img src="{$img}" width='{$img_width}' border="0" title="$title" style="border:1px solid #ccc"></a></td>         
HEREDOC;
 echo "<tr><td class=small align=center>";
 if ($is_category) echo "<a href='{$list[$i][ca_name_href]}'>[{$list[$i][ca_name]}]</a></td></tr>";  // 카테고리
 echo "<tr><td align=center height=24><a href='{$list[$i][href]}'>$subject</a> {$comment_cnt} {$list[$i][icon_new]}</td></tr>"; // 제목
 //echo "<tr><td align=center style='font-size:11px; color:#888;'>Name.{$list[$i][name]}</td></tr>";  // 작성자
 //echo "<tr><td align=center style='font-size:11px; color:#888;'>Date.".$list[$i][datetime2]."  <span style='font-size:9px;color:#CCCCCC;'>|</span>  Hit.".$list[$i][wr_hit]."</td></tr>";  //조회및날짜
 if ($is_checkbox) echo "<tr><td align=center><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'></td></tr>";
 echo "<tr><td height=15></td></tr>";
 echo "</table>";
 echo "</td>";
}
?>  

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 1,534
© SIRSOFT
현재 페이지 제일 처음으로