佳緣人才網(wǎng)是面向廣大政府、企業(yè)、職介行業(yè)提供全面的人才網(wǎng)站建設(shè)、管理、運(yùn)營(yíng)一體化解決方案,采用PHP5 + MYSQL5運(yùn)行環(huán)境,軟件百分百開源易于二次開發(fā),可靈活擴(kuò)展; 其安裝簡(jiǎn)單方便,只需將程序上傳至服務(wù)器后加以配置即可使用。小編對(duì)他還是比較了解的,今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開發(fā),我們今天講解的是V3.6.0版本,使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信群發(fā)平臺(tái)的接口非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用。
打開項(xiàng)目:\admin\templates\plus\sms.htm 在33行左右新增短信寶頁(yè)面
1
2
3
4
5
6
7
8
9
10
11
12
|
<form action= "?m=plus_sms&a=smsconfig" method= "post" > <td class = "pl20" ><b>接口配置:</b>接口服務(wù)器:<input name= "apiserver" type= "radio" class = "checkbox" value= "www" checked />國(guó)內(nèi) <input name= "apiserver" type= "radio" class = "checkbox" value= "api-hk" <{ if strpos ( $smarty .session.vcpserver, 'api-hk' )>0}> checked<{/ if }> />香港 帳號(hào): <input type= "text" id= "username" name= "username" size= "12" class = "txt" value= "<{$smarty.session.vcpuser}>" > 密碼: <input type= "password" id = "apikey" name= "apikey" size= "12" class = "txt" value= "888888" > 簽名: <input type= "text" id = "sing" name= "sing" size= "12" class = "txt" value= "<{$smarty.session.sing}>" > 余額:<font color= "#FF0000" ><b><{ $account }></b></font>條 <input type= "submit" value= "修改配置" class = "btn" > [<a href= "http://www.gjrencai.com/reg" target= "_blank" style= "color:#F00" >申請(qǐng)賬號(hào)</a>] 該功能需要先申請(qǐng)賬號(hào)并充值后才能使用。</td> </form> |
打開項(xiàng)目:\admin\inc\plus_sms.inc.php 在8行左右修改下代碼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
function sendSMS( $t_pho , $t_msg , $t_time ){ global $cfg ; $serverURL = $_SESSION [ "vcpserver" ]; $VCPU = $_SESSION [ "vcpuser" ]; $VCPApkey = md5( $_SESSION [ "vcpapikey" ]); $sing = $_SESSION [ "sing" ]; $content = '【' . $sing . '】' . $t_msg ; if ( $cfg [ 'charset' ]!= 'utf-8' ) $content =@iconv( 'gbk' , 'utf-8' , $content ); $strurl = $serverURL . "sms?u=" . $VCPU . "&p=" . $VCPApkey . "&m=" . $t_pho . "&c=" .urlencode( $content ); $result = file_get_contents ( $strurl ); if ( $result == 0){ return '000' ; } } function infoSMSAccount(){ $serverURL = $_SESSION [ "vcpserver" ]; $VCPU = $_SESSION [ "vcpuser" ]; $VCPApkey = md5( $_SESSION [ "vcpapikey" ]); $strurl = $serverURL . "balance?u=" . $VCPU . "&p=" . $VCPApkey ; $result = explode ( ',' , file_get_contents ( $strurl )); return $result [1]; } |
打開項(xiàng)目:\smsapi\config.php
1
2
3
4
5
6
|
<?php $_SESSION [ "vcpuser" ]= "" ; $_SESSION [ "vcpapikey" ]= "" ; $_SESSION [ "sing" ]= "" ; ?> |
經(jīng)過(guò)上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。
報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。
另外:我們已經(jīng)開發(fā)好完整的佳緣人才網(wǎng)v3.6.0系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程。
最新更新
電商類
CMS類
微信類