待发短信

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

4001-021-502

工作时间

9:00-21:00

发货100V1.1新增短信短信接口

发货100是基于php+mysql为核心开发的免费+开源的虚拟商品自动发货系统,小编对这款系统还比较了解,今天就以替换短信接口为例为大家讲解一下如何进行二次开发,使用的短信接口是我们短信宝短信群发平头的短信接口,我们短信宝短信群发平台非常稳定,发送速度快,注册就送测试短信,推荐大家使用。
1:打开项目:\admin\config.php 大概668行,修改获取余额函数

1
2
3
4
5
6
7
8
9
10
11
if($C_codeid=="" || $C_codekey==""){
    $sms_rest="<font color='#ff0000'>未知</font>";
}else{
    $info=GetBody("https://www.smsbao.com/query?u=".$C_codeid."&p=".md5($C_codekey),"","GET");
    $info = explode(',',$info);
    if(isset($info[1]) && $info[1]>0){
        $sms_rest=$info[1];
    }else{
        $sms_rest="<font color='#ff0000'>未知</font>";
    }
}

2:在当前项目大概1811行 修改短信页面

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
<p style="text-align: center;font-weight: bold;font-size: 17px">短信接口</p>
<div class="form-group row">
    <label class="col-md-3 col-form-label">短信签名</label>
    <div class="col-md-9">
        <input type="text"  name="C_smssign" class="form-control" value="<?php echo $C_smssign?>">
    </div>
</div>
<!--<div class="form-group row">-->
<!--    <label class="col-md-3 col-form-label">企业ID</label>-->
<!--    <div class="col-md-9">-->
<!--        <input type="text"  name="C_userid" class="form-control" value="--><?php //echo $C_userid?><!--">-->
<!--    </div>-->
<!--</div>-->
<div class="form-group row">
    <label class="col-md-3 col-form-label">短信宝账号</label>
    <div class="col-md-9">
        <input type="text"  name="C_codeid" class="form-control" value="<?php echo $C_codeid?>">
    </div>
</div>
<div class="form-group row">
    <label class="col-md-3 col-form-label">短信宝密码</label>
    <div class="col-md-9">
        <input type="text"  name="C_codekey" class="form-control" value="" <?php if($C_codekey!=""){echo "placeholder=\"已加密保存,留空则不修改\"";}?>>
    </div>
</div>

3:打开项目:\conn\function.php 大概3358行 修改sendsms函数

1
2
3
4
5
6
7
8
9
10
11
12
13
function sendsms($content,$recieve){
    global $C_userid,$C_codeid,$C_codekey;
    if(time()-intval($_SESSION["time"])>60){
        $info=getbody("http://api.smsbao.com/sms?u=".$C_codeid."&m=".$recieve."&c=".urlencode($content)."&p=".md5($C_codekey),"","POST");
        if ($info == '0'){
            $_SESSION["time"]=time();
            return "success";
        }
        return "error";
    }else{
        return "发送短信过于频繁,请".(60-time()+intval($_SESSION["time"]))."秒后再试!";
    }
}

经过上面的替换,短信宝的短信平台已经替换成功了,可以正常使用了。进行测试发送:

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

另外:我们已经开发好完整的发货100v1.1短信宝插件,点击此链接 下载及查看安装流

开源插件

最新更新

电商类

CMS类

微信类

文章标签