로그인 안해도 다운받기 창만 보이게 하기 이미지 파일 출력 안하기. 정보
그누호환 로그인 안해도 다운받기 창만 보이게 하기 이미지 파일 출력 안하기.![](http://sir.kr/data/member_image/hk/hkrssynd.gif?1221051479)
관련링크
본문
설명 :
1. download 파일명만 출력 다운금지.. 단 다운로드 받을수 있는 권한은 관리자모드에서 설정한 레벨만 받을수 있습니다.
2. 이미지도 다운받을수 있도록 나오는게 조금 맘에 걸리더라구요 그래서 이미지 파일이나 플래시 파일 다운로드란이 안나오도록 했습니다.
먼저 gbview.php 182 번째 줄
bbs/gbview.php
//if (!(preg_match($cfg[image_extension], $wr_file) || preg_match($cfg[flash_extension], $wr_file) || preg_match($cfg[movie_extension], $wr_file)))
$file[$i][view] = view_file_link($wr_file);
$file[$i][download] = $write["wr_file".$i."_download"]; //추가
$file[$i][size] = get_filesize("./data/file/$bo_table/$wr_file"); //추가
$file[$i][source] = $write["wr_file".$i."_source"]; //추가
스킨 /gbview.skin.php
<?
// 파일 업로드 설정한 값만큼 출력
이쪽부분을
<?
// 파일 업로드 설정한 값만큼 출력
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($member[mb_id] && $file[$i][source] && !$file[$i][view]) {
echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : <a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>, Down:{$file[$i][download]}</td></tr>"; }
else if ($file[$i][source] && !$file[$i][view]) echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : {$file[$i][source]} ({$file[$i][size]}), Down:{$file[$i][download]}</td></tr>";
}
?>
를 수정하시면 좋은 결과를 볼수 있습니다.
만약 이미지도 다운로드 하고 싶다면
<?
// 파일 업로드 설정한 값만큼 출력
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($member[mb_id] && $file[$i][source]) {
echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : <a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>, Down:{$file[$i][download]}</td></tr>"; }
else if ($file[$i][source]) echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : {$file[$i][source]} ({$file[$i][size]}), Down:{$file[$i][download]}</td></tr>";
}
?>
이런식으로 하세요 그럼 이만..
1. download 파일명만 출력 다운금지.. 단 다운로드 받을수 있는 권한은 관리자모드에서 설정한 레벨만 받을수 있습니다.
2. 이미지도 다운받을수 있도록 나오는게 조금 맘에 걸리더라구요 그래서 이미지 파일이나 플래시 파일 다운로드란이 안나오도록 했습니다.
먼저 gbview.php 182 번째 줄
bbs/gbview.php
//if (!(preg_match($cfg[image_extension], $wr_file) || preg_match($cfg[flash_extension], $wr_file) || preg_match($cfg[movie_extension], $wr_file)))
$file[$i][view] = view_file_link($wr_file);
$file[$i][download] = $write["wr_file".$i."_download"]; //추가
$file[$i][size] = get_filesize("./data/file/$bo_table/$wr_file"); //추가
$file[$i][source] = $write["wr_file".$i."_source"]; //추가
스킨 /gbview.skin.php
<?
// 파일 업로드 설정한 값만큼 출력
이쪽부분을
<?
// 파일 업로드 설정한 값만큼 출력
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($member[mb_id] && $file[$i][source] && !$file[$i][view]) {
echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : <a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>, Down:{$file[$i][download]}</td></tr>"; }
else if ($file[$i][source] && !$file[$i][view]) echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : {$file[$i][source]} ({$file[$i][size]}), Down:{$file[$i][download]}</td></tr>";
}
?>
를 수정하시면 좋은 결과를 볼수 있습니다.
만약 이미지도 다운로드 하고 싶다면
<?
// 파일 업로드 설정한 값만큼 출력
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($member[mb_id] && $file[$i][source]) {
echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : <a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>, Down:{$file[$i][download]}</td></tr>"; }
else if ($file[$i][source]) echo "<tr><td colspan=2 height=20> <span class=wview>Download</span> : {$file[$i][source]} ({$file[$i][size]}), Down:{$file[$i][download]}</td></tr>";
}
?>
이런식으로 하세요 그럼 이만..
추천
0
0
댓글 전체
감사합니다. 유용하게 쓰겠습니다.