91成人在线播放_欧美一区二区视频在线观看_91精品国产高清久久久久久_国产精品久久亚洲不卡4k岛国


待發(fā)短信

在線客服
產(chǎn)品支持 短信寶客服
合作渠道 渠道合作
服務(wù)咨詢

4001-021-502

工作時(shí)間

9:00-21:00

拍拍推V3.8.13新增短信寶短信接口

拍拍推商城系統(tǒng)是匯總淘寶天貓京東等等十多家主流電商平臺(tái)免費(fèi)試用商品,每天上萬(wàn)件新品供試客免費(fèi)申請(qǐng)?jiān)囉?無(wú)需退還,還賺傭金的商城。小編對(duì)他還是比較了解的,今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開(kāi)發(fā),我們今天講解的是V3.8.13版本,使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信群發(fā)平臺(tái)的接口非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用。

首先打開(kāi)項(xiàng)目:\Application\Sms\Templates\setting.tpl.php文件 在73行左右新增短信寶頁(yè)面

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<table class="sms Smsbao table_form" style="display:none;">
        <tr class="Smsbao" style="display:none;">
            <td>用戶名</td>
            <td><input type="text" name="setting[smsbao_username]" value="<?php echo $sms_setting['smsbao_username'] ?>"> &nbsp;&nbsp;<a style="cursor:pointer;" id="smsBao" target="_blank">還沒(méi)有注冊(cè)賬號(hào)?立即注冊(cè)</a></td>
        </tr>
        <tr class="Smsbao" style="display:none;">
            <td>密鑰</td>
            <td><input type="text" name="setting[smsbao_password]" value="<?php echo $sms_setting['smsbao_password'] ?>"> &nbsp;&nbsp;(短信寶短信平臺(tái) 用戶密碼)</td>
        </tr>
        <tr class="Smsbao" style="display:none;">
            <td>短信簽名:</td>
            <td><input type="text" name="setting[smsbao_target]" value="<?php echo $sms_setting['smsbao_target'] ?>">&nbsp;&nbsp;(短信簽名 ) </td>
        </tr>
</table>

打開(kāi)項(xiàng)目:\Application\Sms\Api\Driver\ 新增Smsbao.class.php文件

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Sms\Api\Driver;
class Smsbao {
    private static $config    =   '';
    private static $setting   = '';
    public static function getInstance() {
        self::$setting = getcache('setting''sms');
        self::$config = array(
            'account'  => self::$setting['smsbao_username'],
            'password'  => self::$setting['smsbao_password'],
            'target'    => self::$setting['smsbao_target'],
        );
    }
    public static function send($mobile,$atr = array(),$content = '') {
        if(empty(self::$config)){
            self::getInstance();
        }
        self::$config['mobile'] = $mobile;
        self::$config['content'] = '【'.self::$setting['smsbao_target'].'】'.$content;
        $smsapi = "http://api.smsbao.com/";
        $user =  self::$config['account']; //短信平臺(tái)帳號(hào)
        $pass = md5(self::$setting['smsbao_password']); //短信平臺(tái)密碼
        $content=self::$config['content'];//要發(fā)送的短信內(nèi)容
        $phone =$mobile;//要發(fā)送短信的手機(jī)號(hào)碼
        $sendurl = $smsapi."sms?u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content);
        $result =file_get_contents($sendurl) ;
        if ($result == 0) {
            return TRUE;
        }else{
            return FALSE;
        }
    }
 
    public static function get_num() {
        if(empty(self::$config)){
            self::getInstance();
        }
        $smsapi = "http://api.smsbao.com/";
        $user =  self::$config['account']; //短信平臺(tái)帳號(hào)
        $pass = md5(self::$setting['smsbao_password']); //短信平臺(tái)密碼
        $content=self::$config['content'];//要發(fā)送的短信內(nèi)容
        $sendurl = $smsapi."balance?u=".$user."&p=".$pass;
        $result =file_get_contents($sendurl);
        $result = explode(',',$result);
        return $result[1];
    }
}
?>

打開(kāi)項(xiàng)目:\Application\Sms\Api\SmsApi.class.php 替換下代碼

?
1
2
3
4
5
6
7
8
9
10
11
public static function init($type){
        self::$setting = self::getSetting();
        extract(self::$setting);
        $type = "Smsbao";
        $class  =   strpos($type,'\\') ? $type : 'Sms\\Api\\Driver\\'. ucwords(strtolower($type));
        self::$handler  =    $class;
        self::$type  =    $type;
        if (!class_exists(self::$handler)) {
            return '接口不存在';
        }
    }

經(jīng)過(guò)上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。

報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。

另外:我們已經(jīng)開(kāi)發(fā)好完整的拍拍推v3.8.13系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程。

開(kāi)源插件

最新更新

電商類

CMS類

微信類

文章標(biāo)簽