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


待發(fā)短信

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

4001-021-502

工作時(shí)間

9:00-21:00

海洋CMS V12.8新增短信寶短信接口

海洋cms是一套專為不同需求的站長(zhǎng)而設(shè)計(jì)的視頻點(diǎn)播系統(tǒng),靈活,方便,人性化設(shè)計(jì)簡(jiǎn)單易用是最大的特色。采用PHP+MYSQL架構(gòu),原生PHP代碼帶來(lái)卓越的訪問(wèn)速度和負(fù)載能力免去您的后顧之優(yōu)。今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開發(fā),使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信群發(fā)平臺(tái)的接口非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用
1:打開項(xiàng)目:\data\admin目錄下邊創(chuàng)建 sms.php ,代碼如下

1
<?php $smsbao_user = "短信寶用戶名"; $smsbao_pass = "短信寶密碼"; $smsbao_sign = "短信寶簽名";  ?>

2:打開項(xiàng)目系統(tǒng)的核心目錄如:/sgmtnc(每個(gè)項(xiàng)目核心目錄名可能不一樣)增加admin_sms.php 文件 代碼如下

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php   
header('Content-Type:text/html;charset=utf-8');
require_once(dirname(__FILE__)."/config.php");
CheckPurview();
if($action=="set")
{
    $weburl= $_POST['smsbao_user'];
    $token = $_POST['smsbao_pass'];
    $token = $_POST['smsbao_sign'];
    $open=fopen("../data/admin/sms.php","w" );
    $str='<?php '
    $str.='$smsbao_user = "';
    $str.="$smsbao_user";
    $str.='"; ';
    $str.='$smsbao_pass = "';
    $str.="$smsbao_pass";
    $str.='"; ';
    $str.='$smsbao_sign = "';
    $str.="$smsbao_sign";
    $str.='"; ';
    $str.=" ?>";
    fwrite($open,$str);
    fclose($open);
    ShowMsg("成功保存設(shè)置!","admin_sms.php");
    exit;
}
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>短信設(shè)置</title>
<link  href="img/style.css" rel="stylesheet" type="text/css" />
<link  href="img/style.css" rel="stylesheet" type="text/css" />
<script src="js/common.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
</head>
<body>
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后臺(tái)首頁(yè)&nbsp;&raquo;&nbsp;管理員&nbsp;&raquo;&nbsp;短信設(shè)置';</script>
<div class="r_main">
  <div class="r_content">
    <div class="r_content_1">
<form action="admin_sms.php?action=set" method="post"
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tb_style">
<tbody><tr class="thead">
<td colspan="5" class="td_title">短信設(shè)置</td>
</tr>
<tr>
<td width="80%" align="left" height="30" class="td_border">
<?php require_once("../data/admin/sms.php"); ?>
短信寶用戶名:<input  name="smsbao_user"  value="<?php echo $smsbao_user;?>">
還沒有賬號(hào)?<a href="http://www.gjrencai.com/reg"  style="color:red; " target="_blank">請(qǐng)點(diǎn)擊注冊(cè)</a>
</td>
</tr>
 
<tr>
<td width="80%" align="left" height="30" class="td_border">
短信寶密碼:<input name="smsbao_pass" value="<?php echo $smsbao_pass;?>">
</td>
</tr>
 
<tr>
<td width="80%" align="left" height="30" class="td_border">
短信寶簽名:<input name="smsbao_sign" value="<?php echo $smsbao_sign;?>">
</td>
</tr>
<tr>
<td width="90%" align="left" height="30" class="td_border">
* 如果修改無(wú)效,請(qǐng)檢查/data/admin/sms.php文件權(quán)限是否可寫。
</td>
</tr>
<tr>
<td width="10%" align="left" height="30" class="td_border">
<input type="submit" value="確 認(rèn)" class="btn" >
</td>
</tr>
</tbody></table>   
     
 
</form>
</div>
    </div>
</div>
<?php
viewFoot();
?>
</body>
</html>

