微擎是一款免費開源的公眾平臺管理系統,基于web2.0技術架構,他有很多的擴展模塊,二次開發也非常方便,小編最近發現微擎升級到了2.7.0版本,今天小編就以微擎2.7.0版本的替換短信接口為例告訴大家如何進行二次開發,使用的短信接口是我們短信寶短信群發平臺的接口,我們短信寶短信群發平臺非常穩定,發送速度快,注冊就送測試短信,推薦大家使用
1:打開項目:\web\themes\default\system\user-setting.html 新增短信寶接口頁
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{ if $ do == 'sms' } <div id= "sms" > <div class= "form-group" > <label class= "col-sm-2 control-label" style= "text-align:left;" >短信寶賬號</label> <div class= "col-sm-8" > <input type= "text" name= "sms_name" class= "form-control" value= "{$settings['sms_name']}" /> <span class= "help-block" >沒有短信寶賬號?點擊<a class= "btn btn-primary span3" target= "_blank" href= "http://www.gjrencai.com" >免費注冊</a></span> </div> </div> <div class= "form-group" > <label class= "col-sm-2 control-label" style= "text-align:left;" >短信寶密碼</label> <div class= "col-sm-8" > <input type= "password" name= "sms_password" class= "form-control" value= "{$settings['sms_password']}" /> </div> </div> <div class= "form-group" > <label class= "col-sm-2 control-label" style= "text-align:left;" >短信簽名</label> <div class= "col-sm-8" > <input type= "text" name= "sms_sign" class= "form-control" value= "{$settings['sms_sign']}" /> </div> </div> </div> {/ if } |
2:打開項目:\web\themes\default\system\user-setting-header.html 修改大致在第6行代碼
1
2
3
4
5
6
|
<ul class= "we7-page-tab" > <!--<li { if $type == 'system' }class= "active" {/ if }><a href= "{php echo url('system/thirdlogin', array('type' => 'system'))}" >系統登錄</a></li>--> <li { if $action == 'registerset' && $ do == 'display' }class= "active" {/ if }><a href= "{php echo url('user/registerset/display');}" >登錄/注冊設置</a></li> <li { if $action == 'thirdlogin' }class= "active" {/ if }><a href= "{php echo url('system/thirdlogin')}" >第三方配置</a></li> <li { if $ do == 'clerk' }class= "active" {/ if }><a href= "{php echo url('user/registerset/clerk')}" >應用操作員登錄/注冊設置</a></li> <li { if $ do == 'sms' }class= "active" {/ if }><a href= "{php echo url('system/usersetting', array('do' => 'sms'))}" >短信配置</a></li> |
3:打開項目:\web\source\system\usersetting.ctrl.php 在16行左右新增短信配置
1
2
3
4
5
6
7
8
9
10
11
|
if ($ do == 'sms' ) { $_W[ 'page' ][ 'title' ] = '短信配置' ; if (checksubmit( 'submit' )) { $settings[ 'sms_name' ] = $_GPC[ 'sms_name' ]; $settings[ 'sms_password' ] = $_GPC[ 'sms_password' ]; $settings[ 'sms_sign' ] = $_GPC[ 'sms_sign' ]; setting_save($settings, 'copyright' ); itoast( '更新設置成功!' , '' , 'success' ); } } |
經過上面的替換,短信寶的短信平臺已經替換成功了,可以正常使用了。進行測試發送:
報備一下短信寶的VIP模板,這樣就可以走短信寶的優質通道了,即便遇到敏感文字我們都不會人工審核,短信內容3~5秒就可送達。
另外:我們已經開發好完整的微擎V_2.7.0系統短信寶插件,點擊此鏈接 下載及查看安裝流程。
最新更新
電商類
CMS類
微信類