31 lines
1.5 KiB
PHP
31 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* @package wx-Reward(微信打赏)
|
|
* @version 1.8
|
|
* Plugin Name: 微信打赏
|
|
* Description: 在文章末尾添加微信打赏功能,如果读者觉得这篇文章对他有用,可以用微信扫一扫打赏赞助。
|
|
* Author: 木木的布劳格
|
|
* Version: 1.8
|
|
* Author URI: http://m2009.org
|
|
*/
|
|
function zxd_ctrlcenter_wxreward_js(){
|
|
global $zbp;
|
|
$zbp->footer .= '<link href="'.$zbp->host.'zb_users/plugin/zxd_ctrlcenter/plugin/wxreward/src/wx-reward.css" rel="stylesheet"> <script type="text/javascript" src="'.$zbp->host.'zb_users/plugin/zxd_ctrlcenter/plugin/wxreward/src/wx-reward.js"></script>';
|
|
}
|
|
function zxd_ctrlcenter_wxreward_html(&$template){
|
|
global $zbp;
|
|
if ($zbp->Config('zxd_ctrlcenter')->plugin_wxreward_picurl){
|
|
$QR=$zbp->Config('zxd_ctrlcenter')->plugin_wxreward_picurl;
|
|
}else{
|
|
$QR= $zbp->host.'zb_users/plugin/zxd_ctrlcenter/plugin/wxreward/src/wxpay.jpg';
|
|
}
|
|
if ($zbp->Config('zxd_ctrlcenter')->plugin_wxreward_txt){
|
|
$txt=$zbp->Config('zxd_ctrlcenter')->plugin_wxreward_txt;
|
|
}else{
|
|
$txt='微信扫一扫,打赏作者吧~';
|
|
}
|
|
$html='<div class="gave"><a href="javascript:;" id="gave">打赏</a><div class="code" id="wechatCode" style="display: none"><img src="'.$QR.'" alt="微信扫一扫支付"><div id="ico-wechat"><img src="'.$zbp->host.'zb_users/plugin/zxd_ctrlcenter/plugin/wxreward/src/ico-wechat.jpg" alt="微信" class="ico-wechat">'.$txt.'</div></div></div>';
|
|
$content=$template->GetTags('article')->Content;
|
|
$template->GetTags('article')->Content=$content . $html;
|
|
|
|
} |