| $row[it_id] |
- ".get_it_image("{$row[it_id]}_s", 50, 50)." |
+ ".get_it_image("{$row['it_id']}/{$it_img}", 50, 50)." |
$tmp_ca_list
|
diff --git a/bbs/board.php b/bbs/board.php
index aca7542b9..e4b883ba6 100644
--- a/bbs/board.php
+++ b/bbs/board.php
@@ -180,7 +180,7 @@ if ($member['mb_id'] && ($is_admin == 'super' || $group['gr_admin'] == $member['
include_once('./board_head.php');
-echo "";
+echo '';
// 게시물 아이디가 있다면 게시물 보기를 INCLUDE
if (isset($wr_id) && $wr_id) {
diff --git a/head.sub.php b/head.sub.php
index e60aa5779..975ed12bc 100644
--- a/head.sub.php
+++ b/head.sub.php
@@ -56,7 +56,11 @@ var g4_charset = "=$g4['charset']?>";
var g4_cookie_domain = "=$g4['cookie_domain']?>";
var g4_is_gecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
var g4_is_ie = navigator.userAgent.toLowerCase().indexOf("msie") != -1;
- if ($is_admin) { echo "var g4_admin = '{$g4['admin']}';"; } ?>
+
+if ($is_admin) {
+ echo PHP_EOL.'var g4_admin_url = "'.G4_ADMIN_URL.'";';
+}
+?>
diff --git a/lib/shop.lib.php b/lib/shop.lib.php
index ccc125521..e0dad79a5 100644
--- a/lib/shop.lib.php
+++ b/lib/shop.lib.php
@@ -311,79 +311,6 @@ function upload_file($srcfile, $destfile, $dir)
return true;
}
-// 유일키를 생성
-function get_unique_id($len=32)
-{
- global $g4;
-
- $result = @mysql_query(" LOCK TABLES $g4[yc4_on_uid_table] WRITE, $g4[yc4_cart_table] READ, $g4[yc4_order_table] READ ");
- if (!$result) {
- $sql = " CREATE TABLE `$g4[yc4_on_uid_table]` (
- `on_id` int(11) NOT NULL auto_increment,
- `on_uid` varchar(32) NOT NULL default '',
- `on_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
- `session_id` varchar(32) NOT NULL default '',
- PRIMARY KEY (`on_id`),
- UNIQUE KEY `on_uid` (`on_uid`) ) ";
- sql_query($sql, false);
- }
-
- // 이틀전 자료는 모두 삭제함
- $ytime = date("Y-m-d", $g4['server_time'] - 86400 * 1);
- $sql = " delete from $g4[yc4_on_uid_table] where on_datetime < '$ytime' ";
- sql_query($sql);
-
- $unique = false;
-
- do {
- sql_query(" INSERT INTO $g4[yc4_on_uid_table] set on_uid = NOW(), on_datetime = NOW(), session_id = '".session_id()."' ", false);
- $id = @mysql_insert_id();
- $uid = md5($id);
- sql_query(" UPDATE $g4[yc4_on_uid_table] set on_uid = '$uid' where on_id = '$id' ");
-
- // 장바구니에도 겹치는게 있을 수 있으므로 ...
- $sql = "select COUNT(*) as cnt from $g4[yc4_cart_table] where on_uid = '$uid' ";
- $row = sql_fetch($sql);
- if (!$row[cnt]) {
- // 주문서에도 겹치는게 있을 수 있으므로 ...
- $sql = "select COUNT(*) as cnt from $g4[yc4_order_table] where on_uid = '$uid' ";
- $row = sql_fetch($sql);
- if (!$row[cnt])
- $unique = true;
- }
- } while (!$unique); // $unique 가 거짓인동안 실행
-
- @mysql_query(" UNLOCK TABLES ");
-
- return $uid;
-}
-
-// 주문서 번호를 얻는다.
-function get_new_od_id()
-{
- global $g4;
-
- // 주문서 테이블 Lock 걸고
- sql_query(" LOCK TABLES $g4[yc4_order_table] READ, $g4[yc4_order_table] WRITE ", FALSE);
- // 주문서 번호를 만든다.
- $date = date("ymd", time()); // 2002년 3월 7일 일경우 020307
- $sql = " select max(od_id) as max_od_id from $g4[yc4_order_table] where SUBSTRING(od_id, 1, 6) = '$date' ";
- $row = sql_fetch($sql);
- $od_id = $row[max_od_id];
- if ($od_id == 0)
- $od_id = 1;
- else
- {
- $od_id = (int)substr($od_id, -4);
- $od_id++;
- }
- $od_id = $date . substr("0000" . $od_id, -4);
- // 주문서 테이블 Lock 풀고
- sql_query(" UNLOCK TABLES ", FALSE);
-
- return $od_id;
-}
-
function message($subject, $content, $align="left", $width="450")
{
$str = "
@@ -810,16 +737,16 @@ function it_name_icon($it, $it_name="", $url=1)
if ($url)
$str = "$str";
- if ($it[it_type1]) $str .= " ";
- if ($it[it_type2]) $str .= " ";
- if ($it[it_type3]) $str .= " ";
- if ($it[it_type4]) $str .= " ";
- if ($it[it_type5]) $str .= " ";
+ if ($it[it_type1]) $str .= " ";
+ if ($it[it_type2]) $str .= " ";
+ if ($it[it_type3]) $str .= " ";
+ if ($it[it_type4]) $str .= " ";
+ if ($it[it_type5]) $str .= " ";
// 품절
$stock = get_it_stock_qty($it[it_id]);
if ($stock <= 0)
- $str .= " ";
+ $str .= " ";
return $str;
}
diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php
index 4da500bac..fe59bc0f2 100644
--- a/lib/thumbnail.lib.php
+++ b/lib/thumbnail.lib.php
@@ -26,7 +26,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$source_time = @filemtime($source_file);
if (file_exists($thumb_file)) {
if ($is_create == false && $source_time < $thumb_time) {
- return str_replace($target_path.'/', '', $thumb_file);
+ return basename($thumb_file);
}
}
@@ -42,7 +42,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
imagepng($target, $thumb_file, 0);
@chmod($thumb_file, 0606); // 추후 삭제를 위하여 파일모드 변경
}
- return str_replace($target_path.'/', '', $thumb_file);
+ return basename($thumb_file);
}
$is_imagecopyresampled = false;
@@ -65,7 +65,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
$bgcolor = imagecolorallocate($dst, 250, 250, 250); // 배경색 여기야!!!
imagefill($dst, 0, 0, $bgcolor);
- imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $tmp_height, $size[0], $size[1]);
+ imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]);
} else {
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]);
diff --git a/shop/list.php b/shop/list.php
index 4caf2b407..a6125264b 100644
--- a/shop/list.php
+++ b/shop/list.php
@@ -1,5 +1,6 @@
include_once("./_common.php");
+include_once(G4_LIB_PATH.'/thumbnail.lib.php');
$sql = " select *
from $g4[yc4_category_table]
diff --git a/shop/list.skin.10.php b/shop/list.skin.10.php
index c71cff164..7f6f2dbb3 100644
--- a/shop/list.skin.10.php
+++ b/shop/list.skin.10.php
@@ -14,11 +14,22 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
echo "\n";
}
+ // 리스트 썸네일 이미지
+ $filepath = G4_DATA_PATH.'/item/'.$row['it_id'];
+ for($k=1; $k<=10; $k++) {
+ $idx = 'it_img'.$k;
+ if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) {
+ $filename = $row[$idx];
+ break;
+ }
+ }
+ $it_img = it_img_thumb($filename, G4_DATA_PATH.'/item/'.$row['it_id'], $img_width, $img_height);
+
echo "
- | ".get_it_image($row[it_id]."_s", $img_width , $img_height, $row[it_id])." |
+ | ".get_it_image($row['it_id'].'/'.$it_img, $img_width , $img_height, $row[it_id])." |
| ".it_name_icon($row)." | ";
if ($row[it_cust_amount] && !$row[it_gallery])
| |