ZKEYS系統(tǒng)是—WIN平臺(tái)下款免費(fèi)的域名主機(jī)管理軟件!能夠提供實(shí)時(shí)的域名注冊(cè),虛擬主機(jī)、彈性云計(jì)算開通與管理!小編對(duì)他還是比較了解的,今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開發(fā),使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信群發(fā)平臺(tái)的接口非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測試短信,推薦大家使用。
首先打開項(xiàng)目:\template\Admin\Zkeys\PC\Page\Setting\basic.html文件,替換2542~2537行代碼:
|
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
|
<div class="content-block"><div class="content-block-title">短信通道一</div><table class="inner-table edit-table"> <tbody> <tr> <th style="width: 180px;">通道:</th> <td> <span class="row-title">注:為確保正常發(fā)送,請(qǐng)正確填寫短信寶的短信通道信息!還未注冊(cè)短信寶賬號(hào)的請(qǐng)點(diǎn)擊<a href="http://www.gjrencai.com/reg" target="_blabk">免費(fèi)注冊(cè)</a></span> </td> </tr> <tr> <th>ApiId:</th> <td> <input type="text" name="smgApiId" class="input input-long" value="{$smg.smgApiId}"/> 短信寶用戶名 </td> </tr> <tr> <th>密鑰(ApiKey):</th> <td> <input type="password" name="smgApiKey" class="input input-long" value="{$smg.smgApiKey}"/> 短信寶密碼 </td> </tr> <tr> <th>簽名(Signature):</th> <td><input type="text" name="smgSignatureMd" class="input input-long" value="{$smg.smgSignatureMd}"/> 短信簽名</td> </tr> </tbody></table></div> |
接著打開項(xiàng)目:\libs\Niaoyun\Common\Sms\EnInfo.class.php文件,替換send方法
|
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
|
public function send($mobile, $content, $id = null) { $smsapi = $this->config['url']; $user = $this->config['apiId']; //短信平臺(tái)帳號(hào) $pass = md5($this->config['apiKey']); //短信平臺(tái)密碼 $content=$this->config['signature'].$content;//要發(fā)送的短信內(nèi)容 $phone = $mobile;//要發(fā)送短信的手機(jī)號(hào)碼 $sendurl = $smsapi."u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content); $result =file_get_contents($sendurl) ; $statusStr = array( "0" => "短信發(fā)送成功", "-1" => "參數(shù)不全", "-2" => "服務(wù)器空間不支持,請(qǐng)確認(rèn)支持curl或者fsocket,聯(lián)系您的空間商解決或者更換空間!", "30" => "密碼錯(cuò)誤", "40" => "賬號(hào)不存在", "41" => "余額不足", "42" => "帳戶已過期", "43" => "IP地址限制", "50" => "內(nèi)容含有敏感詞" ); if (is_numeric($result) && $result > 0) { $this->error = $result . $statusStr[$result]; return false; } return true; } |
經(jīng)過上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。進(jìn)行測試發(fā)送:

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