-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
409 changed files
with
83,692 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<?php | ||
|
||
/** | ||
* ECSHOP 活动列表 | ||
* ============================================================================ | ||
* 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 | ||
* 网站地址: http://www.ecshop.com; | ||
* ---------------------------------------------------------------------------- | ||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 | ||
* 使用;不允许对程序代码以任何形式任何目的的再发布。 | ||
* ============================================================================ | ||
* $Author: liuhui $ | ||
* $Id: activity.php 17063 2010-03-25 06:35:46Z liuhui $ | ||
*/ | ||
|
||
define('IN_ECS', true); | ||
|
||
require(dirname(__FILE__) . '/includes/init.php'); | ||
require_once(ROOT_PATH . 'includes/lib_order.php'); | ||
include_once(ROOT_PATH . 'includes/lib_transaction.php'); | ||
|
||
/* 载入语言文件 */ | ||
require_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/shopping_flow.php'); | ||
require_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/user.php'); | ||
|
||
/*------------------------------------------------------ */ | ||
//-- PROCESSOR | ||
/*------------------------------------------------------ */ | ||
|
||
assign_template(); | ||
assign_dynamic('activity'); | ||
$position = assign_ur_here(0, $_LANG['shopping_activity']); | ||
$smarty->assign('page_title', $position['title']); // 页面标题 | ||
$smarty->assign('ur_here', $position['ur_here']); // 当前位置 | ||
$smarty->assign('categories', get_categories_tree()); // 分类树 | ||
|
||
// 数据准备 | ||
|
||
/* 取得用户等级 */ | ||
$user_rank_list = array(); | ||
$user_rank_list[0] = $_LANG['not_user']; | ||
$sql = "SELECT rank_id, rank_name FROM " . $ecs->table('user_rank'); | ||
$res = $db->query($sql); | ||
while ($row = $db->fetchRow($res)) | ||
{ | ||
$user_rank_list[$row['rank_id']] = $row['rank_name']; | ||
} | ||
|
||
|
||
// 开始工作 | ||
|
||
$sql = "SELECT * FROM " . $ecs->table('favourable_activity'). " ORDER BY `sort_order` ASC,`end_time` DESC"; | ||
$res = $db->query($sql); | ||
|
||
$list = array(); | ||
while ($row = $db->fetchRow($res)) | ||
{ | ||
$row['start_time'] = local_date('Y-m-d H:i', $row['start_time']); | ||
$row['end_time'] = local_date('Y-m-d H:i', $row['end_time']); | ||
|
||
//享受优惠会员等级 | ||
$user_rank = explode(',', $row['user_rank']); | ||
$row['user_rank'] = array(); | ||
foreach($user_rank as $val) | ||
{ | ||
if (isset($user_rank_list[$val])) | ||
{ | ||
$row['user_rank'][] = $user_rank_list[$val]; | ||
} | ||
} | ||
|
||
//优惠范围类型、内容 | ||
if ($row['act_range'] != FAR_ALL && !empty($row['act_range_ext'])) | ||
{ | ||
if ($row['act_range'] == FAR_CATEGORY) | ||
{ | ||
$row['act_range'] = $_LANG['far_category']; | ||
$row['program'] = 'category.php?id='; | ||
$sql = "SELECT cat_id AS id, cat_name AS name FROM " . $ecs->table('category') . | ||
" WHERE cat_id " . db_create_in($row['act_range_ext']); | ||
} | ||
elseif ($row['act_range'] == FAR_BRAND) | ||
{ | ||
$row['act_range'] = $_LANG['far_brand']; | ||
$row['program'] = 'brand.php?id='; | ||
$sql = "SELECT brand_id AS id, brand_name AS name FROM " . $ecs->table('brand') . | ||
" WHERE brand_id " . db_create_in($row['act_range_ext']); | ||
} | ||
else | ||
{ | ||
$row['act_range'] = $_LANG['far_goods']; | ||
$row['program'] = 'goods.php?id='; | ||
$sql = "SELECT goods_id AS id, goods_name AS name FROM " . $ecs->table('goods') . | ||
" WHERE goods_id " . db_create_in($row['act_range_ext']); | ||
} | ||
$act_range_ext = $db->getAll($sql); | ||
$row['act_range_ext'] = $act_range_ext; | ||
} | ||
else | ||
{ | ||
$row['act_range'] = $_LANG['far_all']; | ||
} | ||
|
||
//优惠方式 | ||
|
||
switch($row['act_type']) | ||
{ | ||
case 0: | ||
$row['act_type'] = $_LANG['fat_goods']; | ||
$row['gift'] = unserialize($row['gift']); | ||
if(is_array($row['gift'])) | ||
{ | ||
foreach($row['gift'] as $k=>$v) | ||
{ | ||
$row['gift'][$k]['thumb'] = get_image_path($v['id'], $db->getOne("SELECT goods_thumb FROM " . $ecs->table('goods') . " WHERE goods_id = '" . $v['id'] . "'"), true); | ||
} | ||
} | ||
break; | ||
case 1: | ||
$row['act_type'] = $_LANG['fat_price']; | ||
$row['act_type_ext'] .= $_LANG['unit_yuan']; | ||
$row['gift'] = array(); | ||
break; | ||
case 2: | ||
$row['act_type'] = $_LANG['fat_discount']; | ||
$row['act_type_ext'] .= "%"; | ||
$row['gift'] = array(); | ||
break; | ||
} | ||
|
||
$list[] = $row; | ||
} | ||
|
||
//print_r($list); | ||
$smarty->assign('list', $list); | ||
|
||
$smarty->assign('helps', get_shop_help()); // 网店帮助 | ||
$smarty->assign('lang', $_LANG); | ||
|
||
$smarty->assign('feed_url', ($_CFG['rewrite'] == 1) ? "feed-typeactivity.xml" : 'feed.php?type=activity'); // RSS URL | ||
$smarty->display('activity.dwt'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<?php | ||
|
||
/** | ||
* ECSHOP 广告处理文件 | ||
* ============================================================================ | ||
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。 | ||
* 网站地址: http://www.ecshop.com; | ||
* ---------------------------------------------------------------------------- | ||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 | ||
* 使用;不允许对程序代码以任何形式任何目的的再发布。 | ||
* ============================================================================ | ||
* $Author: liubo $ | ||
* $Id: affiche.php 17217 2011-01-19 06:29:08Z liubo $ | ||
*/ | ||
|
||
define('IN_ECS', true); | ||
define('INIT_NO_SMARTY', true); | ||
require(dirname(__FILE__) . '/includes/init.php'); | ||
|
||
/* 没有指定广告的id及跳转地址 */ | ||
if (empty($_GET['ad_id'])) | ||
{ | ||
ecs_header("Location: index.php\n"); | ||
exit; | ||
} | ||
else | ||
{ | ||
$ad_id = intval($_GET['ad_id']); | ||
} | ||
|
||
/* act 操作项的初始化*/ | ||
$_GET['act'] = !empty($_GET['act']) ? trim($_GET['act']) : ''; | ||
|
||
if ($_GET['act'] == 'js') | ||
{ | ||
/* 编码转换 */ | ||
if (empty($_GET['charset'])) | ||
{ | ||
$_GET['charset'] = 'UTF8'; | ||
} | ||
|
||
header('Content-type: application/x-javascript; charset=' . ($_GET['charset'] == 'UTF8' ? 'utf-8' : $_GET['charset'])); | ||
|
||
$url = $ecs->url(); | ||
$str = ""; | ||
|
||
/* 取得广告的信息 */ | ||
$sql = 'SELECT ad.ad_id, ad.ad_name, ad.ad_link, ad.ad_code '. | ||
'FROM ' . $ecs->table('ad') . ' AS ad ' . | ||
'LEFT JOIN ' . $ecs->table('ad_position') . ' AS p ON ad.position_id = p.position_id '. | ||
"WHERE ad.ad_id = '$ad_id' and " . gmtime() . " >= ad.start_time and " . gmtime() . "<= ad.end_time"; | ||
|
||
$ad_info = $db->getRow($sql); | ||
|
||
if (!empty($ad_info)) | ||
{ | ||
/* 转换编码 */ | ||
if ($_GET['charset'] != 'UTF8') | ||
{ | ||
$ad_info['ad_name'] = ecs_iconv('UTF8', $_GET['charset'], $ad_info['ad_name']); | ||
$ad_info['ad_code'] = ecs_iconv('UTF8', $_GET['charset'], $ad_info['ad_code']); | ||
} | ||
|
||
/* 初始化广告的类型和来源 */ | ||
$_GET['type'] = !empty($_GET['type']) ? intval($_GET['type']) : 0; | ||
$_GET['from'] = !empty($_GET['from']) ? urlencode($_GET['from']) : ''; | ||
|
||
$str = ''; | ||
switch ($_GET['type']) | ||
{ | ||
case '0': | ||
/* 图片广告 */ | ||
$src = (strpos($ad_info['ad_code'], 'http://') === false && strpos($ad_info['ad_code'], 'https://') === false) ? $url . DATA_DIR . "/afficheimg/$ad_info[ad_code]" : $ad_info['ad_code']; | ||
$str = '<a href="' .$url. 'affiche.php?ad_id=' .$ad_info['ad_id']. '&from=' .$_GET['from']. '&uri=' .urlencode($ad_info['ad_link']). '" target="_blank">' . | ||
'<img src="' . $src . '" border="0" alt="' . $ad_info['ad_name'] . '" /></a>'; | ||
break; | ||
|
||
case '1': | ||
/* Falsh广告 */ | ||
$src = (strpos($ad_info['ad_code'], 'http://') === false && strpos($ad_info['ad_code'], 'https://') === false) ? $url . DATA_DIR . '/afficheimg/' . $ad_info['ad_code'] : $ad_info['ad_code']; | ||
$str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"> <param name="movie" value="'.$src.'"><param name="quality" value="high"><embed src="'.$src.'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>'; | ||
break; | ||
|
||
case '2': | ||
/* 代码广告 */ | ||
$str = $ad_info['ad_code']; | ||
break; | ||
|
||
case 3: | ||
/* 文字广告 */ | ||
$str = '<a href="' .$url. 'affiche.php?ad_id=' .$ad_info['ad_id']. '&from=' .$_GET['from']. '&uri=' .urlencode($ad_info['ad_link']). '" target="_blank">' . nl2br(htmlspecialchars(addslashes($ad_info['ad_code']))). '</a>'; | ||
break; | ||
} | ||
} | ||
echo "document.writeln('$str');"; | ||
} | ||
else | ||
{ | ||
/* 获取投放站点的名称 */ | ||
$site_name = !empty($_GET['from']) ? $_GET['from'] : addslashes($_LANG['self_site']); | ||
|
||
/* 商品的ID */ | ||
$goods_id = !empty($_GET['goods_id']) ? intval($_GET['goods_id']) : 0; | ||
|
||
/* 存入SESSION中,购物后一起存到订单数据表里 */ | ||
$_SESSION['from_ad'] = $ad_id; | ||
$_SESSION['referer'] = stripslashes($site_name); | ||
|
||
/* 如果是商品的站外JS */ | ||
if ($ad_id == '-1') | ||
{ | ||
$sql = "SELECT count(*) FROM " . $ecs->table('adsense') . " WHERE from_ad = '-1' AND referer = '" . $site_name . "'"; | ||
if($db->getOne($sql) > 0) | ||
{ | ||
$sql = "UPDATE " . $ecs->table('adsense') . " SET clicks = clicks + 1 WHERE from_ad = '-1' AND referer = '" . $site_name . "'"; | ||
} | ||
else | ||
{ | ||
$sql = "INSERT INTO " . $ecs->table('adsense') . "(from_ad, referer, clicks) VALUES ('-1', '" . $site_name . "', '1')"; | ||
} | ||
$db->query($sql); | ||
//$db->autoReplace($ecs->table('adsense'), array('from_ad' => -1, 'referer' => $site_name, 'clicks' => 1), array('clicks' => 1)); | ||
$sql = "SELECT goods_name FROM " .$ecs->table('goods'). " WHERE goods_id = $goods_id"; | ||
$res = $db->query($sql); | ||
|
||
$row = $db->fetchRow($res); | ||
|
||
$uri = build_uri('goods', array('gid' => $goods_id), $row['goods_name']); | ||
|
||
ecs_header("Location: $uri\n"); | ||
|
||
exit; | ||
} | ||
else | ||
{ | ||
/* 更新站内广告的点击次数 */ | ||
$db->query('UPDATE ' . $ecs->table('ad') . " SET click_count = click_count + 1 WHERE ad_id = '$ad_id'"); | ||
|
||
$sql = "SELECT count(*) FROM " . $ecs->table('adsense') . " WHERE from_ad = '" . $ad_id . "' AND referer = '" . $site_name . "'"; | ||
if($db->getOne($sql) > 0) | ||
{ | ||
$sql = "UPDATE " . $ecs->table('adsense') . " SET clicks = clicks + 1 WHERE from_ad = '" . $ad_id . "' AND referer = '" . $site_name . "'"; | ||
} | ||
else | ||
{ | ||
$sql = "INSERT INTO " . $ecs->table('adsense') . "(from_ad, referer, clicks) VALUES ('" . $ad_id . "', '" . $site_name . "', '1')"; | ||
} | ||
$db->query($sql); | ||
|
||
/* 跳转到广告的链接页面 */ | ||
if (!empty($_GET['uri'])) | ||
{ | ||
$uri = (strpos($_GET['uri'], 'http://') === false && strpos($_GET['uri'], 'https://') === false) ? $ecs->http() . urldecode($_GET['uri']) : urldecode($_GET['uri']); | ||
} | ||
else | ||
{ | ||
$uri = $ecs->url(); | ||
} | ||
|
||
ecs_header("Location: $uri\n"); | ||
exit; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
|
||
/** | ||
* ECSHOP 鐢熸垚鍟嗗搧鍒楄〃 | ||
* ============================================================================ | ||
* * 鐗堟潈鎵€鏈 2005-2012 涓婃捣鍟嗘淳缃戠粶绉戞妧鏈夐檺鍏?徃锛屽苟淇濈暀鎵€鏈夋潈鍒┿€ | ||
* 缃戠珯鍦板潃: http://www.ecshop.com锛 | ||
* ---------------------------------------------------------------------------- | ||
* 杩欎笉鏄?竴涓?嚜鐢辫蒋浠讹紒鎮ㄥ彧鑳藉湪涓嶇敤浜庡晢涓氱洰鐨勭殑鍓嶆彁涓嬪?绋嬪簭浠g爜杩涜?淇?敼鍜 | ||
* 浣跨敤锛涗笉鍏佽?瀵圭▼搴忎唬鐮佷互浠讳綍褰㈠紡浠讳綍鐩?殑鐨勫啀鍙戝竷銆 | ||
* ============================================================================ | ||
* $Author: liubo $ | ||
* $Id: affiliate.php 17217 2011-01-19 06:29:08Z liubo $ | ||
*/ | ||
|
||
define('IN_ECS', true); | ||
|
||
require(dirname(__FILE__) . '/includes/init.php'); | ||
|
||
if ((DEBUG_MODE & 2) != 2) | ||
{ | ||
$smarty->caching = true; | ||
} | ||
|
||
//$charset = empty($_GET['charset']) ? 'UTF8' : $_GET['charset']; | ||
$display_mode = empty($_GET['display_mode']) ? 'javascript' : $_GET['display_mode']; | ||
|
||
if ( $display_mode == 'javascript' ) | ||
{ | ||
$charset_array=array('UTF8','GBK','gbk','utf8','GB2312','gb2312'); | ||
if(!in_array($charset,$charset_array)) | ||
{ | ||
$charset='UTF8'; | ||
} | ||
header('content-type: application/x-javascript; charset=' . ($charset == 'UTF8' ? 'utf-8' : $charset)); | ||
} | ||
|
||
/*------------------------------------------------------ */ | ||
//-- 鍒ゆ柇鏄?惁瀛樺湪缂撳瓨锛屽?鏋滃瓨鍦ㄥ垯璋冪敤缂撳瓨锛屽弽涔嬭?鍙栫浉搴斿唴瀹 | ||
/*------------------------------------------------------ */ | ||
/* 缂撳瓨缂栧彿 */ | ||
$cache_id = sprintf('%X', crc32($_SERVER['QUERY_STRING'])); | ||
|
||
$goodsid = intval($_GET['gid']); | ||
$userid = intval($_GET['u']); | ||
$type = intval($_GET['type']); | ||
|
||
|
||
$tpl = ROOT_PATH . DATA_DIR . '/affiliate.html'; | ||
if (!$smarty->is_cached($tpl, $cache_id)) | ||
{ | ||
$time = gmtime(); | ||
/* 鏍规嵁鍙傛暟鐢熸垚鏌ヨ?璇?彞 */ | ||
|
||
$goods_url = $ecs->url() . "goods.php?u=$userid&id="; | ||
$goods = get_goods_info($goodsid); | ||
$goods['goods_thumb'] = (strpos($goods['goods_thumb'], 'http://') === false && strpos($goods['goods_thumb'], 'https://') === false) ? $ecs->url() . $goods['goods_thumb'] : $goods['goods_thumb']; | ||
$goods['goods_img'] = (strpos($goods['goods_img'], 'http://') === false && strpos($goods['goods_img'], 'https://') === false) ? $ecs->url() . $goods['goods_img'] : $goods['goods_img']; | ||
$goods['shop_price'] = price_format($goods['shop_price']); | ||
|
||
/*if ($charset != 'UTF8') | ||
{ | ||
$goods['goods_name'] = ecs_iconv('UTF8', $charset, htmlentities($goods['goods_name'], ENT_QUOTES, 'UTF-8')); | ||
$goods['shop_price'] = ecs_iconv('UTF8', $charset, $goods['shop_price']); | ||
}*/ | ||
|
||
$smarty->assign('goods', $goods); | ||
$smarty->assign('userid', $userid); | ||
$smarty->assign('type', $type); | ||
|
||
$smarty->assign('url', $ecs->url()); | ||
$smarty->assign('goods_url', $goods_url); | ||
} | ||
$output = $smarty->fetch($tpl, $cache_id); | ||
$output = str_replace("\r", '', $output); | ||
$output = str_replace("\n", '', $output); | ||
|
||
if ( $display_mode == 'javascript' ) | ||
{ | ||
echo "document.write('$output');"; | ||
} | ||
else if ( $display_mode == 'iframe' ) | ||
{ | ||
echo $output; | ||
} | ||
|
||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.