인기게시글. 테이블명이 안불러와져요.. 정보
인기게시글. 테이블명이 안불러와져요..본문
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center >
<table width=95% valign=top border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=22><img src="<?=$latest_skin_path?>/img/btn<?=$titles?>_<?=$i+1?>.gif" width="12" height="11" align="absmiddle">
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent>";
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
echo "<img src='$g4[path]/data/file/{$list[$i]['bo_table']}/$image' width='60' height='40' border=0 class=img>"; // 이미지크기
} else
저기서 테이블명이 나와서 썸네일이 출력되는데. 테이블명이 불러와지지 않아 엑박으로 밖에
안나옵니다... 도움좀 주세요.
엑박된 주소에 보면 htt://localhost/onuri/data/file//21423gds2.jpg 이렇게 // 두개의 사이에 테이블명이 안불러 와지거든요... 부탁드립니다.
댓글 전체
$list[$i][bo_table] 변수를 확인해 보셔야 할 것 같습니다.
[wr_num] => -1
[wr_reply] =>
[wr_parent] => 6
[wr_is_comment] => 0
[wr_comment] => 0
[wr_comment_reply] =>
[ca_name] =>
[wr_option] =>
[wr_subject] => 아이리스
[wr_content] => 아이리스
[wr_link1] =>
[wr_link2] =>
[wr_link1_hit] => 0
[wr_link2_hit] => 0
[wr_trackback] =>
[wr_hit] => 1
[wr_good] => 0
[wr_nogood] => 0
[mb_id] => admin
[wr_password] => 446a12100c856ce9
[wr_name] => 관리자
[wr_email] => admin@domain
[wr_homepage] =>
[wr_datetime] => 2009-11-28 21:46:24
[wr_last] => 2009-11-28 21:46:24
[wr_ip] => 127.0.0.1
[wr_1] =>
[wr_2] =>
[wr_3] =>
[wr_4] =>
[wr_5] =>
[wr_6] =>
[wr_7] =>
[wr_8] =>
[wr_9] =>
[wr_10] =>
[is_notice] => 0
[subject] => 아이리스
[comment_cnt] =>
[datetime] => 2009-11-28
[datetime2] => 21:46
[last] => 2009-11-28
[last2] => 21:46
[name] => 관리자
[reply] =>
[icon_reply] =>
[icon_link] =>
[ca_name_href] => ./bbs/board.php?bo_table=01_1&sca=
[href] => ./bbs/board.php?bo_table=01_1&wr_id=6
[comment_href] => ./bbs/board.php?bo_table=01_1&wr_id=6
[icon_new] =>
[icon_hot] =>
[icon_secret] =>
[link] => Array
(
[1] =>
[2] =>
)
[link_href] => Array
(
[1] => ./bbs/link.php?bo_table=01_1&wr_id=6&no=1
[2] => ./bbs/link.php?bo_table=01_1&wr_id=6&no=2
)
[link_hit] => Array
(
[1] => 0
[2] => 0
)
[file] => Array
(
[count] => 1
[0] => Array
(
[href] => ./download.php?bo_table=01_1&wr_id=6&no=0
[download] => 0
[path] => ./data/file/01_1
[size] => 67.1K
[datetime] => 2009-11-28 21:46:24
[source] => iris.jpg
[bf_content] =>
[content] =>
[view] =>
[file] => 2130706433_vtzoJgDr_iris.jpg
[image_width] => 346
[image_height] => 495
[image_type] => 2
)
)
[icon_file] =>
)
이렇게 나오네요..bo_table 아예 보이질 않는데...어떻게 해야 할까요?
========== 수정 전 ===========================================================================
echo "<img src='$g4[path]/data/file/{$list[$i]['bo_table']}/$image' width='60' height='40' border=0 class=img>"; // 이미지크기
=============================================================================================
========== 수정 후 ===========================================================================
echo "<img src='$g4[path]/data/file/$bo_table/$image' width='60' height='40' border=0 class=img>"; // 이미지크기
=============================================================================================
/$bo_table/ 이 테이블이 안불러와져서 file//2354dfs.jpg 이런식으로 계속 나오네요...
echo "<img src='$g4[path]/data/file/$board[bo_table]/$image' width='60' height='40' border=0 class=img>"; // 이미지크기
온누리 빌더를 쓰고 있는데 앞에 패쓰경로라던지 몰 따로 설정해 줘야 하나요?
인클루된 파일이 아무 것도 없던데...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0 >
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center >
<table width=95% valign=top border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=22><img src="<?=$latest_skin_path?>/img/btn<?=$titles?>_<?=$i+1?>.gif" width="12" height="11" align="absmiddle">
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent>";
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
echo "<img src='$g4[path]/data/file/$board[bo_table]/$image' width='150' height='180' border=0 class=img>"; // 이미지크기
} else
echo "<img src='$latest_skin_path/img/no_image.gif' width='60' height='40' border=0>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
echo "</a>";
echo print_r2($list[$i]['bo_table'])
//if ($list[$i]['comment_cnt']) //
//echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";//
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
?></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50>게시물이 없습니다.</a></td></tr><? } ?>
</table>
latest 총 소스 입니다.
그 중에서 게시판 테이블명을 저장하고 있는 변수명을 찾아보세요.
print_r2($GLOBALS);
*RECURSION*
[_ENV] => Array
(
[ALLUSERSPROFILE] => C:\Documents and Settings\All Users
[CLASSPATH] => .;C:\Program Files\QuickTime\QTSystem\QTJava.zip
[CommonProgramFiles] => C:\Program Files\Common Files
[COMPUTERNAME] => HAYA
[ComSpec] => C:\WINDOWS\system32\cmd.exe
[FP_NO_HOST_CHECK] => NO
[NUMBER_OF_PROCESSORS] => 2
[OS] => Windows_NT
[Path] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ESTsoft\ALZip;C:\APM_Setup\Server\Apache\bin;C:\APM_Setup\Server\MySQL5\bin;C:\APM_Setup\Server\PHP5;C:\Program Files\QuickTime\QTSystem\
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 6 Model 15 Stepping 13, GenuineIntel
[PROCESSOR_LEVEL] => 6
[PROCESSOR_REVISION] => 0f0d
[ProgramFiles] => C:\Program Files
[QTJAVA] => C:\Program Files\QuickTime\QTSystem\QTJava.zip
[SystemDrive] => C:
[SystemRoot] => C:\WINDOWS
[TEMP] => C:\WINDOWS\TEMP
[TMP] => C:\WINDOWS\TEMP
[USERPROFILE] => C:\Documents and Settings\LocalService
[windir] => C:\WINDOWS
[AP_PARENT_PID] => 908
)
[HTTP_ENV_VARS] => Array
(
[ALLUSERSPROFILE] => C:\Documents and Settings\All Users
[CLASSPATH] => .;C:\Program Files\QuickTime\QTSystem\QTJava.zip
[CommonProgramFiles] => C:\Program Files\Common Files
[COMPUTERNAME] => HAYA
[ComSpec] => C:\WINDOWS\system32\cmd.exe
[FP_NO_HOST_CHECK] => NO
[NUMBER_OF_PROCESSORS] => 2
[OS] => Windows_NT
[Path] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ESTsoft\ALZip;C:\APM_Setup\Server\Apache\bin;C:\APM_Setup\Server\MySQL5\bin;C:\APM_Setup\Server\PHP5;C:\Program Files\QuickTime\QTSystem\
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 6 Model 15 Stepping 13, GenuineIntel
[PROCESSOR_LEVEL] => 6
[PROCESSOR_REVISION] => 0f0d
[ProgramFiles] => C:\Program Files
[QTJAVA] => C:\Program Files\QuickTime\QTSystem\QTJava.zip
[SystemDrive] => C:
[SystemRoot] => C:\WINDOWS
[TEMP] => C:\WINDOWS\TEMP
[TMP] => C:\WINDOWS\TEMP
[USERPROFILE] => C:\Documents and Settings\LocalService
[windir] => C:\WINDOWS
[AP_PARENT_PID] => 908
)
[_POST] => Array
(
)
[HTTP_POST_VARS] => Array
(
)
[_GET] => Array
(
)
[HTTP_GET_VARS] => Array
(
)
[_COOKIE] => Array
(
[f33d2ed86bd82d4c22123c9da444d8ab] => MTI1OTMyNzU4NQ==
[2a0d2363701f23f8a75028924a3af643] => MTI3LjAuMC4x
[96b28b766b7e0699aa91c9ff3d890663] => aHR0cDovL2xvY2FsaG9zdC9vbnVyaS8=
[PHPSESSID] => c1542ee64065ac0ae7ccb151a6d2050e
)
[HTTP_COOKIE_VARS] => Array
(
[f33d2ed86bd82d4c22123c9da444d8ab] => MTI1OTMyNzU4NQ==
[2a0d2363701f23f8a75028924a3af643] => MTI3LjAuMC4x
[96b28b766b7e0699aa91c9ff3d890663] => aHR0cDovL2xvY2FsaG9zdC9vbnVyaS8=
[PHPSESSID] => c1542ee64065ac0ae7ccb151a6d2050e
)
[_SERVER] => Array
(
[HTTP_ACCEPT] => */*
[HTTP_ACCEPT_LANGUAGE] => ko
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[HTTP_HOST] => localhost
[HTTP_CONNECTION] => Keep-Alive
[HTTP_CACHE_CONTROL] => no-cache
[HTTP_COOKIE] => f33d2ed86bd82d4c22123c9da444d8ab=MTI1OTMyNzU4NQ%3D%3D; 2a0d2363701f23f8a75028924a3af643=MTI3LjAuMC4x; 96b28b766b7e0699aa91c9ff3d890663=aHR0cDovL2xvY2FsaG9zdC9vbnVyaS8%3D; PHPSESSID=c1542ee64065ac0ae7ccb151a6d2050e
[PATH] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ESTsoft\ALZip;C:\APM_Setup\Server\Apache\bin;C:\APM_Setup\Server\MySQL5\bin;C:\APM_Setup\Server\PHP5;C:\Program Files\QuickTime\QTSystem\
[SystemRoot] => C:\WINDOWS
[COMSPEC] => C:\WINDOWS\system32\cmd.exe
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
[WINDIR] => C:\WINDOWS
[SERVER_SIGNATURE] =>
Apache Server at localhost Port 80
[SERVER_SOFTWARE] => Apache
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => C:/APM_Setup/htdocs
[SERVER_ADMIN] => admin@domain
[mb_homepage] =>
[mb_password_q] =>
[mb_password_a] =>
[mb_level] => 10
[mb_jumin] => 1b461a2a27e9b723
[mb_sex] =>
[mb_birth] =>
[mb_tel] =>
[mb_hp] =>
[mb_zip1] =>
[mb_zip2] =>
[mb_addr1] =>
[mb_addr2] =>
[mb_signature] =>
[mb_recommend] =>
[mb_point] => 470
[mb_today_login] => 2009-11-29 00:30:31
[mb_login_ip] => 127.0.0.1
[mb_datetime] => 2009-10-01 21:58:42
[mb_ip] => 127.0.0.1
[mb_leave_date] =>
[mb_intercept_date] =>
[mb_email_certify] => 2009-10-01 21:58:42
[mb_memo] =>
[mb_mailling] => 1
[mb_sms] => 0
[mb_open] => 1
[mb_open_date] => 0000-00-00
[mb_profile] =>
[mb_memo_call] =>
[mb_auth_count] => 0
[mb_1] =>
[mb_2] =>
[mb_3] =>
[mb_4] =>
[mb_5] =>
[mb_6] =>
[mb_7] =>
[mb_8] =>
[mb_9] =>
[mb_10] =>
[mb_dir] => ad
)
[board] => Array
(
)
[group] => Array
(
)
[g4] => Array
(
[path] => .
[bbs] => bbs
[bbs_path] => ./bbs
[bbs_img] => img
[bbs_img_path] => ./bbs/img
[admin] => adm
[admin_path] => ./adm
[editor] => cheditor
[editor_path] => ./cheditor
[cheditor4] => cheditor4
[cheditor4_path] => ./cheditor4
[geditor] => geditor
[geditor_path] => ./geditor
[server_time] => 1259466950
[time_ymd] => 2009-11-29
[time_his] => 10:55:50
[time_ymdhis] => 2009-11-29 10:55:50
[table_prefix] => onuri_
[write_prefix] => onuri_write_
[auth_table] => onuri_auth
[config_table] => onuri_config
[group_table] => onuri_group
[group_member_table] => onuri_group_member
[board_table] => onuri_board
[board_file_table] => onuri_board_file
[board_good_table] => onuri_board_good
[board_new_table] => onuri_board_new
[login_table] => onuri_login
[mail_table] => onuri_mail
[member_table] => onuri_member
[memo_table] => onuri_memo
[poll_table] => onuri_poll
[poll_etc_table] => onuri_poll_etc
[point_table] => onuri_point
[popular_table] => onuri_popular
[scrap_table] => onuri_scrap
[visit_table] => onuri_visit
[visit_sum_table] => onuri_visit_sum
[token_table] => onuri_token
[my_menu_table] => onuri_my_menu
[level_table] => onuri_level
[avatar_item_table] => onuri_avatar_item
[avatar_member_table] => onuri_avatar_member
[cookie_domain] =>
[link_count] => 2
[charset] => utf-8
[phpmyadmin_dir] => adm/phpMyAdmin/
[token_time] => 3
[url] => http://localhost/onuri
[https_url] =>
[coupon_table] => onuri_coupon_table
[title] => 오누리 빌더
)
[dir] => /onuri
[cnt] => 0
[dirname] => C:\APM_Setup\htdocs\onuri/
[dbconfig_file] => dbconfig.php
[mysql_host] => localhost
[mysql_user] => root
[mysql_password] => apmsetup
[mysql_db] => onuri
[connect_db] => Resource id #8
[select_db] => 1
[HTTP_SESSION_VARS] => Array
(
[ss_mb_id] => admin
)
[_SESSION] => Array
(
[ss_mb_id] => admin
)
[qstr] =>
[urlencode] => %2Fonuri%2F
[is_guest] =>
[is_member] => 1
[is_admin] => super
[board_skin_path] =>
[tmp] => Directory Object
(
[path] => ./extend
[handle] => Resource id #12
)
[entry] =>
[sql] => Resource id #16
[begin_time] => 1259466950.84
[lo_location] => 오누리 빌더
[lo_url] =>
[gmnow] => Sun, 29 Nov 2009 03:55:50 GMT
[g4_board] => Array
(
[07_1] => Array
(
[bo_table] => 07_1
[bo_notice] =>
[bo_subject] => 07_1
[bo_subject_len] => 60
[bo_use_list_content] => 0
[bo_new] => 24
[bo_use_sideview] => 0
[bo_use_comment] => 0
[bo_hot] => 100
[bo_use_search] => 1
)
)
[s_menu] => index
[gr_id] =>
[bo_table] =>
[stx] =>
[page] =>
)
이렇게 나오는데요... $onuri_board , $list[$i][$onuri_board] 요런것도 해봤는데 안되네요..
마지막에 [bo_table] => 아무것도 없는게 잘못된건가요?
if (!defined('_GNUBOARD_')) exit;
/*
izen.group.lib.php
제작일 : 2006-12-08
지정 기간제 히트순 최근 게시물 수정본
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/7328
그룹 최신글 관련하여 통합하도록 하였다.
정렬 필드값에 의해서 SQL 문을 추가하도록 하면 된다.
izen_group('스킨', '그룹명', 정렬필드, 출력갯수, 자를 문자열, 최근 몇일간을 출력할 것인가?);
예) echo izen_group('best10', '06', wr_hit, 10, 28, 30);
*/
# 인기글
function izen_usort1($a, $b)
{
return $b['wr_hit'] - $a['wr_hit'];
}
# 헤드라인
function izen_usort2($a, $b)
{
return $b['wr_good'] - $a['wr_good'];
}
# 최신글 추출
function izen_group($skin_dir="", $gr_id, $izen_sort, $rows=10, $subject_len=40, $listdate)
{
global $g4;
$nowYmd = date(Ymd); # 시작시간을 구합니다.
$time = time();
$startYmd = date("Ymd",strtotime("-".$listdate." day", $time));
if ($skin_dir)
{
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
}
else
{
$latest_skin_path = "$g4[path]/skin/latest/basic";
}
$list = array();
$sql= " select bo_table from {$g4['board_table']} ";
$ress = sql_query($sql);
for($i=0, $ii=0; $board=sql_fetch_array($ress); $ii++)
{
$tmp_write_table = $g4['write_prefix'] . $board['bo_table']; # 게시판 테이블 전체이름
#$sql = "select * from `$tmp_write_table` where wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' order by $sort desc limit 0, $rows ";
# 정렬 필드에 의해서 전체적으로 정렬, 관리한다.
if ($izen_sort == 'wr_hit')
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_scrap')
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_scrap <> 0 order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_datetime') # wr_1 헤드라인
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_1 = 1 order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_good') #
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_good <> '0' order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_id')
{
$sql_gr_Q = " wr_is_comment <> '1' order by $izen_sort desc limit 0, $rows ";
}
$sql = " select * from `$tmp_write_table` where $sql_gr_Q ";
$result = sql_query($sql);
#for (; $row=sql_fetch_array($result); $i++) # *오류* 전체 게시물 가운데 날짜에 상관없이 히트순으로 지정한 갯수만큼 출력된다.
for ($i==0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len, $listdate);
}
}
if ($izen_sort == 'wr_hit')
{
usort($list, 'izen_usort1');
}
elseif ($izen_sort == 'wr_good')
{
usort($list, 'izen_usort2');
}
$list= array_slice($list, 0, $rows);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content; } ?>
입니다. 다른 게시글 추출에선 bo_table 이 잘 먹히던데 유독 여기서만 안먹히네요...