hadsky是一個原創(chuàng)開源輕系統(tǒng), 致力于為用戶提供簡單的解決方案。小編對他還是比較了解的,今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開發(fā),我們今天講解的是使用的短信接口是我們短信寶短信群發(fā)平臺的短信接口,我們短信寶短信群發(fā)平臺的接口非常穩(wěn)定,發(fā)送速度快,注冊就送測試短信,推薦大家使用。
打開項(xiàng)目:\app\hadskycloudserver\phpscript\sms_send.php 修改請求發(fā)送短信方法
|
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
|
//請求發(fā)送短信if (!empty($_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_USER']) && !empty($_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_PASS']) && !empty($_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_SIGN'])) { $content = '【'.$_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_SIGN'].'】 您的驗(yàn)證碼為:'.$code.',請妥善保存。'; $url = 'http://api.smsbao.com/sms?u='.$_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_USER'].'&p='.md5($_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_PASS']).'&m='.$phonenumber.'&c='.$content; $ret = file_get_contents($url); if ($ret == 0) { $r['state'] = 'ok'; }else{ $r['state'] = $ret; }}else{$_apiurl = "http://www.hadsky.com/index.php?c=app&a=zhanzhang:index3&s=sendsms&domain={$_G['SYSTEM']['DOMAIN']}&code={$code}&phonenumber={$phonenumber}&sitekey=" . md5($_G['SET']['APP_HADSKYCLOUDSERVER_SITEKEY'] . $_G['SYSTEM']['DOMAIN']);$r = json_decode(GetPostData($_apiurl, '', 10), TRUE);//$r = json_decode(file_get_contents($_apiurl));}if ($r['state'] == 'ok') { $r = array('state' => 'ok', 'msg' => '發(fā)送成功'); setcookie('APP_PUYUETIAN_SMS_TIME', TRUE, time() + 60);} else { $r = array('state' => 'no', 'msg' => $r['datas']['msg']);}//記錄發(fā)送記錄$_G['TABLE']['APP_PUYUETIAN_SMS_RECORD'] -> newData(array('pn' => $phonenumber, 'ip' => getClientInfos('ip'), 'state' => $r['state'], 'msg' => $r['msg'], 'date' => date('Ymd'), 'datetime' => date('Y-m-d H:i:s')));exit(json_encode($r)); |
打開項(xiàng)目:\app\hadskycloudserver\setting.hst 在126行左右增加短信寶頁面
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<div class="pk-row pk-padding-bottom-15"> <label class="pk-w-sm-3 pk-padding-top-5 pk-text-bold pk-text-right pk-text-nowrap">短信寶用戶名</label> <div class="pk-w-sm-8"> <input class="pk-textbox" type="text" name="app_puyuetian_sms_smsbao_user" value="{$_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_USER']}" placeholder="請?zhí)顚懚绦艑氂脩裘?quot;> </div> </div> <div class="pk-row pk-padding-bottom-15"> <label class="pk-w-sm-3 pk-padding-top-5 pk-text-bold pk-text-right pk-text-nowrap">短信寶密碼</label> <div class="pk-w-sm-8"> <input class="pk-textbox" type="text" name="app_puyuetian_sms_smsbao_pass" value="{$_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_PASS']}" placeholder="請?zhí)顚懚绦艑毭艽a"> </div> </div> <div class="pk-row pk-padding-bottom-15"> <label class="pk-w-sm-3 pk-padding-top-5 pk-text-bold pk-text-right pk-text-nowrap">短信寶簽名</label> <div class="pk-w-sm-8"> <input class="pk-textbox" type="text" name="app_puyuetian_sms_smsbao_sign" value="{$_G['SET']['APP_PUYUETIAN_SMS_SMSBAO_SIGN']}" placeholder="請?zhí)顚懚绦艑毢灻?quot;> </div> </div> |
好了經(jīng)過以上的添加,短信寶hadsky_v7.3.1系統(tǒng)增加手機(jī)驗(yàn)證就已經(jīng)安裝成功,可以正常使用了
報備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會人工審核,短信內(nèi)容3~5秒就可送達(dá)。
另外:我們已經(jīng)開發(fā)好完整的hadsky_v7.3.1系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程。
最新更新
電商類
CMS類
微信類