大商创商城php7.3,index.php

//源码由旺旺:ecshop2012所有 未经允许禁止倒卖 一经发现停止任何服务

define('IN_ECS', true);

require dirname(__FILE__) . '/includes/init.php';

if (isset($_GET['code']) && !empty($_GET['code'])) {

$oath_where = '';

if (isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) {

$oath_where .= '&user_id=' . $_SESSION['user_id'];

$oath_where .= '&jump=account_bind';

}

$redirect_url = $ecs->url() . 'user.php?act=oath_login&type=qq&code=' . $_GET['code'] . $oath_where;

header('location:' . $redirect_url);

exit();

}

if ((DEBUG_MODE & 2) != 2) {

$smarty->caching = true;

}

require ROOT_PATH . '/includes/lib_area.php';

require ROOT_PATH . '/includes/lib_visual.php';

$area_info = get_area_info($province_id);

$area_id = $area_info['region_id'];

$where = 'regionId = \'' . $province_id . '\'';

$date = array('parent_id');

$region_id = get_table_date('region_warehouse', $where, $date, 2);

$ua = strtolower($_SERVER['HTTP_USER_AGENT']);

$uachar = '/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i';

if ((($ua == '') || preg_match($uachar, $ua)) && !strpos(strtolower($_SERVER['REQUEST_URI']), 'wap')) {

$Loaction = 'mobile/';

if (!empty($Loaction)) {

ecs_header('Location: ' . $Loaction . "\n");

exit();

}

}

if (!empty($_GET['gOo'])) {

if (!empty($_GET['gcat'])) {

$Loaction = 'category.php?id=' . $_GET['gcat'];

}

else if (!empty($_GET['acat'])) {

$Loaction = 'article_cat.php?id=' . $_GET['acat'];

}

else if (!empty($_GET['goodsid'])) {

$Loaction = 'goods.php?id=' . $_GET['goodsid'];

}

else if (!empty($_GET['articleid'])) {

$Loaction = 'article.php?id=' . $_GET['articleid'];

}

if (!empty($Loaction)) {

ecs_header('Location: ' . $Loaction . "\n");

exit();

}

}

$suffix = (!empty($_REQUEST['suffix']) ? trim($_REQUEST['suffix']) : '');

$preview = 1;

if (empty($suffix) && ($_CFG['openvisual'] == 1)) {

$enableTem = $db->getOne('SELECT value FROM' . $GLOBALS['ecs']->table('shop_config') . ' WHERE code= \'hometheme\' AND store_range = \'' . $GLOBALS['_CFG']['template'] . '\'');

$suffix = (!empty($enableTem) ? trim($enableTem) : '');

$preview = 0;

}

$dir = ROOT_PATH . 'data/home_Templates/' . $GLOBALS['_CFG']['template'] . '/' . $suffix;

if ($preview == 1) {

$dir_temp = ROOT_PATH . 'data/home_Templates/' . $GLOBALS['_CFG']['template'] . '/' . $suffix . '/temp';

if (is_dir($dir_temp)) {

$dir = $dir_temp;

}

}

$smarty->assign('cfg_bonus_adv', $_CFG['bonus_adv']);

if (!empty($suffix) && file_exists($dir) && defined('THEME_EXTENSION')) {

if (!file_exists(ROOT_PATH . 'data/sc_file/hometemplates/' . $suffix . '.php')) {

if ($GLOBALS['_CFG']['open_oss'] && $GLOBALS['_CFG']['server_model']) {

$oss_list = get_oss_list_file(array('prefix' => 'data/home_Templates/' . $GLOBALS['_CFG']['template'] . '/' . $suffix . '/'));

$oss_list = json_decode($oss_list, true);

get_down_oss_template($oss_list['list']);

$oss_bonusadv_list = get_oss_list_file(array('prefix' => 'data/home_Templates/' . $GLOBALS['_CFG']['template'] . '/' . $suffix . '/images/bonusadv/'));

$oss_bonusadv_list = json_decode($oss_bonusadv_list, true);

get_down_oss_template($oss_bonusadv_list['list']);

$oss_content_list = get_oss_list_file(array('prefix' => 'data/home_Templates/' . $GLOBALS['_CFG']['template'] . '/' . $suffix . '/images/content/'));

$oss_content_list = json_decode($oss_bonusadv_list, true);

get_down_oss_template($oss_content_list['list']);

write_static_cache($suffix, array(1), 'data/sc_file/hometemplates/');

}

}

require ROOT_PATH . 'homeindex.php';

exit();

}

