달력스킨인데요! list 페이지에서 첨부한 파일을 다운받을수 있게 하려면 어떻게 해야 할까요? > 그누4 질문답변

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!

그누4 질문답변

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

달력스킨인데요! list 페이지에서 첨부한 파일을 다운받을수 있게 하려면 어떻게 해야 할까요? 정보

달력스킨인데요! list 페이지에서 첨부한 파일을 다운받을수 있게 하려면 어떻게 해야 할까요?

본문

청춘불안정님 스킨으로 일정관리를 사용하고 있는데요!
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=87703&sca=%B4%DE%B7%C2

아래는 list.skin.php 코드에요!
list페이지에서 첨부한 파일의 파일명과 링크를 클릭하면 다운을 받을수 있게 하고 싶은데 검색해본 내용들을 적용하려고 하는데 정말 왕초보라 모르겠네요 ㅠㅠ 좀 알려주세요!
직장에 사장님이 지시하신거라 꼭 필요한거거든요.

아래에 보시면 빨간색으로 표시한 부분을 응용하면 될것 같기도 한데 정말 모르겠네요 흑흑 ㅠㅠ
꼭 좀 알려주세요! 꾸벅 꾸벅

포인트를 더 걸고 싶은데 가지고 있는 포인트가 1130점밖에 안되서 1000점 밖에 못 거네요! 죄송합니다! ㅜㅠ

<?php
include_once($board_skin_path . '/lib/skin.lib.php');
$VAR['today'] = date('Ymd');
$VAR['select'] = date('Ym');
if(preg_match('/^[0-9]{6}$/', $_GET['schedule_ym']) == true && checkdate(substr($_GET['schedule_ym'], 4, 2), 1, substr($_GET['schedule_ym'], 0, 4)) == true) $VAR['select'] = $_GET['schedule_ym'];
$VAR['timestamp'] = strtotime($VAR['select'] . '01');
$VAR['weekday'] = date('w', $VAR['timestamp']);
$VAR['count'] = date('t', $VAR['timestamp']) + $VAR['weekday'] + 1;
$VAR['path'] = "{$g4['bbs_path']}/board.php?bo_table={$bo_table}";
?>
<link rel="stylesheet" type="text/css" href="<?php echo $board_skin_path; ?>/css/list.skin.css" />
<script type="text/javascript" src="<?php echo $board_skin_path; ?>/js/list.skin.js" charset="<?php echo $g4['charset']; ?>"></script>
<center id="G4_LIST" style="width:<?php echo $width; ?>;">
 <p class="subject">
  <a href="<?php echo phpself('schedule_ym', date('Ym', strtotime('-1 month', $VAR['timestamp']))); ?>"><img src="<?php echo $board_skin_path; ?>/img/b_prev_month.gif" alt="이전달" /></a>
     
  <a href="<?php echo $VAR['path'] . "&schedule_ym={$VAR['select']}"; ?>"><strong><?php echo date('Y년 m월', $VAR['timestamp']); ?></strong></a>
     
  <a href="<?php echo phpself('schedule_ym', date('Ym', strtotime('+1 month', $VAR['timestamp']))); ?>"><img src="<?php echo $board_skin_path; ?>/img/b_next_month.gif" alt="다음달" /></a>
 </p>
 <table>
  <tr>
   <td class="sunday"><strong class="white">일</strong></td>
   <td class="weekday"><strong class="white">월</strong></td>
   <td class="weekday"><strong class="white">화</strong></td>
   <td class="weekday"><strong class="white">수</strong></td>
   <td class="weekday"><strong class="white">목</strong></td>
   <td class="weekday"><strong class="white">금</strong></td>
   <td class="saturday"><strong class="white">토</strong></td>
  </tr>
  <tr>
  <?php
  for($i = $row = 1; $i < $VAR['count']; $i++, $row++)
  {
   $date = $i - $VAR['weekday'];
   if($date < 1) echo '<td class="default"> </td>';
   else
   {
    $wr_1 = $VAR['select'] . sprintf('%02d', $date);
    if($VAR['today'] == $wr_1) $date = "<ins>{$date}</ins>";
    $schedule = null;
    $query = sql_query("SELECT wr_id, wr_subject FROM {$write_table} WHERE wr_1 = '{$wr_1}' AND wr_is_comment = 0");
    while($result = mysql_fetch_array($query))
    {
     $schedule .= "<div><a href=\"{$VAR['path']}&wr_id={$result['wr_id']}\">{$result['wr_subject']}</a></div>";
    }
    if($schedule) $date = "<strong class=\"red\">{$date}</strong>";
    echo "<td class=\"default\"><div>{$date}</div>{$schedule}</td>";
   }
   if($row > 0 && $row % 7 == 0 && $row < $VAR['count']) echo '</tr><tr height="100">';
  }
  $count = 7 - (($row - 1) % 7);
  if($count != 7)
  {
   for($i = 1; $i <= $count; $i++) echo '<td class="default"> </td>';
  }
  ?>
  </tr>
 </table>
 <?php if($admin_href || !$member['mb_id'] || $write_href){ ?>
 <p class="button">
  <?php if($admin_href) echo "<input type=\"button\" name=\"write\" value=\"관리자\" class=\"root\" onclick=\"window.document.location.href='{$admin_href}';\" />"; ?>
  <?php if(!$member['mb_id']) echo "<input type=\"button\" name=\"write\" value=\"로그인\" class=\"button\" onclick=\"window.document.location.href='{$g4['bbs_path']}/login.php?url={$urlencode}';\" />"; ?>
  <?php if($write_href) echo "<input type=\"button\" name=\"write\" value=\"작성\" class=\"button\" onclick=\"window.document.location.href='{$write_href}';\" />"; ?>
 </p>
 <?php } ?>
