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_bijia_filter($params = array()) { $_params = array_merge(array('keyword' => '', 'minprice' => '', 'maxprice' => '', 'orderby' => 1), $params); $orderby = intval($_params['orderby']); if (!in_array($orderby, array(1, 2, 3))) { $orderby = 3; } $_url = xt_get_bijia_search_url(array_merge($params, array('keyword' => 'keyword', 'minprice' => 'minprice', 'maxprice' => 'maxprice', 'orderby' => 'orderby'))); ?> <div class="xt-filter-box xt-bijia-filter form-inline"> 关键词:<input type="text" id="X_Bijia-KeyWord" class="input-small" placeholder="请输入关键词" value="<?php echo htmlentities($_params['keyword'], ENT_QUOTES, "UTF-8"); ?> "> 价格:<input type="number" id="X_Bijia-BegPrice" class="span1" value="<?php echo $_params['minprice'] > 0 ? $_params['minprice'] : ''; ?> "> 至 <input type="number" id="X_Bijia-EndPrice" class="span1" value="<?php echo $_params['maxprice'] > 0 ? $_params['maxprice'] : ''; ?> "> <select id="X_Bijia-OrderStyle"> <option value="3"<?php selected($orderby, 3); ?> >按相关程度排序</option> <option value="1"<?php selected($orderby, 1); ?> >按价格从低到高</option> <option value="2"<?php selected($orderby, 2); ?> >按价格从高到低</option> </select> <button id="X_Bijia-Filter-Search-Btn" type="button" class="btn btn-small btn-primary" data-url="<?php echo $_url; ?> " data-loading-text="搜索中...">搜索</button> </div> <?php }