function xt_install_menu($global) { $menu_id = wp_create_nav_menu('新淘客菜单'); if ($menu_id) { //home wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'), 'menu-item-title' => '首页', 'menu-item-status' => 'publish', 'menu-item-position' => 1)); //shares wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_shares_search_url(), 'menu-item-title' => '逛街啦', 'menu-item-status' => 'publish', 'menu-item-position' => 2)); //albums wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_albums_search_url(), 'menu-item-title' => '专辑', 'menu-item-status' => 'publish', 'menu-item-position' => 3)); //taobaos wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_taobao_search_url(), 'menu-item-title' => '淘宝', 'menu-item-status' => 'publish', 'menu-item-position' => 6)); //paipais wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_paipai_search_url(), 'menu-item-title' => '拍拍', 'menu-item-status' => 'publish', 'menu-item-position' => 7)); //bijias wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_bijia_search_url(), 'menu-item-title' => '比价', 'menu-item-status' => 'publish', 'menu-item-position' => 8)); //tuans wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_tuan_search_url(), 'menu-item-title' => '团购', 'menu-item-status' => 'publish', 'menu-item-position' => 9)); //coupons wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_coupon_search_url(), 'menu-item-title' => '折扣', 'menu-item-status' => 'publish', 'menu-item-position' => 10)); //temais wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_get_temai_search_url(), 'menu-item-title' => '特卖', 'menu-item-status' => 'publish', 'menu-item-position' => 11)); //stars wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_site_url('stars'), 'menu-item-title' => '明星', 'menu-item-status' => 'publish', 'menu-item-position' => 12)); //brands wp_update_nav_menu_item($menu_id, 0, array('menu-item-type' => 'custom', 'menu-item-url' => xt_site_url('brands'), 'menu-item-title' => '品牌', 'menu-item-status' => 'publish', 'menu-item-position' => 13)); set_theme_mod('nav_menu_locations', array('primary' => $menu_id)); $global['isMenu'] = 1; update_option(XT_OPTION_GLOBAL, $global); } }
function xt_default_menu($args = array()) { ?> <ul class="nav"> <li class="menu-item"><a href="<?php echo home_url('/'); ?> ">首页</a></li> <li class="menu-item"><a href="<?php echo xt_get_shares_search_url(); ?> ">逛街啦</a></li> <li class="menu-item"><a href="<?php echo xt_get_albums_search_url(); ?> ">专辑</a></li> <li class="menu-item"><a href="<?php echo xt_get_taobao_search_url(); ?> ">淘宝</a></li> <li class="menu-item"><a href="<?php echo xt_get_tuan_search_url(); ?> ">团购</a></li> <li class="menu-item"><a href="<?php echo xt_get_bijia_search_url(); ?> ">比价</a></li> <li class="menu-item"><a href="<?php echo xt_get_paipai_search_url(); ?> ">拍拍</a></li> <li class="menu-item"><a href="<?php echo xt_get_temai_search_url(); ?> ">特卖</a></li> <li class="menu-item"><a href="<?php echo xt_get_coupon_search_url(); ?> ">折扣</a></li> <li class="menu-item"><a href="<?php echo xt_site_url('brands'); ?> ">品牌</a></li> <li class="menu-item"><a href="<?php echo xt_site_url('stars'); ?> ">明星</a></li> </ul> <?php }
function xt_design_pages() { global $xt_design_syspages; if (empty($xt_design_syspages)) { $xt_design_syspages = array('home' => array('id' => 'home', 'title' => '首页', 'preview' => home_url()), 'error404' => array('id' => 'error404', 'title' => '404错误页面', 'preview' => home_url('404')), 'shares' => array('id' => 'shares', 'title' => '分享列表页', 'preview' => xt_get_shares_search_url(), 'layouts_edit' => 0), 'share' => array('id' => 'share', 'title' => '分享详情页', 'preview' => xt_site_url('id-' . 'SHAREID')), 'albums' => array('id' => 'albums', 'title' => '专辑列表页', 'preview' => xt_get_albums_search_url(), 'layouts_edit' => 0), 'album' => array('id' => 'album', 'title' => '专辑详情页', 'preview' => xt_site_url('aid-' . 'ALBUMID'), 'layouts_edit' => 0), 'users' => array('id' => 'users', 'title' => '会员列表页', 'preview' => ''), 'user' => array('id' => 'user', 'title' => '会员详情页', 'preview' => xt_site_url('uid-USERID'), 'layouts_edit' => 0, 'widgets_edit' => 0), 'taobaos' => array('id' => 'taobaos', 'title' => '淘宝搜索页', 'preview' => xt_get_taobao_search_url(), 'layouts_edit' => 0), 'taobao' => array('id' => 'taobao', 'title' => '淘宝商品详情页', 'preview' => xt_site_url('taobao-NUMIID'), 'layouts_edit' => 0), 'shops' => array('id' => 'shops', 'title' => '淘宝店铺搜索页', 'preview' => xt_get_shop_search_url(), 'layouts_edit' => 0), 'paipais' => array('id' => 'paipais', 'title' => '拍拍搜索页', 'preview' => xt_get_paipai_search_url(), 'layouts_edit' => 0), 'bijias' => array('id' => 'bijias', 'title' => '全网搜索页', 'preview' => xt_get_bijia_search_url(), 'layouts_edit' => 0), 'tuans' => array('id' => 'tuans', 'title' => '团购搜索页', 'preview' => xt_get_tuan_search_url(), 'layouts_edit' => 0), 'temais' => array('id' => 'temais', 'title' => '淘宝特卖搜索页', 'preview' => xt_get_temai_search_url(), 'layouts_edit' => 0), 'coupons' => array('id' => 'coupons', 'title' => '淘宝折扣搜索页', 'preview' => xt_get_coupon_search_url(), 'layouts_edit' => 0), 'daogous' => array('id' => 'daogous', 'title' => '导购文章搜索页', 'preview' => xt_get_daogou_search_url(), 'layouts_edit' => 0), 'daogou' => array('id' => 'daogou', 'title' => '导购文章详情页', 'preview' => '', 'layouts_edit' => 0), 'helps' => array('id' => 'helps', 'title' => '帮助文章列表页', 'preview' => xt_get_help_search_url(), 'layouts_edit' => 0), 'help' => array('id' => 'help', 'title' => '帮助详情页', 'preview' => '', 'layouts_edit' => 0), 'brands' => array('id' => 'brands', 'title' => '天猫品牌街', 'preview' => xt_site_url('brands'), 'layouts_edit' => 0), 'stars' => array('id' => 'stars', 'title' => '明星店', 'preview' => xt_site_url('stars'), 'layouts_edit' => 0), 'activities' => array('id' => 'activities', 'title' => '特卖活动', 'preview' => xt_site_url('activities'), 'layouts_edit' => 0), 'taoquan' => array('id' => 'taoquan', 'title' => '淘宝优惠券', 'preview' => xt_site_url('taoquan'), 'layouts_edit' => 0), 'malls' => array('id' => 'malls', 'title' => '商城', 'preview' => xt_site_url('malls'), 'layouts_edit' => 0), 'invite' => array('id' => 'invite', 'title' => '邀请页', 'preview' => xt_site_url('invite-USERID'), 'layouts_edit' => 0)); } return $xt_design_syspages; }
/** * xt__breadcrumbs function. * * @access public * @return void */ function xt_breadcrumbs() { global $xt, $wp_query; $this->breadcrumbs = array(); if ($xt->is_taobaos || $xt->is_coupons) { $this->breadcrumbs[] = array('name' => '所有分类', 'url' => xt_site_url($xt->is_coupons ? 'coupon' : 'taobao')); $_param = $wp_query->query_vars['xt_param']; if (!empty($_param['cid'])) { $xt_taobao_itemcat = xt_taobao_item_cat(absint($_param['cid'])); if (!empty($xt_taobao_itemcat)) { $this->breadcrumbs[] = array('name' => htmlentities($xt_taobao_itemcat['name'], ENT_QUOTES, 'UTF-8'), 'url' => !empty($_param['keyword']) ? $xt->is_coupons ? xt_get_coupon_search_url(array('cid' => $xt_taobao_itemcat['cid'])) : xt_get_taobao_search_url(array('cid' => $xt_taobao_itemcat['cid'])) : ''); } } if (!empty($_param['keyword'])) { $_s = htmlentities(trim($_param['keyword']), ENT_QUOTES, 'UTF-8'); $this->breadcrumbs[] = array('name' => $_s, 'url' => ''); } } elseif ($xt->is_shops) { $_param = $wp_query->query_vars['xt_param']; if (!empty($_param['keyword'])) { $this->breadcrumbs[] = array('name' => '所有分类', 'url' => xt_get_shop_search_url(array('keyword' => $_param['keyword']))); } if (!empty($_param['cid'])) { $xt_taobao_shopcat = xt_taobao_shopcat(absint($_param['cid'])); if (!empty($xt_taobao_shopcat)) { $this->breadcrumbs[] = array('name' => htmlentities($xt_taobao_shopcat['name'], ENT_QUOTES, 'UTF-8'), 'url' => !empty($_param['keyword']) ? xt_get_shop_search_url(array('cid' => $xt_taobao_shopcat['cid'])) : ''); } } if (!empty($_param['keyword'])) { $_s = htmlentities(trim($_param['keyword']), ENT_QUOTES, 'UTF-8'); $this->breadcrumbs[] = array('name' => $_s, 'url' => ''); } } elseif ($xt->is_paipais) { $this->breadcrumbs[] = array('name' => '所有分类', 'url' => xt_site_url('paipai')); $_param = $wp_query->query_vars['xt_param']; if (!empty($_param['classId'])) { $xt_paipai_itemcat = xt_paipai_item_cat(absint($_param['classId'])); if (!empty($xt_paipai_itemcat)) { $this->breadcrumbs[] = array('name' => htmlentities($xt_paipai_itemcat['name'], ENT_QUOTES, 'UTF-8'), 'url' => !empty($_param['keyWord']) ? xt_get_paipai_search_url(array('classId' => $xt_paipai_itemcat['cid'])) : ''); } } if (!empty($_param['keyWord'])) { $_s = htmlentities(trim($_param['keyWord']), ENT_QUOTES, 'UTF-8'); $this->breadcrumbs[] = array('name' => $_s, 'url' => ''); } } elseif ($xt->is_bijias) { $this->breadcrumbs[] = array('name' => '所有分类', 'url' => xt_site_url('bijia')); $_param = $wp_query->query_vars['xt_param']; if (!empty($_param['category']) && $_param['category'] != -1) { $xt_bijia_itemcat = xt_bijia_item_cat(absint($_param['category'])); if (!empty($xt_bijia_itemcat)) { $this->breadcrumbs[] = array('name' => htmlentities($xt_bijia_itemcat['catName'], ENT_QUOTES, 'UTF-8'), 'url' => !empty($_param['keyword']) ? xt_get_bijia_search_url(array('category' => $xt_bijia_itemcat['catId'])) : ''); } } if (!empty($_param['keyword'])) { $_s = htmlentities(trim($_param['keyword']), ENT_QUOTES, 'UTF-8'); $this->breadcrumbs[] = array('name' => $_s, 'url' => ''); } } elseif ($xt->is_temais) { $_param = $wp_query->query_vars['xt_param']; if (!empty($_param['cat']) && $_param['cat'] != -1) { $xt_temai_itemcat = xt_temai_item_cat(absint($_param['cat'])); if (!empty($xt_temai_itemcat)) { if (!empty($xt_temai_itemcat['parent_cid'])) { $this->breadcrumbs[] = array('name' => htmlentities($xt_temai_itemcat['parent_name'], ENT_QUOTES, 'UTF-8'), 'url' => xt_get_temai_search_url(array('cat' => $xt_temai_itemcat['parent_cid']))); } $this->breadcrumbs[] = array('name' => htmlentities($xt_temai_itemcat['name'], ENT_QUOTES, 'UTF-8'), 'url' => ''); } } } $this->breadcrumbs = apply_filters('xt_breadcrumbs', $this->breadcrumbs); $this->breadcrumb_count = count($this->breadcrumbs); }
function _xt_widget_template_grid_item_temai_filter($params = array(), $pager_top = '') { global $xt_temai_itemcat; $_params = array_merge(array('sort' => 's', 'cat' => XT_TAOBAO_CAT_TEMAI), $params); $filterSortOrder = $_params['sort']; $firstCategory = $filterCategory = $_params['cat'] > 0 ? $_params['cat'] : ''; $secondCategories = array(); $thirdCategories = array(); if ($xt_temai_itemcat) { $parentCid = $xt_temai_itemcat['parent_cid']; $parent = $second = false; if (empty($parentCid)) { $secondCategories = $thirdCategories = array(); } else { if ($parentCid != XT_TAOBAO_CAT_TEMAI) { $parent = $second = xt_temai_item_cat($parentCid, true); if ($parent['parent_cid'] != XT_TAOBAO_CAT_TEMAI) { $parent = xt_temai_item_cat($parent['parent_cid'], true); } $firstCategory = $parent['cid']; } $secondCategories = $xt_temai_itemcat['cats']; if (!$secondCategories) { if ($second) { $secondCategories = $second['cats']; } } } } ?> <div class="navbar" style="margin:0px 10px 0px 10px;"> <div class="navbar-inner"> <ul class="nav"> <li <?php echo $firstCategory == 50101034 ? 'class="active"' : ''; ?> ><a href="<?php echo xt_get_temai_search_url(array('cat' => 50101034)); ?> ">服饰</a></li> <li <?php echo $firstCategory == 50101011 ? 'class="active"' : ''; ?> ><a href="<?php echo xt_get_temai_search_url(array('cat' => 50101011)); ?> ">鞋包</a></li> <li <?php echo $firstCategory == 50100986 ? 'class="active"' : ''; ?> ><a href="<?php echo xt_get_temai_search_url(array('cat' => 50100986)); ?> ">时尚</a></li> <li <?php echo $firstCategory == 50101089 ? 'class="active"' : ''; ?> ><a href="<?php echo xt_get_temai_search_url(array('cat' => 50101089)); ?> ">运动</a></li> <li <?php echo $firstCategory == 50101115 ? 'class="active"' : ''; ?> ><a href="<?php echo xt_get_temai_search_url(array('cat' => 50101115)); ?> ">居家</a></li> <li <?php echo $firstCategory == 50101133 ? 'class="active"' : ''; ?> ><a href="<?php echo xt_get_temai_search_url(array('cat' => 50101133)); ?> ">其他</a></li> </ul> </div> </div> <div class="row-fluid clearfix" style="margin:0px 10px 0px 10px;background-color: #f1f1f1;padding:10px;width:auto;"> <?php if (!empty($secondCategories)) { ?> <dl class="dl-horizontal" style="margin:0px;"> <dt style="width:58px;">分类:</dt> <dd style="margin-left:58px;"> <ul class="inline" style="margin:0px;"> <?php foreach ($secondCategories as $cat) { $_url = xt_get_temai_search_url(array('cat' => $cat['cid'])); echo '<li><a href="' . $_url . '" class="' . ($filterCategory == $cat['cid'] ? 'text-default' : 'text-gray') . '">' . $cat['name'] . '</a></li>'; } ?> </ul> </dd> </dl> <?php } ?> <div class="pull-left" style="padding:8px 0px 3px 20px;"> 排序: <div class="btn-group"> <a rel="nofollow" class="btn btn-small <?php echo $filterSortOrder == 's' ? 'btn-primary' : ''; ?> " href="<?php echo xt_get_temai_search_url(array('sort' => 's', 'cat' => $filterCategory)); ?> ">默认</a> <a rel="nofollow" class="btn btn-small <?php echo $filterSortOrder == 'p' ? 'btn-primary' : ''; ?> " href="<?php echo xt_get_temai_search_url(array('sort' => 'p', 'cat' => $filterCategory)); ?> ">最便宜</a> <a rel="nofollow" class="btn btn-small <?php echo $filterSortOrder == 'pd' ? 'btn-primary' : ''; ?> " href="<?php echo xt_get_temai_search_url(array('sort' => 'pd', 'cat' => $filterCategory)); ?> ">最贵</a> <a rel="nofollow" class="btn btn-small <?php echo $filterSortOrder == 'd' ? 'btn-primary' : ''; ?> " href="<?php echo xt_get_temai_search_url(array('sort' => 'd', 'cat' => $filterCategory)); ?> ">月销量最高</a> <a rel="nofollow" class="btn btn-small <?php echo $filterSortOrder == 'pt' ? 'btn-primary' : ''; ?> " href="<?php echo xt_get_temai_search_url(array('sort' => 'pt', 'cat' => $filterCategory)); ?> ">最新发布</a> </div> </div> <div class="pull-right" style="padding:8px 0px 3px 20px;"> <?php echo $pager_top; ?> </div> </div> <?php }