待发短信

在线客服
产品支持 短信宝客服
合作渠道 渠道合作
服务咨询

4001-021-502

工作时间

9:00-21:00

DESTOON_V8.0新增短信宝短信接口

DESTOON是一款B2B网站管理系统他是基于PHP+MYSQL,二次开发及后期维护方便,小编对这款系统还比较了解,今天就以替换短信接口为例为大家讲解一下如何进行二次开发,我们今天讲解的是8.0版本,使用的短信接口是我们短信宝短信群发平头的短信接口,我们短信宝短信群发平台非常稳定,发送速度快,注册就送测试短信,推荐大家使用。

1:打开项目:\admin\template\setting.tpl.php 新增短信宝接口

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div id="Tabs7" style="display:none">
<table cellspacing="0" class="tb">
<tr>
<td class="tl">短信宝用户名</td>
<td><input name="config[cloud_uid]" type="text" id="cloud_uid" value="<?php echo $cloud_uid;?>" size="30"/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.smsbao.com" target="_blank" class="t">[没有账号点此申请帐号]</a></td> 
</tr>
<tr>
<td class="tl">短信宝密码</td>
<td><input name="config[cloud_key]" type="text" id="cloud_key" value="<?php echo $cloud_key;?>" size="30" onfocus="if(this.value.indexOf('**')!=-1)this.value='';"/></td>
</tr>
<tr>
<td class="tl">提示信息</td>
<td class="f_red">以下云服务需要先填写正确的帐号和密钥方可开启成功</td>
</tr>
<tr>
<td class="tl">手机短信</td>
<td>
<input type="radio" name="setting[sms]" value="1"  <?php if($sms){ ?>checked <?php } ?> onclick="Ds('dsms');"/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[sms]" value="0"  <?php if(!$sms){ ?>checked <?php } ?> onclick="Dh('dsms');"/> 关闭&nbsp;&nbsp;&nbsp;&nbsp;
<a href="javascript:Dwidget('?moduleid=2&file=sendsms&action=record', '短信记录');" class="t">[查看记录]</a>
</td>
</tr>

打开项目\include\global.func.php 文件,修改send_sms方法

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function send_sms($mobile, $message, $word = 0, $time = 0) {
        global $db, $DT, $DT_TIME, $DT_IP, $_username;
        if(!$DT['sms'] || !DT_CLOUD_UID || !DT_CLOUD_KEY || !is_mobile($mobile) || strlen($message) < 5) return false;
        $word or $word = word_count($message);
        $sms_message = convert($message, DT_CHARSET, 'UTF-8');
        $data = 'u='.DT_CLOUD_UID.'&p='.md5(DT_CLOUD_KEY).'&m='.$mobile.'&c='.rawurlencode($sms_message);
        $code = dcurl('http://api.smsbao.com/sms', $data);
        if($code == 0) {
                $code = true;
        else {
                $code = 'Can Not Connect SMS Server';
        }
        $db->query("INSERT INTO {$db->pre}sms (mobile,message,word,editor,sendtime,code) VALUES ('$mobile','$message','$word','$_username','$DT_TIME','$code')");
        return $code;
}

好了经过以上的添加,短信宝DESTOON_v8.0系统增加手机验证就已经安装成功,可以正常使用了

报备一下短信宝的VIP模板,这样就可以走短信宝的优质通道了,即便遇到敏感文字我们都不会人工审核,短信内容3~5秒就可送达。

另外:我们已经开发好完整的DESTOON_v8.0系统短信宝插件,点击此链接 下载及查看安装流程。

开源插件

最新更新

电商类

CMS类

微信类

文章标签