스킨수정작업하다 세션관련 삽입해야 되는 부분 까먹어서 검색해본 팁을 가지고
제 나름대로 조금 쓰기 편하게 더 수정해봤습니다.
기록보존용 비스무리하게 남겨봅니다.
[code]
<pre class="brush: php"><script type="text/javascript">
// 파일다운로드를 위해 사용되는 js함수. php 구문 바깥에 넣어두세요.
function file_download(link, file) {
document.location.href=link;
}
</script>
<?
for ($i=0; $i<count($list); $i++) {
// for 반복구문 아래에다 집어넣습니다.
$ss_name = "ss_view_{$bo_table}_{$list[$i][wr_id]}";
session_register($ss_name);
$$ss_name = $HTTP_SESSION_VARS[$ss_name] = TRUE;
$files_path = $g4['path']."/data/file/".$bo_table."/";
for($j=0; $j<=count($list[$i][file]); $j++) {
if($list[$i][file][$j][file] && file_exists($files_path.$list[$i][file][$j][file])) {
$files_link[$j] = "<a href=\"javascript:file_download('{$list[$i][file][$j][href]}', '{$list[$i][file][$j][source]}');\" title=\"{$list[$i][file][$j][content]}\"--><p><img src="\"{$board_skin_path}/img/icon_file.gif\"" align="\"absmiddle\"" border="\"0\"">";
} else
$files_link[$j] = "파일없음"; // 또는 공백처리 하시던지
}
</p></pre>
[/code]
// 필요로 하는 곳에서
echo $files_link[0];
echo $files_link[1];
// 이런식으로 불러쓰시면 됩니다. 한 게시물당 파일이 다수이면 반복문으로 불러쓰셔도 됩니다.
검색해서 봤던 팁은 이겁니다. ↓↓
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=711
제 나름대로 조금 쓰기 편하게 더 수정해봤습니다.
기록보존용 비스무리하게 남겨봅니다.
[code]
<pre class="brush: php"><script type="text/javascript">
// 파일다운로드를 위해 사용되는 js함수. php 구문 바깥에 넣어두세요.
function file_download(link, file) {
document.location.href=link;
}
</script>
<?
for ($i=0; $i<count($list); $i++) {
// for 반복구문 아래에다 집어넣습니다.
$ss_name = "ss_view_{$bo_table}_{$list[$i][wr_id]}";
session_register($ss_name);
$$ss_name = $HTTP_SESSION_VARS[$ss_name] = TRUE;
$files_path = $g4['path']."/data/file/".$bo_table."/";
for($j=0; $j<=count($list[$i][file]); $j++) {
if($list[$i][file][$j][file] && file_exists($files_path.$list[$i][file][$j][file])) {
$files_link[$j] = "<a href=\"javascript:file_download('{$list[$i][file][$j][href]}', '{$list[$i][file][$j][source]}');\" title=\"{$list[$i][file][$j][content]}\"--><p><img src="\"{$board_skin_path}/img/icon_file.gif\"" align="\"absmiddle\"" border="\"0\"">";
} else
$files_link[$j] = "파일없음"; // 또는 공백처리 하시던지
}
</p></pre>
[/code]
// 필요로 하는 곳에서
echo $files_link[0];
echo $files_link[1];
// 이런식으로 불러쓰시면 됩니다. 한 게시물당 파일이 다수이면 반복문으로 불러쓰셔도 됩니다.
검색해서 봤던 팁은 이겁니다. ↓↓
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=711
댓글 5개
게시글 목록
| 번호 | 제목 |
|---|---|
| 32281 | |
| 32267 | |
| 32264 | |
| 32262 | |
| 32254 | |
| 32239 | |
| 32232 | |
| 32221 | |
| 32220 | |
| 32217 | |
| 32204 | |
| 32203 | |
| 32200 | |
| 32192 | |
| 32161 | |
| 32154 | |
| 32150 | |
| 32146 | |
| 32137 | |
| 32116 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기