小鸟云-ZKEYS新增短信宝短信接口
发表日期:2019-05-23 文章编辑:短信宝小编 浏览次数:
ZKEYS系统是—WIN平台下款免费的域名主机管理软件!能够提供实时的域名注册,虚拟主机、弹性云计算开通与管理!小编对他还是比较了解的,今天小编就以新增短信接口为例,给大家讲解一下如何进行二次开发,使用的短信接口是我们短信宝短信群发平台的短信接口,我们短信宝短信群发平台的接口非常稳定,发送速度快,注册就送测试短信,推荐大家使用。
首先打开项目:\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">注:为确保正常发送,请正确填写短信宝的短信通道信息!还未注册短信宝账号的请点击<a href="http://www.smsbao.com/reg" target="_blabk">免费注册</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> |
接着打开项目:\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']; //短信平台帐号 $pass = md5($this->config['apiKey']); //短信平台密码 $content=$this->config['signature'].$content;//要发送的短信内容 $phone = $mobile;//要发送短信的手机号码 $sendurl = $smsapi."u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content); $result =file_get_contents($sendurl) ; $statusStr = array( "0" => "短信发送成功", "-1" => "参数不全", "-2" => "服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!", "30" => "密码错误", "40" => "账号不存在", "41" => "余额不足", "42" => "帐户已过期", "43" => "IP地址限制", "50" => "内容含有敏感词" ); if (is_numeric($result) && $result > 0) { $this->error = $result . $statusStr[$result]; return false; } return true; } |
经过上面的替换,短信宝的短信平台已经替换成功了,可以正常使用了。进行测试发送:

报备一下短信宝的VIP模板,这样就可以走短信宝的优质通道了,即便遇到敏感文字我们都不会人工审核,短信内容3~5秒就可送达。
另外:我们已经开发好完整的小鸟云-ZKEYS系统短信宝插件,点击此链接 下载及查看安装流程。
- 上一篇:齐博CMS之X1 新增短信宝短信接口 下一篇:海洋cms新增短信宝短信接口