3:當(dāng)前目錄同時(shí)打開inc_menu.php 大概166行 增加短信設(shè)置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'system'=>array (
    'link'=>"admin_config.php",
    0=>"系統(tǒng)",
    1=>"<a target='I2' href='admin_config.php'>網(wǎng)站設(shè)置</a>",
    2=>"",
    3=>"<a target='I2' href='admin_config_mark.php'>圖片水印設(shè)置</a>",
    4=>"<a target='I2' href='admin_datarelate.php?action=ftppic'>遠(yuǎn)程圖片設(shè)置</a>",
    5=>"",
    6=>"<a target='I2' href='admin_player.php'>播放器設(shè)置</a>",
    7=>"<a target='I2' href='../js/player/dmplayer/admin/'>彈幕播放管理</a>",
    8=>"<a target='I2' href='admin_player.php?action=boardsource'>播放來(lái)源管理</a>",
    9=>"<a target='I2' href='admin_playerdown.php?action=boardsource'>下載來(lái)源管理</a>",
    10=>"",
    11=>"<a target='I2' href='admin_manager.php'>系統(tǒng)賬號(hào)管理</a>",
    12=>"<a target='I2' href='admin_vcode.php'>后臺(tái)登陸驗(yàn)證碼</a>",
    13=>"<a target='I2' href='admin_isapi.php'>資源庫(kù)API設(shè)置</a>",
    14=>"<a target='I2' href='admin_ip.php'>后臺(tái)IP安全設(shè)置</a>",
    15=>"<a target='I2' href='admin_weixin.php'>微信公眾號(hào)設(shè)置</a>",
    16=>"<a target='I2' href='admin_smtp.php'>郵件服務(wù)器設(shè)置</a>",
    17=>"<a target='I2' href='admin_sms.php'>短信設(shè)置</a>",
),

