function set_flash_data($tplname, &$msg) { $flashdata = get_flash_xml(); if (empty($flashdata)) { $flashdata[] = array('src' => 'data/images/ecshop_slagon.jpg', 'text' => 'ECShop', 'url' => 'http://www.ecshop.com'); } switch ($tplname) { case 'uproll': $msg = set_flash_uproll($tplname, $flashdata); break; case 'redfocus': case 'pinkfocus': case 'dynfocus': $msg = set_flash_focus($tplname, $flashdata); break; case 'default': default: $msg = set_flash_default($tplname, $flashdata); break; } return $msg !== true; }
function set_flash_data($tplname, &$msg) { $flashdata = get_flash_xml(); if (empty($flashdata)) { $flashdata[] = array('src' => '/data/afficheimg/20081027angsif.jpg', 'text' => 'ECShop', 'url' => 'http://www.ecshop.com'); $flashdata[] = array('src' => '/data/afficheimg/20081027wdwd.jpg', 'text' => 'wdwd', 'url' => 'http://www.wdwd.com'); $flashdata[] = array('src' => '/data/afficheimg/20081027xuorxj.jpg', 'text' => 'ECShop', 'url' => 'http://help.ecshop.com/index.php?doc-view-108.htm'); } switch ($tplname) { case 'uproll': $msg = set_flash_uproll($tplname, $flashdata); break; case 'redfocus': case 'pinkfocus': case 'dynfocus': $msg = set_flash_focus($tplname, $flashdata); break; case 'default': default: //$msg = set_flash_default($tplname, $flashdata); $msg = create_flash_dir($tplname, $flashdata); break; } return $msg !== true; }
/* 首页主广告设置 */ $smarty->assign('index_ad', $_CFG['index_ad']); if ($_CFG['index_ad'] == 'cus') { $sql = 'SELECT ad_type, content, url FROM ' . $ecs->table("ad_custom") . ' WHERE ad_status = 1'; $ad = $db->getRow($sql, true); $smarty->assign('ad', $ad); } /* links */ $links = index_get_links(); $smarty->assign('img_links', $links['img']); $smarty->assign('txt_links', $links['txt']); $smarty->assign('data_dir', DATA_DIR); // 数据目录 /*jdy add 0816 添加首页幻灯插件*/ $smarty->assign("flash", get_flash_xml()); $smarty->assign('flash_count', count(get_flash_xml())); /* 首页推荐分类 */ $cat_recommend_res = $db->getAll("SELECT c.cat_id, c.cat_name, cr.recommend_type FROM " . $ecs->table("cat_recommend") . " AS cr INNER JOIN " . $ecs->table("category") . " AS c ON cr.cat_id=c.cat_id"); if (!empty($cat_recommend_res)) { $cat_rec_array = array(); foreach ($cat_recommend_res as $cat_recommend_data) { $cat_rec[$cat_recommend_data['recommend_type']][] = array('cat_id' => $cat_recommend_data['cat_id'], 'cat_name' => $cat_recommend_data['cat_name']); } $smarty->assign('cat_rec', $cat_rec); } /* 页面中的动态内容 */ assign_dynamic($tpl); } $smarty->display($tpl . '.dwt', $cache_id); /*------------------------------------------------------ */ //-- PRIVATE FUNCTIONS
echo $this->_foreach['get_flash_xml']['iteration']; ?> "><a href="<?php echo $this->_var['playerdb']['url']; ?> " target="_blank"></a></div> <?php } } unset($_from); $this->pop_vars(); ?> <ul style="width: 80px; right: 50%; margin-right: -465px;"> <?php $_from = get_flash_xml(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $this->push_vars('', 'playerdb'); $this->_foreach['get_flash_xml'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['get_flash_xml']['total'] > 0) { foreach ($_from as $this->_var['playerdb']) { $this->_foreach['get_flash_xml']['iteration']++; ?> <li class="<?php if ($this->_foreach['get_flash_xml']['iteration'] == 1) { ?> on<?php } ?>
function set_flash_data($tplname, &$msg) { $flashdata = get_flash_xml(); if (empty($flashdata)) { $flashdata[] = array('src' => 'data/afficheimg/20081027angsif.jpg', 'text' => 'ECShop', 'url' => 'http://www.ecshop.com'); $flashdata[] = array('src' => 'data/afficheimg/20081027xuorxj.jpg', 'text' => 'maifou', 'url' => 'http://www.maifou.net'); $flashdata[] = array('src' => 'data/afficheimg/20081027wdwd.jpg', 'text' => 'ECShop', 'url' => 'http://www.wdwd.com'); } switch ($tplname) { case 'uproll': $msg = set_flash_uproll($tplname, $flashdata); break; case 'redfocus': case 'pinkfocus': case 'dynfocus': $msg = set_flash_focus($tplname, $flashdata); break; case 'default': default: $msg = set_flash_default($tplname, $flashdata); break; } return $msg !== true; }
$flashdb_sort[$key] = $value['sort']; } asort($flashdb_sort, SORT_NUMERIC); foreach ($flashdb_sort as $key => $value) { $_flashdb[] = $flashdb[$key]; } unset($flashdb, $flashdb_sort); put_flash_xml($_flashdb); $links[] = array('text' => $_LANG['go_url'], 'href' => 'appimg.php?act=list'); sys_msg($_LANG['edit_ok'], 0, $links); } } elseif ($_REQUEST['act'] == 'edit') { //admin_priv('flash_manage'); $id = (int) $_REQUEST['id']; //取得id $flashdb = get_flash_xml(); //取得数据 if (isset($flashdb[$id])) { $rt = $flashdb[$id]; } else { $links[] = array('text' => $_LANG['go_url'], 'href' => 'appimg.php?act=list'); sys_msg($_LANG['id_error'], 0, $links); } if (empty($_POST['step'])) { $rt['act'] = 'edit'; $rt['goods_id'] = $rt['goods_id']; $rt['img_src'] = $rt['src']; $rt['img_txt'] = $rt['text']; $rt['sdate'] = $rt['sdate']; $rt['edate'] = $rt['edate']; $rt['img_sort'] = empty($rt['sort']) ? 0 : $rt['sort'];
if (file_exists(ROOT_PATH . DATA_DIR . '/flash_data.xml')) { // 兼容v2.7.0及以前版本 if (!preg_match_all('/item_url="([^"]+)"\\slink="([^"]+)"\\stext="([^"]*)"\\ssort="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER)) { preg_match_all('/item_url="([^"]+)"\\slink="([^"]+)"\\stext="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER); } if (!empty($t)) { foreach ($t as $key => $val) { $val[4] = isset($val[4]) ? $val[4] : 0; $val[2] = substr($val[2], 0, 4) == 'http' ? $val[2] : dirname($GLOBALS['ecs']->url()) . '/' . $val[2]; $flashdb[] = array('photo' => array('small' => API_DATA('PHOTO', $val[1]), 'thumb' => API_DATA('PHOTO', $val[1]), 'url' => API_DATA('PHOTO', $val[1])), 'url' => $val[2], 'description' => $val[3]); } } } return $flashdb; } $flash_arr['player'] = get_flash_xml(); // url解析 function api_get_url($url) { $out = array('action' => '', 'action_id' => 0); $site_url = dirname($GLOBALS['ecs']->url()); if (strpos($url, $site_url) === false) { return $out; } if (strpos($url, '/goods.php') !== false) { $action = 'goods'; $act_arr = explode('/goods.php', $url); if (strpos($act_arr[1], '?id=') !== false) { $action_id = ltrim($act_arr[1], '?id='); } } else {
function filtration_xml() { $xml = get_flash_xml(); $agency_id = agency_id(); $playerdb = array(); foreach ($xml as $key => $val) { if ($agency_id == $val['agency']) { if (strpos($val['src'], 'http') === false) { $playerdb[$key]['src'] = img_url() . $val['src']; $playerdb[$key]['url'] = preg_match('|http:|', $val['url']) ? $val['url'] : $uri . $val['url']; } } } $ad = array(); if (!empty($playerdb)) { $i = 1; foreach ($playerdb as $key => $value) { if ($i <= 5) { $value['src'] = $value['src']; $ad[] = $value; } $i++; } } else { $ad[0]['src'] = img_url() . 'data/afficheimg/ad.jpg'; $ad[0]['url'] = 'http://'; } return $ad; }
}*/ /* 缓存编号 */ $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('categories', get_categories_tree()); // 分类树 /* meta information */ $smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords'])); $smarty->assign('description', htmlspecialchars($_CFG['shop_desc'])); $smarty->assign('playerdb', get_flash_xml()); $smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告 $cate_index = get_cate_index_tree(); foreach ($cate_index as $k => $v) { $arr = get_cat_id_goods_list($v['id'], $_CFG['limit_index_goods_num']); if (empty($arr)) { unset($cate_index[$k]); } else { $cate_index[$k]['cat_goods'] = $arr; } } $smarty->assign('cate_index', $cate_index); /* 页面中的动态内容 assign_dynamic('index'); */
$smarty->assign('comment_rand', $avg_comment); $smarty->assign('server', $avg_server); $smarty->assign('pingfen', round(($avg_comment + $avg_server + $avg_shipping) / 3, 0)); $smarty->assign('shipping', $avg_shipping); $smarty->assign('suppinfo', $suppinfo); /* 首页推荐分类 */ $cat_recommend_res = $db->getAll("SELECT c.cat_id, c.cat_name, cr.recommend_type FROM " . $ecs->table("cat_recommend") . " AS cr INNER JOIN " . $ecs->table("category") . " AS c ON cr.cat_id=c.cat_id"); if (!empty($cat_recommend_res)) { $cat_rec_array = array(); foreach ($cat_recommend_res as $cat_recommend_data) { $cat_rec[$cat_recommend_data['recommend_type']][] = array('cat_id' => $cat_recommend_data['cat_id'], 'cat_name' => $cat_recommend_data['cat_name']); } $smarty->assign('cat_rec', $cat_rec); } // 获取轮播图 $playerdb = get_flash_xml(); $smarty->assign('playerdb', $playerdb); /* 页面中的动态内容 */ assign_dynamic('mall'); } $smarty->display('mall.dwt', $cache_id); /*------------------------------------------------------ */ //-- PRIVATE FUNCTIONS /*------------------------------------------------------ */ /** * 获得最新的文章列表。 * * @access private * @return array */ function index_get_new_articles()