function store_pay_content_show($content) { $hidden_content = ''; $content = do_shortcode($content); $content = wpautop($content); $content = lightbox_gall_replace($content); if (is_single()) { $price = product_smallest_price(get_the_ID()); //get_post_meta(get_the_ID(),'product_price',true); $dl_links = get_post_meta(get_the_ID(), 'product_download_links', true); $pay_content = get_post_meta(get_the_ID(), 'product_pay_content', true); $hidden_content = deal_pay_dl_content($dl_links); $hidden_content .= $pay_content; if ($price[5] == 0 || count(get_user_order_records(get_the_ID(), 0, 1)) > 0) { $see_content = empty($hidden_content) ? $content : $content . '<div class="label-title"><span>付费内容</span><p>' . $hidden_content . '</p></div>'; } else { $see_content = empty($hidden_content) ? $content : $content . '<div class="label-title"><span>付费内容</span><p>你只有购买支付后才能查看该内容!</p></div>'; } } else { $see_content = $content; } return $see_content; }
function um_post_paycontent($content) { if (get_post_status(get_the_ID()) != 'publish' || !get_post_meta(get_the_ID(), 'pay_switch', true)) { return $content; } $hidden_content = ''; if (is_single() && get_post_type() == 'post') { $price = product_smallest_price(get_the_ID()); $dl_links = get_post_meta(get_the_ID(), 'product_download_links', true); $pay_content = get_post_meta(get_the_ID(), 'product_pay_content', true); if (!count(get_user_order_records(get_the_ID(), 0, 1))) { $hidden_content .= um_post_source_price(get_the_ID()); } if (!empty($dl_links)) { $hidden_content .= '<div id="pay-content"><li class="summary-content"><span class="dt" style="position:absolute;top:0;left:0;">资源信息 :</span>'; $arr_links = explode(PHP_EOL, $dl_links); foreach ($arr_links as $arr_link) { $arr_link = explode('|', $arr_link); $arr_link[0] = isset($arr_link[0]) ? $arr_link[0] : ''; $arr_link[1] = isset($arr_link[1]) ? $arr_link[1] : ''; $arr_link[2] = isset($arr_link[2]) ? $arr_link[2] : ''; $hidden_content .= '<p style="margin:0 0 0 75px;">' . $arr_link[0] . '</p><p style="margin:0 0 0 75px;">下载链接:'; if ($price[5] == 0 || count(get_user_order_records(get_the_ID(), 0, 1)) > 0) { $hidden_content .= '<a href="' . $arr_link[1] . '" title="' . $arr_link[0] . '" target="_blank">' . $arr_link[1] . '</a>'; } else { $hidden_content .= '*** 隐藏内容购买后可见 ***'; } $hidden_content .= ' 下载密码:'; if ($price[5] == 0 || count(get_user_order_records(get_the_ID(), 0, 1)) > 0) { $hidden_content .= $arr_link[2]; } else { $hidden_content .= '*** 隐藏内容购买后可见 ***'; } $hidden_content .= '</p>'; } $hidden_content .= '</li>'; } if ($price[5] == 0 || count(get_user_order_records(get_the_ID(), 0, 1)) > 0) { $hidden_content .= '<p style="margin-left:75px;">' . $pay_content . '</p>'; } if ($price[5] != 0 && count(get_user_order_records(get_the_ID(), 0, 1)) <= 0) { $amount = (int) get_post_meta(get_the_ID(), 'product_amount', true); $btn = $amount > 0 ? '<a class="inner-buy-btn" data-top="false"><i class="fa fa-shopping-cart"></i>立即购买</a>' : '<a class="inner-soldout" href="javascript:"><i class="fa fa-shopping-cart"> </i>缺货不可购买</a>'; $hidden_content .= '<div id="pay"><p>购买该资源后,相关内容将发送至您的邮箱!' . $btn . '</p></div>'; } $hidden_content .= '</div>'; $see_content = empty($hidden_content) ? $content : $content . '<div class="label-title post"><span id="title"><i class="fa fa-paypal"></i> 付费资源</span>' . $hidden_content . '</div>'; } else { $see_content = $content; } return $see_content; }
} ?> </div> <div class="tips row"> <p><?php _e('注意:本站为本商品唯一销售点,请勿在其他途径购买,以免遭受安全损失。', 'tinection'); ?> </p> </div> </div> <div class="main-content"> <div class="shop-content"> <div class="mainwrap"> <div id="wrapnav"> <?php $order_records = get_user_order_records($post->ID); $order_num = count($order_records); ?> <ul class="nav"> <div class="intro"></div> <li class="active"><a href="#description" rel="nofollow" hidefocus="true"><?php _e('商品详情', 'tinection'); ?> </a></li> <li><a href="#reviews" rel="nofollow" hidefocus="true"><?php _e('商品评价', 'tinection'); ?> <em><?php $count_comments = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_approved='1' AND comment_post_ID = %d AND comment_type not in ('trackback','pingback')", $post->ID)); echo $count_comments; ?>
</tr> <?php } ?> </tbody> </table> </div> </div> <?php } } // 会员end //~ 订单start if ($get_tab == 'orders') { if ($oneself) { $order_records = get_user_order_records(0, $curauth->ID); ?> <ul class="site-order-list"> <div class="shop" style="margin-top: 50px;"> <div id="history" class="wrapbox"> <form id="continue-pay" name="continue-pay" action="<?php echo THEME_URI . '/functions/alipay/alipayapi.php'; ?> " method="post" style="height:0;"> <input type = "hidden" id="product_id" name="product_id" readonly="" value=""> <input type = "hidden" id="order_id" name="order_id" readonly="" value="0"> <input type = "hidden" id="order_name" name="order_name" readonly="" value="0"> </form> <li class="contextual" style="background:#ceface;color:#44a042;"><?php echo sprintf(__('与 %1$s 相关订单记录(该栏目仅自己和管理员可见)。', 'tinection'), $curauth->display_name); ?>