else {

$cache_id = sprintf('%X', crc32($_SESSION['user_rank'] . '-' . $_CFG['lang']));

if (!$smarty->is_cached('index.dwt', $cache_id)) {

assign_template();

$position = assign_ur_here();

$smarty->assign('page_title', $position['title']);

$smarty->assign('ur_here', $position['ur_here']);

$smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));

$smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));

$smarty->assign('flash_theme', $_CFG['flash_theme']);

$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? 'feed.xml' : 'feed.php');

for ($i = 1; $i <= $_CFG['auction_ad']; $i++) {

$ad_arr .= '\'c' . $i . ',';

$index_ad .= '\'index_ad' . $i . ',';

$cat_goods_banner .= '\'cat_goods_banner' . $i . ',';

$cat_goods_hot .= '\'cat_goods_hot' . $i . ',';

$index_brand_banner .= '\'index_brand_banner' . $i . ',';

$index_brand_street .= '\'index_brand_street' . $i . ',';

$index_group_banner .= '\'index_group_banner' . $i . ',';

$index_banner_group .= '\'index_banner_group' . $i . ',';

if (defined('THEME_EXTENSION')) {

$recommend_category .= '\'recommend_category' . $i . ',';

$index_expert_field .= '\'expert_field_ad' . $i . ',';

$recommend_merchants .= '\'recommend_merchants' . $i . ',';

}

}

$smarty->assign('adarr', $ad_arr);

$smarty->assign('index_ad', $index_ad);

if (defined('THEME_EXTENSION')) {

$smarty->assign('rec_cat', $recommend_category);

$smarty->assign('expert_field', $index_expert_field);

$smarty->assign('recommend_merchants', $recommend_merchants);

}

$smarty->assign('cat_goods_banner', $cat_goods_banner);

$smarty->assign('cat_goods_hot', $cat_goods_hot);

$smarty->assign('index_brand_banner', $index_brand_banner);

$smarty->assign('index_brand_street', $index_brand_street);

$smarty->assign('index_group_banner', $index_group_banner);

$smarty->assign('index_banner_group', $index_banner_group);

$smarty->assign('top_banner', 'top_banner');

$smarty->assign('warehouse_id', $region_id);

$smarty->assign('area_id', $area_id);

$smarty->assign('helps', get_shop_help());

if (!defined('THEME_EXTENSION')) {

$categories_pro = get_category_tree_leve_one();

$smarty->assign('categories_pro', $categories_pro);

}

if (defined('THEME_EXTENSION')) {

for ($i = 1; $i <= $_CFG['auction_ad']; $i++) {

$bonushome .= '\'bonushome' . $i . ',';

}

$smarty->assign('bonushome', $bonushome);

$guess_num = 10;

$smarty->assign('floor_data', get_floor_data('index'));

}

else {

$guess_num = 9;

$smarty->assign('guess_store', get_guess_store($_SESSION['user_id'], 2));

$smarty->assign('new_goods', get_recommend_goods('new', '', $region_id, $area_id));

$smarty->assign('best_goods', get_recommend_goods('best', '', $region_id, $area_id));

$smarty->assign('hot_goods', get_recommend_goods('hot', '', $region_id, $area_id));

$smarty->assign('promotion_goods', get_promote_goods('', $region_id, $area_id));

}

$smarty->assign('guess_goods', get_guess_goods($_SESSION['user_id'], 1, 1, $guess_num, $region_id, $area_id));

$smarty->assign('data_dir', DATA_DIR);

assign_dynamic('index', $region_id, $area_id);

}

$smarty->display('index.dwt', $cache_id);

function index_get_invoice_query()

{

$sql = 'SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' . ' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' . ' WHERE invoice_no > \'\' AND shipping_status = ' . SS_SHIPPED . ' ORDER BY shipping_time DESC LIMIT 10';

$all = $GLOBALS['db']->getAll($sql);

foreach ($all as $key => $row) {

$plugin = ROOT_PATH . 'includes/modules/shipping/' . $row['shipping_code'] . '.php';

if (file_exists($plugin)) {

include_once $plugin;

$shipping = new $row['shipping_code']();

$all[$key]['invoice_no'] = $shipping->query((string) $row['invoice_no']);

}

}

clearstatcache();

return $all;

}

function index_get_new_articles()

{

$sql = 'SELECT a.article_id, a.title, ac.cat_name, a.add_time, a.file_url, a.open_type, ac.cat_id, ac.cat_name ' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac' . ' WHERE a.is_open = 1 AND a.cat_id = ac.cat_id AND ac.cat_type = 1' . ' ORDER BY a.article_type DESC, a.add_time DESC LIMIT ' . $GLOBALS['_CFG']['article_number'];

$res = $GLOBALS['db']->getAll($sql);

$arr = array();

foreach ($res as $idx => $row) {

$arr[$idx]['id'] = $row['article_id'];

$arr[$idx]['title'] = $row['title'];

$arr[$idx]['short_title'] = 0 < $GLOBALS['_CFG']['article_title_length'] ? sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title'];

$arr[$idx]['cat_name'] = $row['cat_name'];

$arr[$idx]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']);

$arr[$idx]['url'] = $row['open_type'] != 1 ? build_uri('article', array('aid' => $row['article_id']), $row['title']) : trim($row['file_url']);

$arr[$idx]['cat_url'] = build_uri('article_cat', array('acid' => $row['cat_id']), $row['cat_name']);

}

return $arr;

}

function index_get_group_buy()