</center>

댓글 전체

while($result = mysql_fetch_array($query))
    {
    $schedule .= "<div><a href=\"{$VAR['path']}&wr_id={$result['wr_id']}\">{$result['wr_subject']}</a></div>";
    }



부분을 아래와 같이 해보세요.



while($result = mysql_fetch_array($query))
{

    // 파일
    $tmp_file = "";
    $sql = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '{$result[wr_id]}' and bf_file != '' and bf_type not in (1,2,3) order by bf_no asc ";
    $result2 = sql_query($sql);
    for ($k=0; $file = sql_fetch_array($result2); $k++) {

        $tmp_file .= "파일 : <a href=\"javascript:file_download('".$g4['bbs_path']."/download.php?bo_table=".$bo_table."&wr_id=".$result['wr_id']."&no=".$file['bf_no']."', '".$file['source']."');\">".$file['source']."</a> ";

    }

    $schedule .= "<div><a href=\"{$VAR['path']}&wr_id={$result['wr_id']}\">{$result['wr_subject']}</a> {$tmp_file}</div>";








그리고 맨 하단에 스크립트 추가


<script type="text/javascript">
function file_download(link, file) {

    document.location.href=link;

}
</script>
유아원님! 정말 너무 진심으로 감사의 말씀드립니다.

소스를 적용하니 잘 작동을 하네요!

근데 파일명이 나오지를 않아서

        $tmp_file .= "파일 : <a href=\"javascript:file_download('".$g4['bbs_path']."/download.php?bo_table=".$bo_table."&wr_id=".$result['wr_id']."&no=".$file['bf_no']."', '".$file['source']."');\">".$file['source']."</a> ";

저부분에 ">".$file['source']."링크</a> ";

이렇게 하니 링크라는 글이 나오기는 하는데 파일명이 왜 안나오는걸까요?

정말 염치 없지만 한번만 더 알려주시면 안될까요? 꾸벅 꾸벅
와~! 정말 잘 되네요! 너무 감사합니다!!! 꾸벅 꾸벅!!

근데 죄송하게 또 드릴 질문이 생기네요! 애공! ㅡ,ㅜ

글을 쓴 본인은 본인 달력에서 다운로드가 정상적으로 되는데 다른사람이 일정에서 다운을 받을려고 클릭을 하면 잘못된 접근이라는 스크립트 창이 나오네요.
다운받으려는 글의 view페이지를 한번 들어갔다가 다시 list로 나와서 다운을 받으려고 하면 다운이 되구요.

무슨 권한 문제인거 같은데 애공! 어느 부분이 문제일까요?
ㅠㅠ
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT