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


待發短信

在線客服
產品支持 短信寶客服
合作渠道 渠道合作
服務咨詢

4001-021-502

工作時間

9:00-21:00

zzzphpV2.18新增短信寶短信接口

zzzphp是一款開源的跨平臺網站內容管理系統,他是基于PHP+MYSQL開發的 ,是一套非常適合用做系統建站或者進行二次開發的程序核心,小編對他還是比較了解的,今天小編就以新增短信接口為例,給大家講解一下如何進行二次開發,我們今天講解的是2.1.8版本,使用的短信接口是我們短信寶短信群發平臺的短信接口,我們短信寶短信群發平臺的接口非常穩定,發送速度快,注冊就送測試短信,推薦大家使用。
1:打開項目:\admin\template\systemedit.tpladmin不是安裝默認目錄,可根據實際情況尋找)添加短信寶設置頁面

1
2
3
4
5
6
<div class="col-sm-4">
    <select  class="form-control" name="smsserver">
       <option value="1"  {$check_onoff [c smsserver],"selected",'',1}>短信寶</option>
       <option value="2"  {$check_onoff [c smsserver],"selected",'',2}>阿里云</option>
    </select>
</div>

2:打開項目:\inc\zzz_main.php 替換短信發送函數send_sms

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
function send_sms( $mobile, $content ) {
    $url = ";
    if ( conf( 'smsmark' ) == 0 )exit;
    $t0 = time();
    $t1 = get_session( 'smstime' );
    $t2 = 59 - ( $t0 - $t1 );
    $ip = ip();
    if ( $t2 > 0 )die( '0請等待' . $t2 . '秒再嘗試' );
    if ( empty( $_SESSION[ 'code' ] ) )die( '0警報:正在嘗試刷短信,已通知管理員并將你加入黑名單。' );
    $prevtime = strtotime( db_select( 'sms''smsaddtime', array( 'smsip' => $ip ), array( 'id' => 'desc' ) ) );
    $t3 = $t0 - $prevtime;
    if ( $t3 < 60 )die( '0請不要嘗試連續請求!' );
    $smsid = conf( 'smsid' );
    $smspw = md5(conf( 'smspw' ));
    $content = '【'.conf( 'smssign' ).'】'.$content;
//  $post_string = "uid=" . $smsid . "&auth=" . $smspw . "&mobile=" . $mobile . "&msg=" . $content . "&expid=0&encode=utf-8";
    $sendurl = $url."sms?u=".$smsid."&p=".$smspw."&m=".$mobile."&c=".urlencode($content);
    $data = file_get_contents($sendurl);
//  $sms_data = splits( $data, ',' );
    //curl_close($ch);
    switch ($data) {
        case "0":
            $tempstr = "1發送成功";
            break;
        default:
            $tempstr = "0發送失敗";
    }
    set_session( 'smstime', $t0 );
    db_exec( "insert into [dbpre]sms(smsmobile,smscontent,smsip,smsaddtime,smsbackinfo,smsonoff,smsid,smspw)values('" . $mobile . "','" . $content . "','" . $ip . "','" . date( 'Y-m-d H:i:s' ) . "','" . $tempstr . "'," . cleft( $tempstr, 0, 1 ) . ",'" . $smsid . "','" . hidestr( $smspw, 8 ) . "')" );
    return $tempstr;
}

經過上面的替換,短信寶的短信平臺已經替換成功了,可以正常使用了。進行測試發送:

報備一下短信寶的VIP模板,這樣就可以走短信寶的優質通道了,即便遇到敏感文字我們都不會人工審核,短信內容3~5秒就可送達。

另外:我們已經開發好完整的zzzphpV2.18系統短信寶插件,點擊此鏈接?下載及查看安裝流

開源插件

最新更新

電商類

CMS類

微信類

文章標簽