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_header_script() { global $xt; $_global = get_option(XT_OPTION_GLOBAL); $searchtaobaourl = ''; if (xt_is_s8()) { $searchtaobaourl = xt_jump_url(array('title' => 'SEARCH')); } else { $searchtaobaourl = xt_get_taobao_search_url(array('keyword' => 'SEARCH')); } echo '<script type="text/javascript">var XT = ' . json_encode(array('isfanxian' => xt_is_fanxian() ? 1 : 0, 'siteurl' => home_url(), 'pluginurl' => XT_PLUGIN_URL, 'ajaxurl' => admin_url('admin-ajax.php'), 'loginurl' => site_url('wp-login.php'), 'inviteurl' => xt_site_url('invite-USERID'), 'authorizeurl' => xt_platform_authorize_url('[PLATFORM]', '[STATE]', '[MODE]'), 'registerurl' => site_url('wp-login.php?action=register&redirect_to=[REDIRECT]', 'login'), 'searchshareurl' => xt_get_shares_search_url(array('s' => 'SEARCH')), 'searchalbumurl' => xt_get_albums_search_url(array('s' => 'SEARCH')), 'searchuserurl' => '', 'searchtaobaourl' => $searchtaobaourl, 'taobaoitemurl' => xt_site_url('taobao-NUMIID'), 'searchshopurl' => xt_get_shop_search_url(array('keyword' => 'SEARCH')), 'searchtaobaoitemurl' => xt_jump_url(array('id' => 'SEARCH')), 'searchpaipaiurl' => xt_get_paipai_search_url(array('keyWord' => 'SEARCH')), 'searchbijiaurl' => xt_get_bijia_search_url(array('keyword' => 'SEARCH')), 'searchtuanurl' => xt_get_tuan_search_url(array('keyword' => 'SEARCH')), 'userId' => get_current_user_id(), 'token' => wp_create_nonce('token'), 'option' => $_global, 'is_taobaopopup' => xt_is_taobaoPopup(), 'is_shares' => $xt->is_shares, 'is_albums' => $xt->is_albums, 'is_users' => $xt->is_users, 'is_shops' => $xt->is_shops, 'is_paipais' => $xt->is_paipais, 'is_bijias' => $xt->is_bijias, 'is_tuans' => $xt->is_tuans, 'is_user' => $xt->is_user, 'is_album' => $xt->is_album, 'is_account' => $xt->is_account, 'rate' => xt_get_rate(), 'jifenbao' => xt_jifenbao_text(), 'outercode' => xt_outercode(), 'fanxianhtml' => xt_fanxian_html('{fx}', '{fxtext}'))) . ';</script>'; }
function widget($args, $instance) { extract($args); $title = apply_filters('xt_widget_title', empty($instance['title']) ? '分享' : $instance['title'], $instance, $this->id_base); $style = isset($instance['style']) ? $instance['style'] : 'MZ'; $sortby = empty($instance['sortby']) ? 'newest' : $instance['sortby']; $cid = empty($instance['cid']) ? '' : $instance['cid']; $row = isset($instance['row']) ? intval($instance['row']) : 1; $tagPicCount = $style == 'MZ' ? 10 : $row * 6; $tagCount = $style == 'MZ' ? 20 : 28; $query_tags = query_tags(array('cid' => $cid, 'tag_per_page' => $tagPicCount + $tagCount)); $tags = $query_tags['tags']; $shares = xt_shareandtags($cid, array_slice($tags, 0, $tagPicCount), $sortby); $count = count($shares); if ($style == 'MZ') { echo str_replace('clearfix', 'xt-widget-shareandtags-mz clearfix', $before_widget); ?> <div class="hd"><h4 <?php echo !empty($title) ? '' : 'style="display:none;"'; ?> ><span><?php echo $title; ?> </span></h4></div> <div class="bd"> <div class="clearfix"> <div class="xt-big xt-img-box"> <?php if ($count > 0) { $_share = $shares[0]['share']; $_tag = $shares[0]['tag']; if (!empty($_share)) { ?> <a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank" title="<?php echo $_share->title; ?> "><?php xt_write_pic(base64_encode(get_the_share_picurl(200, $_share)), $_share->title); ?> <span><?php echo $_tag; ?> </span></a> <?php } else { ?> <a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank"><span><?php echo $_tag; ?> </span></a> <?php } } ?> </div> <div class="xt-small"> <?php if ($count > 1) { $length = $count > 7 ? 7 : $count; for ($i = 1; $i < $length; $i++) { $_share = $shares[$i]['share']; $_tag = $shares[$i]['tag']; if (!empty($_share)) { ?> <div class="xt-img-box"><a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank" title="<?php echo $_share->title; ?> "><?php xt_write_pic(base64_encode(get_the_share_picurl(160, $_share)), $_share->title); ?> <span><?php echo $_tag; ?> </span></a></div> <?php } else { ?> <div class="xt-img-box"><a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank"><span><?php echo $_tag; ?> </span></a></div> <?php } } } ?> </div> <div class="xt-big xt-img-box"> <?php if ($count > 7) { $_share = $shares[7]['share']; $_tag = $shares[7]['tag']; if (!empty($_share)) { ?> <a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank" title="<?php echo $_share->title; ?> "><?php xt_write_pic(base64_encode(get_the_share_picurl(200, $_share)), $_share->title); ?> <span><?php echo $_tag; ?> </span></a> <?php } else { ?> <a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank"><span><?php echo $_tag; ?> </span></a> <?php } } ?> </div> <div class="xt-small xt-last"> <?php if ($count > 8) { for ($i = 8; $i < $count; $i++) { $_share = $shares[$i]['share']; $_tag = $shares[$i]['tag']; if (!empty($_share)) { ?> <div class="xt-img-box"><a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank" title="<?php echo $_share->title; ?> "><?php xt_write_pic(base64_encode(get_the_share_picurl(160, $_share)), $_share->title); ?> <span><?php echo $_tag; ?> </span></a></div> <?php } else { ?> <div class="xt-img-box"><a href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank"><span><?php echo $_tag; ?> </span></a></div> <?php } } } ?> </div> </div> <?php if (count($tags) > $tagPicCount) { $tags = array_slice($tags, $tagPicCount, $tagCount); $tagsList = array_chunk($tags, 5); ?> <div class="xt-tags clearfix"> <?php foreach ($tagsList as $_tags) { if (!empty($_tags)) { $_count = 0; foreach ($_tags as $_tag) { echo '<a ' . ($_count == 0 ? 'class="xt-first"' : 'class="text-gray"') . ' href="' . xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag->title)) . '" target="_blank">' . $_tag->title . '</a>'; $_count++; } } } ?> </div> <?php } ?> </div> <?php } else { echo $before_widget; ?> <div class="hd xt-bd-radius-top"><h4 class="xt-bd-l" <?php echo !empty($title) ? '' : 'style="display:none;"'; ?> ><span><?php echo $title; ?> </span></h4></div> <div class="bd xt-bd-radius-bottom"> <?php if (!empty($shares)) { $_count = 0; ?> <ul class="thumbnails"> <?php if (!empty($shares)) { foreach ($shares as $__share) { $_share = $__share['share']; $_tag = $__share['tag']; if (!empty($_share)) { ?> <li><a class="thumbnail" href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank" title="<?php echo $_share->title; ?> "><?php xt_write_pic(base64_encode(get_the_share_picurl(200, $_share)), $_share->title); ?> <span><?php echo $_tag; ?> </span></a></li> <?php } else { ?> <li><a class="thumbnail" href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag)); ?> " target="_blank"><span><?php echo $_tag; ?> </span></a></li> <?php } } } ?> </ul> <?php } ?> <?php if (count($tags) > $tagPicCount) { $tags = array_slice($tags, $tagPicCount - 1, $tagCount); ?> <div class="clearfix" style="position:relative;"> <?php $chunks = array_chunk($tags, 7); foreach ($chunks as $chunk) { $_tag0 = (array) $chunk[0]; ?> <dl class="dl-horizontal pull-left"> <dt> <a target="_blank" class="text-success" href="<?php echo xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag0['title'])); ?> "><?php echo $_tag0['title']; ?> </a> </dt> <dd> <ul class="inline"> <?php for ($i = 1; $i < count($chunk); $i++) { $_random = rand(1, 3); $_tag = (array) $chunk[$i]; echo '<li><a ' . ($_random == 1 ? ' class="text-default" ' : ' class="text-gray"') . 'href="' . xt_get_shares_search_url(array('cid' => $cid, 's' => $_tag['title'])) . '" target="_blank">' . $_tag['title'] . '</a></li>'; } ?> </ul> </dd> </dl> <?php } ?> <?php if ($cid > 0) { ?> <a class="xt-widget-tag-more label-default" href="<?php echo xt_get_shares_search_url(array('cid' => $cid)); ?> " target="_blank">全部<span>...</span></a><?php } ?> </div> <?php } ?> </div> <?php } echo $after_widget; }
function get_the_share_detail_template() { global $xt_user_avatar; $cacheObj = get_the_share_cachedata(); $_item = $cacheObj['item']; $_title = get_the_share_title(); $_fxText = '元'; $isJifenbao = xt_fanxian_is_jifenbao(get_the_share_fromtype()); if ($isJifenbao) { $_fxText = xt_jifenbao_text(); } ?> <script type="text/javascript"> if(typeof(XT)!='undefined'){XT.share_id=<?php the_share_id(); ?> ;} </script> <div class="row-fluid" style="background-color:white;"> <div class="span12 media well well-small" style="margin-left:0px;margin-bottom:0px;"> <a style="display:block;width:40px;" class="pull-left X_Nick" data-value="<?php echo get_the_share_userid(); ?> " href="<?php xt_the_user_url(get_the_share_userid()); ?> " target="_blank" rel="nofollow"><img src="<?php xt_the_user_pic($xt_user_avatar); ?> " style="width:40px;height:40px;"></a> <div class="media-body"> <h5 class="media-heading"><a class="xt-red X_Nick" data-value="<?php echo get_the_share_userid(); ?> " href="<?php xt_the_user_url(get_the_share_userid()); ?> " target="_blank"><?php the_share_username(); ?> </a> 分享了该宝贝<span class="pull-right"><?php the_share_time_human(); ?> </span></h5> <div class="media" style="margin-top:0px;"><?php the_share_content(); ?> </div> </div> </div> <div class="span12 media" style="margin-left:0px;padding:5px;"> <div class="pull-left"> <a rel="nofollow" href="<?php the_share_go(); ?> " target="_blank"> <img src="<?php the_share_picurl(450); ?> " alt="<?php echo $_title; ?> "/> <?php echo get_the_admin_tool_share(get_the_share_id()); ?> </a> </div> <div class="pull-left" style="width:250px"> <h1 style="font-size:16px;line-height:22px;margin-top: 0px;"><?php echo '<img src="' . get_the_share_ico() . '"/>'; ?> <a rel="nofollow" title="<?php echo $_title; ?> " target="_blank" href="<?php the_share_go(); ?> "><?php echo $_title; ?> </a></h1> <a id="X_Share-Detail-Buy" data-from="<?php echo get_the_share_fromtype(); ?> " data-type="<?php echo $isJifenbao ? 'jifenbao' : 'cash'; ?> " data-id="<?php echo get_the_share_key(); ?> " href="<?php the_share_go(); ?> " target="_blank" rel="nofollow" class="btn btn-primary" style="padding:4px 20px;font-size:16px;font-weight:bold;">¥<?php the_share_price(); ?> 去购买</a> <?php if (xt_fanxian_is_sharebuy()) { ?> <div class="clearfix"><?php echo xt_fanxian_html('{fx}', $_fxText, 'margin-top:10px;'); ?> </div> <?php } ?> <div class="clearfix" style="margin-top:10px;padding-bottom: 10px;border-bottom: 1px solid #EAEAEA;"> <a class="badge badge-fav" title="喜欢" data-id="<?php the_share_id(); ?> " data-type="1" data-uid="<?php the_share_userid(); ?> "><?php the_share_favcount(); ?> <i class="icon-heart icon-white"></i></a> <!--<a href="javascript:;" class="xt-album-add" data-id="<?php //the_share_id() ?> " data-pic="<?php //the_share_picurl(160) ?> ">加入专辑</a>--> </div> <div class="well well-small clearfix" style="margin-top:15px;"> <?php $_tags = explode(" ", get_the_share_tags()); foreach ($_tags as $_tag) { echo "<a href=\"" . xt_get_shares_search_url(array('s' => $_tag)) . "\" target=\"_blank\" style=\"float: left;margin-left: 8px;\">{$_tag}</a>"; } ?> </div> <?php $bdshare = xt_bdshare(); if ($bdshare > 0) { ?> <!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_b" style="line-height: 12px;"><img src="http://share.baidu.com/static/images/type-button-1.jpg" /> <a class="shareCount"></a> </div> <script type="text/javascript"> document.getElementById("bdshell_js").src = "http://share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours(); </script> <!-- Baidu Button END --> <?php } ?> </div> </div> </div> <?php }
function _xt_sitemap_build_other($type = '') { global $wpdb; $cats = $wpdb->get_col('SELECT id FROM ' . XT_TABLE_CATALOG . ' WHERE type=\'share\' ORDER BY id DESC'); if ($type == 'baidu') { } else { $xml_begin = '<?xml version="1.0" encoding="utf-8"?><urlset>'; $xml_indexs = ''; $pages = xt_design_syspages(); $timestamp = current_time('timestamp', 1); if (!empty($pages)) { foreach ($pages as $page) { if (!empty($page['preview'])) { $xml_indexs .= '<url>'; $xml_indexs .= '<loc>' . $page['preview'] . '</loc>'; $xml_indexs .= '<lastmod>' . date('Y-m-d', $timestamp) . '</lastmod>'; $xml_indexs .= '<changefreq>' . XT_SITEMAP_OTHER_CHANGEFREQ . '</changefreq>'; $xml_indexs .= '<priority>' . XT_SITEMAP_OTHER_PRIORITY . '</priority>'; $xml_indexs .= '</url>'; } } } if (!empty($cats)) { foreach ($cats as $cat) { $xml_indexs .= '<url>'; $xml_indexs .= '<loc>' . xt_get_shares_search_url(array('cid' => $cat)) . '</loc>'; $xml_indexs .= '<lastmod>' . date('Y-m-d', $timestamp) . '</lastmod>'; $xml_indexs .= '<changefreq>' . XT_SITEMAP_OTHER_CHANGEFREQ . '</changefreq>'; $xml_indexs .= '<priority>' . XT_SITEMAP_OTHER_PRIORITY . '</priority>'; $xml_indexs .= '</url>'; } } $xml_end = '</urlset>'; return $xml_begin . $xml_indexs . $xml_end; } }
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; }
function xt_meta_box_post() { global $post; wp_nonce_field(plugin_basename(__FILE__), 'xt_meta_box_post'); ?> <style type="text/css"> .xt-items li{padding:0px;margin:0px;display: inline;float: left;margin-right: 17px;width: 152px;position: relative;cursor: default;} .xt-items li b{display:none;width:5px;height:5px;} .xt-items li div>a{color: #6C6C6C;width: 150px;height: 150px;display: block;overflow: hidden;border: 1px solid #E5E5E5;line-height: 150px;_font-size: 110px;text-align: center;} .xt-items li h4{line-height: 18px;text-align: center;font-weight: normal;margin: 4px 0;height: 20px;overflow: hidden;width: 152px;font-size: 100%;} .xt-items li p{text-align:center;color:#6C6C6C;font-family:'\5fae\8f6f\96c5\9ed1';} .xt-items li.xt-current b,.xt-items li.xt-hover b{display: block;width: 88px;height: 25px;color: white;text-align: center;line-height: 24px;position: absolute;top: 126px;right: 1px;z-index: 2;font-weight: normal;background: black;opacity: 0.5;filter: alpha(opacity=50);cursor: pointer;} .xt-items li.xt-current span,.xt-items li.xt-hover span{width: 150px;height: 150px;display: block;position: absolute;border: 3px solid #BAD4AF;top: -2px;left: -2px;z-index: 1;} #X_Items_Box_Url_Prompt_Text{color: #BBB;position: absolute;font-size: 1.7em;padding: 8px 10px;cursor: text;vertical-align: middle;margin-top:15px;} </style> <?php $xt_items = get_post_meta($post->ID, 'xt_items', true); if (empty($xt_items)) { $xt_items = array(); for ($i = 0; $i < 4; $i++) { $xt_items[$i] = array('title' => '', 'url' => '', 'pic' => '', 'price' => '', 'type' => '', 'key' => '', 'guid' => xt_user_guid()); } } $xt_count = 0; ?> <ul id="X_Items" class="xt-items clear"> <?php foreach ($xt_items as $xt_item) { ?> <li id="X_Items_<?php echo $xt_count; ?> "> <b>编辑商品信息</b><div><span></span><a href="javascript:;"><?php echo !empty($xt_item['pic']) ? '<img src="' . $xt_item['pic'] . '"' : ''; ?> </a><h4><a href="javascript:;"><?php echo $xt_item['title']; ?> </a></h4><p><?php echo $xt_item['price']; ?> </p></div> <input type="hidden" class="xt-item-title" name="items[<?php echo $xt_count; ?> ][title]" value="<?php echo esc_html($xt_item['title']); ?> " /> <input type="hidden" class="xt-item-url" name="items[<?php echo $xt_count; ?> ][url]" value="<?php echo $xt_item['url']; ?> " /> <input type="hidden" class="xt-item-pic" name="items[<?php echo $xt_count; ?> ][pic]" value="<?php echo $xt_item['pic']; ?> " /> <input type="hidden" class="xt-item-price" name="items[<?php echo $xt_count; ?> ][price]" value="<?php echo $xt_item['price']; ?> " /> <input type="hidden" class="xt-item-type" name="items[<?php echo $xt_count; ?> ][type]" value="<?php echo $xt_item['type']; ?> " /> <input type="hidden" class="xt-item-key" name="items[<?php echo $xt_count; ?> ][key]" value="<?php echo $xt_item['key']; ?> " /> <input type="hidden" class="xt-item-guid" name="items[<?php echo $xt_count; ?> ][guid]" value="<?php echo $xt_item['guid']; ?> " /> </li> <?php $xt_count++; } ?> <br class="clear"> </ul> <div id="X_Items_Box" style="display:none;"> <label class="hide-if-no-js" style="" id="X_Items_Box_Url_Prompt_Text" for="X_Items_Box_Url">在此输入商品链接</label> <input type="text" id="X_Items_Box_Url" style="background-color: white;border-color: #CCC;padding: 3px 8px;font-size: 1.7em;line-height: 100%;width: 100%;outline: none;margin-top:15px;" value="" autocomplete="off"> <p class="submit" style="margin:20px auto;text-align:center;"> <input type="submit" id="X_Items_Box_Submit" class="button-primary" value="确定"> <span><img src="<?php echo esc_url(admin_url('images/wpspin_light.gif')); ?> " class="ajax-feedback"></span> <a class="button" id="X_Items_Box_Clear" href="javascript:;" >清空</a> </p> </div> <?php global $xt; $_global = get_option(XT_OPTION_GLOBAL); echo '<script type="text/javascript">var XT = ' . json_encode(array('siteurl' => site_url(), 'pluginurl' => XT_PLUGIN_URL, 'ajaxurl' => admin_url('admin-ajax.php'), 'loginurl' => site_url('wp-login.php'), 'searchshareurl' => xt_get_shares_search_url(array('s' => 'SEARCH')), 'userId' => get_current_user_id(), 'token' => wp_create_nonce('token'), 'option' => $_global)) . ';</script>'; ?> <script type="text/javascript" src="<?php echo XT_CORE_JS_URL . '/xt-post.min.js'; ?> "></script> <?php }
function &get_shares() { $this->parse_query(); do_action_ref_array('pre_get_shares', array(&$this)); $q =& $this->query_vars; $q = $this->fill_query_vars($q); $hash = md5(serialize($this->query_vars)); if ($hash != $this->query_vars_hash) { $this->query_vars_changed = true; $this->query_vars_hash = $hash; } unset($hash); $result = $this->_get_shares($q); $this->found_shares = (int) $result['total']; $this->shares = $result['share']; $this->share_count = count($this->shares); if (!$q['no_found_rows'] && ($this->share_count > 1 || $q['page'] > 1)) { global $xt; $total_page = ceil($this->found_shares / (int) $this->get('share_per_page')); $_base = '#%#%'; if (isset($xt->is_shares) && $xt->is_shares) { $_base = xt_get_shares_search_url(array_merge($q, array('page' => '%#%'))); } else { if (isset($_GET['page']) && $_GET['page'] == 'xt_menu_share') { $_base = add_query_arg('paged', '%#%', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } } $this->paginate_links = paginate_links(array('base' => $_base, 'format' => '', 'end_size' => 3, 'total' => $total_page, 'current' => $q['page'], 'prev_text' => '上一页', 'next_text' => '下一页', 'mid_size' => 1, 'type' => isset($_GET['page']) && $_GET['page'] == 'xt_menu_share' ? 'plain' : 'list')); } return $this->shares; }
function xt_row_catalog($cat, $count) { $issub = $cat->parent > 0 ? 1 : 0; $_url = 'javascript:;'; if ($cat->type == 'share') { $_url = xt_get_shares_search_url(array('cid' => $cat->id)); } elseif ($cat->type == 'album') { $_url = xt_get_albums_search_url(array('cid' => $cat->id)); } ?> <tr id="catalog-<?php echo $cat->id; ?> " <?php echo $count % 2 == 0 ? 'class="alternate"' : ''; ?> > <td scope="row"><span><?php echo $cat->id; ?> </span></td> <td class="name column-name"<?php echo $issub ? ' style="padding-left:20px;"' : ''; ?> ><strong><a class="row-title" href="<?php echo $_url; ?> " target="_blank"><?php echo ($issub ? '— ' : '') . $cat->title; ?> </a></strong><br> <div class="row-actions"> <!--<span class="edit"><a href="">编辑</a> | </span>--> <span class="inline hide-if-no-js"><a href="#" class="editinline">快速编辑</a> | </span> <span class="delete"><a class="delete-catalog" href="javascript:;" data-value="<?php echo $cat->id; ?> ">删除</a></span> </div> <div class="hidden" id="inline_<?php echo $cat->id; ?> "> <div class="title"><?php echo $cat->title; ?> </div> <div class="pic"><?php echo $cat->pic; ?> </div> <div class="sort"><?php echo $cat->sort; ?> </div> </div> </td> <td><?php echo $cat->is_front ? '前台分类' : '系统分类'; ?> </td> <td><?php echo $cat->sort; ?> </td> <td><?php echo $cat->count; ?> </td> </tr> <?php }
function xt_row_tag($tag, $count, $cid = 0) { $_tagUrl = xt_get_shares_search_url(array('s' => $tag->title, 'cid' => $cid)); $terms = xt_get_catalog_terms_cache($tag->id); $as = array(); $cids = array(); if (!empty($terms)) { foreach ($terms as $term) { $_url = add_query_arg(array('cid' => $term->id, 'paged' => 1, 's' => ''), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); $as[] = '<a href="http://' . $_url . '">' . $term->title . '</a>'; $cids[] = $term->id; } } ?> <tr id="tag-<?php echo $tag->id; ?> " <?php echo $count % 2 == 0 ? 'class="alternate"' : ''; ?> > <td scope="row"><span><?php echo $tag->id; ?> </span></td> <td class="name column-name"><strong><a class="row-title" href="<?php echo $_tagUrl; ?> " target="_blank"><?php echo $tag->title; ?> </a></strong><br> <div class="row-actions"> <!--<span class="edit"><a href="">编辑</a> | </span>--> <span class="inline hide-if-no-js"><a href="#" class="editinline">快速编辑</a> | </span> <span class="delete"><a class="delete-tag" href="javascript:;" data-value="<?php echo $tag->id; ?> ">删除</a></span> </div> <div class="hidden" id="inline_<?php echo $tag->id; ?> "> <div class="title"><?php echo $tag->title; ?> </div> <div class="sort"><?php echo $tag->sort; ?> </div> <div class="cids"><?php echo implode(',', $cids); ?> </div> <div class="cid"><?php echo isset($tag->cid) ? $tag->cid : 0; ?> </div> </div> </td> <td><?php echo implode(' , ', $as); ?> </td> <td><?php echo $tag->sort; ?> </td> <td><?php echo $tag->count; ?> </td> </tr> <?php }
foreach ($terms as $term) { if ($term->is_front) { echo '<a href="' . xt_get_shares_search_url(array_merge($xt_share_param, array('cid' => $term->id, 's' => '', 'sortOrder' => '', 'price' => '', 'page' => 1))) . '"' . ($terms_select == $term->id ? ' class="label label-tag active"' : 'class="label label-tag"') . '>' . $term->title . '</a>'; } } if (!empty($terms_sub)) { echo '<div class="clearfix"><h4>分类</h4>'; foreach ($terms_sub as $sub) { echo '<a href="' . xt_get_shares_search_url(array_merge($xt_share_param, array('cid' => $sub->id, 'sortOrder' => '', 'price' => '', 'page' => 1))) . '" class="label label-tag">' . $sub->title . '</a>'; } echo '</div>'; } if (!empty($terms_tag)) { echo '<div class="clearfix"><h4>热门标签</h4>'; foreach ($terms_tag as $tag) { echo '<a href="' . xt_get_shares_search_url(array_merge($xt_share_param, array('s' => $tag->title, 'sortOrder' => '', 'price' => '', 'page' => 1))) . '"' . ($tag_select == $tag->title ? ' class="label label-tag active"' : 'class="label label-tag"') . '>' . $tag->title . '</a>'; } echo '</div>'; } ?> <?php if (!empty($terms_sub) || !empty($terms_tag)) { echo '<div class="xt-share-catalog-arrow"><span></span></div>'; } ?> </div> </div> </div> <?php } }