拍拍推商城系統(tǒng)是匯總淘寶天貓京東等等十多家主流電商平臺(tái)免費(fèi)試用商品,每天上萬件新品供試客免費(fèi)申請(qǐng)?jiān)囉?無需退還,還賺傭金的商城。小編對(duì)他還是比較了解的,今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開發(fā),我們今天講解的是V3.8.13版本,使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信群發(fā)平臺(tái)的接口非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用。
首先打開項(xiàng)目:\Application\Sms\Templates\setting.tpl.php文件 在73行左右新增短信寶頁面
|
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'] ?>"> <a style="cursor:pointer;" id="smsBao" target="_blank">還沒有注冊(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'] ?>"> (短信寶短信平臺(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'] ?>"> (短信簽名 ) </td> </tr></table> |
打開項(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
|
<?phpnamespace 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; $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(); } $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]; }}?> |
打開項(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)過上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。


報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。
另外:我們已經(jīng)開發(fā)好完整的拍拍推v3.8.13系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程。
最新更新
電商類
CMS類
微信類