{

$time = gmtime();

$limit = get_library_number('group_buy', 'index');

$group_buy_list = array();

if (0 < $limit) {

$sql = 'SELECT gb.act_id AS group_buy_id, gb.goods_id, gb.ext_info, gb.goods_name, gb.start_time, gb.end_time, g.goods_thumb, g.goods_img, g.market_price ' . 'FROM ' . $GLOBALS['ecs']->table('goods_activity') . ' AS gb, ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . 'WHERE gb.act_type = \'' . GAT_GROUP_BUY . '\' ' . 'AND g.goods_id = gb.goods_id AND gb.review_status = 3 ' . 'AND gb.start_time <= \'' . $time . '\' ' . 'AND gb.end_time >= \'' . $time . '\' ' . 'AND g.is_delete = 0 ' . 'ORDER BY gb.act_id DESC ' . 'LIMIT ' . $limit;

$res = $GLOBALS['db']->query($sql);

while ($row = $GLOBALS['db']->fetchRow($res)) {

$row['goods_img'] = get_image_path($row['goods_id'], $row['goods_img']);

$row['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);

$ext_info = unserialize($row['ext_info']);

$price_ladder = $ext_info['price_ladder'];

if (!is_array($price_ladder) || empty($price_ladder)) {

$row['last_price'] = price_format(0);

}

else {

foreach ($price_ladder as $amount_price) {

$price_ladder[$amount_price['amount']] = $amount_price['price'];

}

}

ksort($price_ladderp);

$row['last_price'] = price_format(end($price_ladder));

$price = $row['market_price'];

$nowprice = $row['last_price'];

$row['jiesheng'] = $price - $nowprice;

if (0 < $nowprice) {

$row['zhekou'] = round(10 / $price / $nowprice, 1);

}

else {

$row['zhekou'] = 0;

}

$activity_row = $GLOBALS['db']->getRow($sql);

$stat = group_buy_stat($row['group_buy_id'], $ext_info['deposit']);

$row['cur_amount'] = $stat['valid_goods'];

$row['start_time'] = $row['start_time'];

$row['end_time'] = $row['end_time'];

$row['url'] = build_uri('group_buy', array('gbid' => $row['group_buy_id']));

$row['short_name'] = 0 < $GLOBALS['_CFG']['goods_name_length'] ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name'];

$row['short_style_name'] = add_style($row['short_name'], '');

$group_buy_list[] = $row;

}

}

return $group_buy_list;

}

function index_get_auction()

{

$now = gmtime();

$limit = get_library_number('auction', 'index');

$sql = 'SELECT a.act_id, a.goods_id, a.goods_name, a.ext_info, g.goods_thumb ' . 'FROM ' . $GLOBALS['ecs']->table('goods_activity') . ' AS a,' . $GLOBALS['ecs']->table('goods') . ' AS g' . ' WHERE a.goods_id = g.goods_id AND a.review_status = 3' . ' AND a.act_type = \'' . GAT_AUCTION . '\'' . ' AND a.is_finished = 0' . ' AND a.start_time <= \'' . $now . '\'' . ' AND a.end_time >= \'' . $now . '\'' . ' AND g.is_delete = 0' . ' ORDER BY a.start_time DESC' . ' LIMIT ' . $limit;

$res = $GLOBALS['db']->query($sql);

$list = array();

while ($row = $GLOBALS['db']->fetchRow($res)) {

$ext_info = unserialize($row['ext_info']);

$arr = array_merge($row, $ext_info);

$arr['formated_start_price'] = price_format($arr['start_price']);

$arr['formated_end_price'] = price_format($arr['end_price']);

$arr['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);

$arr['url'] = build_uri('auction', array('auid' => $arr['act_id']));

$arr['short_name'] = 0 < $GLOBALS['_CFG']['goods_name_length'] ? sub_str($arr['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $arr['goods_name'];

$arr['short_style_name'] = add_style($arr['short_name'], '');

$list[] = $arr;

}

return $list;

}

}

?>

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以按照以下步骤在 Cygwin 上安装 PHP 7.3.13: 1. 打开 Cygwin 终端,使用以下命令安装必要的软件包: ``` apt-cyg install make automake gcc-g++ libtool libxml2-devel libsqlite3-devel ``` 2. 下载 PHP 7.3.13 的源代码包,可以从官方网站下载或者使用以下命令从终端下载: ``` wget https://www.php.net/distributions/php-7.3.13.tar.gz ``` 3. 解压源代码包,并进入解压后的目录: ``` tar -zxvf php-7.3.13.tar.gz cd php-7.3.13 ``` 4. 配置 PHP 编译选项: ``` ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --enable-mbstring --with-zlib --with-curl --with-gd --enable-gd-native-ttf --with-jpeg-dir --with-png-dir --with-freetype-dir --with-xmlrpc --enable-soap --enable-sockets --enable-exif --enable-zip ``` 这里的选项根据实际情况进行修改,比如 `/usr/local/apache2/bin/apxs` 是 Apache 的路径,如果没有安装 Apache,可以去掉 `--with-apxs2`,`--with-mysqli` 和 `--with-pdo-mysql` 后面的值是 MySQL 的路径,如果没有安装 MySQL,可以去掉这两个选项。 5. 编译并安装 PHP: ``` make make install ``` 6. 配置 PHP: 在 `/usr/local/php/` 目录下建一个 `php.ini` 文件,可以先复制一份样例文件: ``` cp php.ini-development /usr/local/php/php.ini ``` 然后可以根据需要修改 `php.ini` 文件中的选项。 7. 测试 PHP: 在终端输入以下命令: ``` /usr/local/php/bin/php -v ``` 如果输出 PHP 版本信息,则说明 PHP 已经安装成功。 注意:上述步骤只是安装 PHP,如果还需要使用 PHP 要结合 Web 服务器(如 Apache)一起使用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值