91成人在线播放_欧美一区二区视频在线观看_91精品国产高清久久久久久_国产精品久久亚洲不卡4k岛国


待發(fā)短信

在線客服
產(chǎn)品支持 短信寶客服
合作渠道 渠道合作
服務(wù)咨詢

4001-021-502

工作時(shí)間

9:00-21:00

人人店商城系統(tǒng)新增短信寶短信接口

人人商城開源框架,一款針對(duì)人人商城的一個(gè)框架搭建程序,幫助您輕松搭建想要的人人商城系統(tǒng)。今天小編就以3.10.4版本替換短信接口為例,一步一步的手把手教大家開發(fā),使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的接口,我們短信寶短信群發(fā)平臺(tái)非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用。

首先打開項(xiàng)目:\template\web\sysset\sms\set.html文件,替換22行左右的代碼:

?
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
 <div class="alert alert-info">
        <h4 style="font-weight: 500">短信提醒配置說明</h4>
   
    </div>
<div class="form-group-title">短信寶<kbd>推薦</kbd><small style="padding-left:10px;"><a target="_blank" href="http://www.gjrencai.com">立即申請(qǐng)</a></small>
        <span class="pull-right">
            <input type="hidden" value="<?php echo $item['smsbao'];?>" name="smsbao" />
            <input class="js-switch small" type="checkbox" <?php if(!empty($item['smsbao'])) {?>checked<?php  }?>/>
        </span>
    </div>
     <div class=" sms-smsbao" style="<?php  if(empty($item['smsbao'])) { ?>display: none;<?php  } ?>">
        <div class="form-group">
            <label class="col-sm-2 control-label must">短信寶帳號(hào)</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="smsbao_key" class="form-control valid" value="<?php  echo $item['smsbao_key'];?>" data-rule-required="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label must">短信寶密碼</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="smsbao_secret" class="form-control valid" value="<?php  echo $item['smsbao_secret'];?>" data-rule-required="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label must">短信寶簽名</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="smsbao_sign" class="form-control valid" value="<?php  echo $item['smsbao_sign'];?>" data-rule-required="true">
            </div>
        </div>
    </div>

接著打開項(xiàng)目:\template\web\sysset\sms\temp\post.html文件,替換44行左右代碼:

?
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
<div class="form-group">  <label class="col-sm-2 control-label {ifp 'sysset.sms.temp.edit'}must{/if}">服務(wù)商</label> <div class="col-sm-9 col-xs-12">
{ife 'sysset.sms.temp' $item} {if !empty($smsset['juhe']) || (!empty($item) && $item['type']=='juhe')} <label class="radio-inline"><input type="radio" class="sms-type" data-template="1" name="type" value="juhe" {if $item['type']=='juhe' || empty($item)}checked{/if} {if !empty($item['type'])}disabled{/if}> 聚合數(shù)據(jù)</label>{/if}                   {if !empty($smsset['dayu']) || (!empty($item) && $item['type']=='dayu')}<label class="radio-inline"><input type="radio" class="sms-type" data-template="1" name="type" value="dayu" {if $item['type']=='dayu'} checked{/if} {if !empty($item['type'])}disabled{/if}> 阿里大于(老用戶)</label>{/if}                            {if !empty($smsset['aliyun']) || (!empty($item) && $item['type']=='aliyun')} <label class="radio-inline"><input type="radio" class="sms-type" data-template="1" name="type" value="aliyun" {if $item['type']=='aliyun'} checked{/if} {if !empty($item['type'])}disabled{/if}> 阿里云短信</label> {/if}                            {if !empty($smsset['emay']) || (!empty($item) && $item['type']=='emay')}<label class="radio-inline"><input type="radio" class="sms-type" data-template="0" name="type" value="emay" {if $item['type']=='emay'} checked{/if} {if !empty($item['type'])}disabled{/if}> 億美軟通</label> {/if}                            {if !empty($smsset['smsbao']) || (!empty($item) && $item['type']=='smsbao')} <label class="radio-inline"><input type="radio" class="sms-type" data-template="0" name="type" value="smsbao" {if $item['type']=='smsbao'} checked {/if} {if !empty($item['type'])}disabled{/if}>短信寶</label>  {/if}
 <div class="help-block">注意:選擇短信服務(wù)商請(qǐng)先至 <a href="{php echo webUrl('sysset/sms/set')}" target="_blank">短信接口設(shè)置</a> 頁(yè)面設(shè)置好短信服務(wù)商的接口信息。(<span class="text-danger">保存后不可修改</span> )</div>
                        }  {else}
                              <div class='form-control-static'>{if $item['type']=='juhe'}聚合數(shù)據(jù){elseif $item['type']=='dayu'}阿里大于{elseif $item['type']=='emay'}億美軟通{elseif $item['type']=='smsbao'}短信寶{/if}</div>
                        {/if}
                    </div>
                </div>

接著打開項(xiàng)目:\core\com\sms.php文件,在48行左右增加以下代碼:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
            else if($template['type'] == 'smsbao'){
            $request array(
                '30' => '密碼錯(cuò)誤',
                '40' => '賬號(hào)不存在',
                '41' => '余額不足',
                '42' => '賬號(hào)過期',
                '43' => 'IP地址限制',
                '50' => '內(nèi)容含有敏感詞',
                '51' => '手機(jī)號(hào)碼不正確'
            );
 
            $url 'http://api.smsbao.com/sms?u='.$smsset['smsbao_key'].'&p='.md5($smsset['smsbao_secret']).'&m='.$mobile.'&c=【'.$smsset['smsbao_sign'].'】'.$params;
            
            $res file_get_contents($url);
 
            if ($res !=0) {
                return array('status'=>$res,'message'=>$request[$res]);
            }
        }

接著在209行左右添加以下代碼:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
   else if($template['type'] == 'smsbao'){
            if (empty($smsset['smsbao'])) {
                return array('status' => 0, 'message' => '未開啟短信寶!');
            }
            if (empty($smsset['smsbao_key'])) {
                return array('status' => 0, 'message' => '未填寫短信寶帳號(hào)!');
            }
            if (empty($smsset['smsbao_secret'])) {
                return array('status' => 0, 'message' => '未填寫短信寶密碼!');
            }
            if (empty($smsset['smsbao_sign'])) {
                return array('status' => 0, 'message' => '未填寫短信寶簽名!');
            }
          }

最后在319行左右添加以下代碼:

?
1
2
3
4
5
6
7
 if ($type == 'smsbao') {
            $template $template['content'];
            foreach ($data as $key => $value) {
                $template str_replace('{'.$key.'}'$value$template);
            }
            $result $template;
        }

經(jīng)過上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。進(jìn)行測(cè)試發(fā)送:

報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。

另外:我們已經(jīng)開發(fā)好完整的人人商城系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程

開源插件

最新更新

電商類

CMS類

微信類

文章標(biāo)簽