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_report_fanxian_result($platform, $commission, $buyer, $sharer, $adser) { $result = array('isValid' => 0, 'commission' => $commission, 'income' => $commission, 'buy' => array('user_id' => 0, 'user_name' => '', 'rate' => 0, 'cash' => 0, 'jifen' => 0), 'share' => array('user_id' => 0, 'user_name' => '', 'rate' => 0, 'cash' => 0, 'jifen' => 0), 'ads' => array('user_id' => 0, 'user_name' => '', 'rate' => 0, 'cash' => 0, 'jifen' => 0)); $isJifen = xt_fanxian_is_jifenbao($platform); if ($isJifen) { $result['commission'] = $commission * 100; } $rate = $share_rate = 0; $total = 0; if ($sharer->exists()) { $result['share']['user_id'] = $sharer->ID; $result['share']['user_name'] = $sharer->user_login; if (xt_fanxian_is_share()) { $share_rate = xt_get_sharerate($sharer->ID); if ($share_rate > 0) { $fanxian = $jifen = 0; if ($isJifen) { $jifen = round($commission * $share_rate / 100, 2) * 100; } else { $fanxian = round($commission * $share_rate / 100, 2); } $result['share']['rate'] = $share_rate; $result['share']['cash'] = $fanxian; $result['share']['jifen'] = $jifen; $total += $share_rate; } } } if ($buyer->exists()) { $result['buy']['user_id'] = $buyer->ID; $result['buy']['user_name'] = $buyer->user_login; $rate = xt_get_rate($buyer->ID); if ($sharer->exists() && !xt_fanxian_is_sharebuy()) { //share no buy $rate = 0; } if ($rate > 0) { $fanxian = $jifen = 0; if ($isJifen) { $jifen = round($commission * $rate / 100, 2) * 100; } else { $fanxian = round($commission * $rate / 100, 2); } $result['buy']['rate'] = $rate; $result['buy']['cash'] = $fanxian; $result['buy']['jifen'] = $jifen; $total += $rate; } if ($adser->exists()) { $result['ads']['user_id'] = $adser->ID; $result['ads']['user_name'] = $adser->user_login; if (xt_fanxian_is_ad()) { $adrate = xt_get_adrate($adser); if ($adrate > 0) { $fanxian = $jifen = 0; if ($isJifen) { $jifen = round($commission * $adrate / 100, 2) * 100; } else { $fanxian = round($commission * $adrate / 100, 2); } $result['ads']['rate'] = $adrate; $result['ads']['cash'] = $fanxian; $result['ads']['jifen'] = $jifen; $total += $adrate; } } } } if ($total <= 90) { $result['isValid'] = 1; $result['income'] = round($commission * (90 - $total) / 100, 2); } return $result; }
} if ($_type == 'temai' && !empty($_url)) { $_items = xt_taobaoke_item('', $_id, 'click_url'); if (is_wp_error($_items) || empty($_items)) { } else { $_url = $_items[0]->click_url; } } elseif ($_type == 'taobao' && empty($_url)) { if (!empty($_id)) { $_items = xt_taobaoke_item($_id, '', 'title,click_url'); if (is_wp_error($_items) || empty($_items)) { $_url = $iframe_url; } else { $_url = $_items[0]->click_url; $_title = '淘宝 - ' . $_items[0]->item->title; if (!xt_fanxian_is_sharebuy() && !empty($xt_share_guid)) { $IS_CONVERT = false; } else { $IS_CONVERT = true; } } } elseif (!empty($_q)) { $listurl = xt_taobaoke_listurl($_q); if (is_wp_error($listurl)) { wp_die($listurl->get_error_message()); } else { $_url = $listurl; } } } elseif ($_type == 'taobao' && !empty($_url) && empty($_id) && empty($_q)) { $IS_URL_CONVERT = true;