4:打開項(xiàng)目:\templets\default\html\reg.html 增加相關(guān)代碼

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<script>
    var time = 0; // 倒計(jì)時(shí)時(shí)間
    var res = null// 倒計(jì)時(shí)資源,釋放時(shí)使用
    var sendNode = null// 發(fā)送的按鈕節(jié)點(diǎn)
    //var diffTime = "<?php echo $diff; ?>"; // 由php計(jì)算的時(shí)間差的結(jié)果。所以就算用戶刷新頁(yè)面,倒計(jì)時(shí)還是存在的。
  
    /**
     * 執(zhí)行倒計(jì)時(shí)的方法
     */
    function sendTime() {
        clearTimeout(res); // 先清空一下倒計(jì)時(shí)資源。
        time--; // 倒計(jì)時(shí)時(shí)間遞減。
  
        // 如果倒計(jì)時(shí)到達(dá)0時(shí),則恢復(fù)按鈕原來(lái)的內(nèi)容
        if (time <= 0) {
            time = "獲取驗(yàn)證碼";
            sendNode.val(time);
            clearTimeout(res);
            time = 0;
            return;
        }
        // 倒計(jì)時(shí)的內(nèi)容寫到按鈕里面
        sendNode.val("剩余" + time + "秒");
        res = setTimeout("sendTime()", 1000);
    }
  
    /**
     * 調(diào)用處
     */
    $(function() {
        sendNode = $("#get_code"); // 獲取發(fā)送的節(jié)點(diǎn)
        var flg = true// 防止ajax重復(fù)提交的標(biāo)記
        // 在頁(yè)面加載時(shí),先判斷一下是否上次倒計(jì)時(shí)未完成,由php計(jì)算,防止頁(yè)面刷新,覆蓋掉倒計(jì)時(shí)。
  
        /**
         * 點(diǎn)擊發(fā)送短信,觸發(fā)事件
         */
        sendNode.on("click"function() {
            // 如果當(dāng)前倒計(jì)時(shí)結(jié)束,則收集表單數(shù)據(jù),并ajax提交到服務(wù)端
            if (0 == time) {
                var phoneNum = $("input[name='nickname']").val();
                var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;  
                if (!myreg.test(phoneNum)) {  
                      alert('手機(jī)號(hào)碼不能為空或不正確'); 
                     return false;
                }               
                if (true) {}
                var code = $("input[name='validate']").val();
                var data = {"code" : code, "phone" : phoneNum,"Obtain" : 1};
                var err = "";
                if (flg == true) {
                    flg = false;
                    // ajax提交請(qǐng)求
                    $.ajax({
                        "url" "reg.php",
                        "type" "post",
                        "data" : data,
                        "dataType" "json",
                        "success" function (msg) {
                            $(".errmsg").text("");
                           console.log(msg);
                            if (msg == '發(fā)送成功') {
                                 time = 60;
                                sendTime();
                                alert("發(fā)送驗(yàn)證碼成功!");
                         
                            else {
                               alert('短信發(fā)送失敗,原因'+msg);
                            }
  
                                // 刷新圖形驗(yàn)證碼
                            $("#code_img").click();
                            flg = true;
                        }
                    });
                }
                return false;
            }
        });
    });
</script>

5:打開項(xiàng)目:/reg.php,增加以下代碼

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
if ($_POST['Obtain'] == '1') {
    $mobile = $_POST['phone'];
    $code = $_POST['code'];
    $phone="/^[1][3,4,5,7,8][0-9]{9}$/"
    if(!preg_match($phone,$mobile)||!$mobile)
    {
    echo json_encode("手機(jī)號(hào)不正確");       
    exit();        
    }
    if($cfg_feedback_ck=='1')
    {
    $code = empty($code) ? '' : strtolower(trim($code));
    if($code=='' || $code != $svali)
        {
            ResetVdValue();
            echo json_encode( "驗(yàn)證碼不正確");
            exit();
        }
    }  
    $pcode = rand(00000,99999);
    require_once("data/admin/sms.php"); 
//  $ret = file_get_contents($url);
    $ret = 0;
    if ($ret == 0) {
        echo json_encode('發(fā)送成功');
        $_SESSION['pcode'] = $pcode;
        exit;
    }else{
        echo json_encode('發(fā)送失敗'.$ret);
        exit;
    }
}

6:當(dāng)前文件同時(shí)修改對(duì)應(yīng)的html 大概234行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function viewRegister()
{
    $mystr=
"<ul>".
"<form id=\"f_Activation\"   action=\"/".$GLOBALS['cfg_cmspath']."reg.php?action=reg\" method=\"post\">".
"<li><input type=\"input\" name=\"m_user\" id=\"m_user\" autofocus class=\"form-control\" placeholder=\"用戶名\" /></li>".
"<li><input type=\"password\" name=\"m_pwd\" class=\"form-control\" placeholder=\"密碼\" /></li>".
"<li><input type=\"password\" name=\"m_pwd2\" class=\"form-control\" placeholder=\"確認(rèn)密碼\" /></li>".
"<li><input type=\"text\" name=\"email\" class=\"form-control\" placeholder=\"郵箱地址\" /></li>".
"<li><img id=\"vdimgck\" src=\"./include/vdimgck.php\" alt=\"看不清?點(diǎn)擊更換\" align=\"absmiddle\" class=\"pull-right\" style='width:70px; height:32px;' onClick=\"this.src=this.src+'?'\"/><input type=\"text\" name=\"validate\" id=\"vdcode\" placeholder=\"驗(yàn)證碼\" style='width:50%;text-transform:uppercase;' class=\"form-control\" /> </li>".
"<li style='display: flex;'><input type=\"text\" name=\"nickname\" id=\"phone\" placeholder=\"手機(jī)號(hào)\" style='width:50%;text-transform:uppercase;' class=\"form-control\" /> <input style='width: 30%;margin-left: 60px' class=\"pull-right btn btn-block btn-info\" value='獲取驗(yàn)證碼' id=\"get_code\"></li>".
"<li><input type=\"input\" name=\"mcode\" id=\"mcode\"  autofocus class=\"form-control\" placeholder=\"短信驗(yàn)證碼\" /></li>".
"<li><input type=\"submit\" value=\"注冊(cè)\" class=\"btn btn-block btn-warning\"/></li>".
"<li class=\"text-center\"><a class=\"text-muted\" href=\"./login.php\">已有賬號(hào),直接登錄?</a></li>".
"</form>".
"</ul>";
    return $mystr;
}

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

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

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

開源插件

最新更新

電商類

CMS類

微信類

文章標(biāo)簽