• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Mod up bài viết tự động trên vBB bằng SMS - Như 5giây.vn

tubotocdo

Active Member
Mod gửi bài viết tự động trên vBB bằng SMS - Như 5giây.vnCài đặt:Tạo một file sms_up.php trên thư mục chính của vBB với nội dung

Code:
[COLOR=#000000][COLOR=#0000BB]<?php
[/COLOR][COLOR=#FF8000]/**
*
* @package SMS Auto Up
* @version $Id: sms_up.php 0000 2009-10-13 13:0:54Z tctshare $
* @copyright (c) 2009 TCT
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @Thiet lap
*/
[/COLOR][COLOR=#0000BB]$dauso[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"0"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//dat gia tri la 0 de bo qua chuc nang kiem tra dau so. Ex: 8017,...
[/COLOR][COLOR=#0000BB]$keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"FIBO TCT"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//Dung chu in hoa
[/COLOR][COLOR=#0000BB]$ip[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"0"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//dat gia tri la 0 de bo qua chuc nang kiem tra ip. Ex: 112.78.7.18
[/COLOR][COLOR=#0000BB]$time[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//Thoi han. Don vi mac dinh la giay (seconds).
[/COLOR][COLOR=#0000BB]$donvi[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"seconds"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//week/days/hours/seconds

/**
* @ignore
*/
//define('IN_VBB', true);
[/COLOR][COLOR=#007700]include([/COLOR][COLOR=#DD0000]"includes/config.php"[/COLOR][COLOR=#007700]);
    [/COLOR][COLOR=#0000BB]$link [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_connect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'MasterServer'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'servername'[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'MasterServer'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'username'[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'MasterServer'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'password'[/COLOR][COLOR=#007700]]) or die([/COLOR][COLOR=#DD0000]"Couldn't make connection."[/COLOR][COLOR=#007700]);
    [/COLOR][COLOR=#0000BB]$db [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_select_db[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'Database'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'dbname'[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]$link[/COLOR][COLOR=#007700]) or die([/COLOR][COLOR=#DD0000]"Couldn't select database"[/COLOR][COLOR=#007700]);
function [/COLOR][COLOR=#0000BB]create_table[/COLOR][COLOR=#007700]() {
    [/COLOR][COLOR=#0000BB]$sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'ALTER TABLE `thread` ADD `sms_up` INT(10) NOT NULL DEFAULT \'0\';'[/COLOR][COLOR=#007700]; ;
    [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]) or die([/COLOR][COLOR=#0000BB]mysql_error[/COLOR][COLOR=#007700]());
}
if (![/COLOR][COLOR=#0000BB]defined[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'IN_VBB'[/COLOR][COLOR=#007700]))
{
    function [/COLOR][COLOR=#0000BB]tinnhan[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$phone[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$service[/COLOR][COLOR=#007700]) {
        die ([/COLOR][COLOR=#DD0000]"<ClientResponse>
            <Message>
               <PhoneNumber>$phone</PhoneNumber>
               <Message>$noidung</Message>
               <SMSID> -1</SMSID>
               <ServiceNo>$service</ServiceNo>
            </Message>
            </ClientResponse>"[/COLOR][COLOR=#007700]);  
    }
    
    [/COLOR][COLOR=#0000BB]$phone[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]$_REQUEST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'phone'[/COLOR][COLOR=#007700]];
    [/COLOR][COLOR=#0000BB]$service[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]$_REQUEST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'service'[/COLOR][COLOR=#007700]];
    if (([/COLOR][COLOR=#0000BB]$dauso[/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]&&[/COLOR][COLOR=#0000BB]$_REQUEST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'port'[/COLOR][COLOR=#007700]]!=[/COLOR][COLOR=#0000BB]$dauso[/COLOR][COLOR=#007700])||([/COLOR][COLOR=#0000BB]$ip[/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]&&[/COLOR][COLOR=#0000BB]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]"REMOTE_ADDR"[/COLOR][COLOR=#007700]]!=[/COLOR][COLOR=#0000BB]$ip[/COLOR][COLOR=#007700])) {
        die ([/COLOR][COLOR=#DD0000]"ip, dau so hoac keyword bi cam tuy cap"[/COLOR][COLOR=#007700]);
    }
    [/COLOR][COLOR=#0000BB]$tmp[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]explode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$keyword[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]' '[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]strtoupper[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$_REQUEST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'message'[/COLOR][COLOR=#007700]]));
    if (!isset([/COLOR][COLOR=#0000BB]$tmp[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]])) {
        [/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"Tin nhan sai cu phap"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//Co the sua doi noi dung
        [/COLOR][COLOR=#0000BB]tinnhan[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$phone[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$service[/COLOR][COLOR=#007700]);
    }
    [/COLOR][COLOR=#0000BB]$id[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]$tmp[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]];
    [/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"SELECT * FROM thread where threadid='$id'"[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000BB]$result [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]);
    if([/COLOR][COLOR=#0000BB]mysql_num_rows[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$result[/COLOR][COLOR=#007700])!=[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]) {
        [/COLOR][COLOR=#0000BB]$sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'UPDATE `thread` SET `lastpost` = \''[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]time[/COLOR][COLOR=#007700]().[/COLOR][COLOR=#DD0000]'\' WHERE threadid='[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$id[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]''[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]);
        [/COLOR][COLOR=#0000BB]$time_up [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]strtotime[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"+$time $donvi"[/COLOR][COLOR=#007700]);        
        [/COLOR][COLOR=#0000BB]$sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"UPDATE `thread` SET `sms_up`= "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$time_up[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]" WHERE `thread`.`threadid` = '$id'"[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]) or [/COLOR][COLOR=#0000BB]create_table[/COLOR][COLOR=#007700]();
        [/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"Ban da nhan tin update cho bai viet so $id. Bai viet se tu dong up trong $time gio"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//Co the sua doi noi dung
        [/COLOR][COLOR=#0000BB]tinnhan[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$phone[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$service[/COLOR][COLOR=#007700]);
    } else {
        [/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"ID:$id khong ton tai. Vui long kiem tra lai cu phap."[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#FF8000]//Co the sua doi noi dung
        [/COLOR][COLOR=#0000BB]tinnhan[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$phone[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$noidung[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$service[/COLOR][COLOR=#007700]);
    }
} else {
    [/COLOR][COLOR=#0000BB]$sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'SELECT `threadid`, `sms_up` FROM `thread` WHERE `sms_up`>='[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]time[/COLOR][COLOR=#007700]().[/COLOR][COLOR=#DD0000]' ORDER BY `thread`.`sms_up` ASC'[/COLOR][COLOR=#007700]; 
    [/COLOR][COLOR=#0000BB]$result [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]) or [/COLOR][COLOR=#0000BB]create_table[/COLOR][COLOR=#007700]();
    [/COLOR][COLOR=#0000BB]$i[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]time[/COLOR][COLOR=#007700]();
    while([/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]mysql_fetch_row[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$result[/COLOR][COLOR=#007700])) {
        [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]thread[/COLOR][COLOR=#007700]];
        [/COLOR][COLOR=#0000BB]$sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'UPDATE `thread` SET `lastpost` = \''[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$i[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]'\' WHERE threadid='[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]''[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$sql[/COLOR][COLOR=#007700]);
        [/COLOR][COLOR=#0000BB]$i[/COLOR][COLOR=#007700]++;
    }
}[/COLOR][/COLOR]

Sau đó thực hiện cấu hình một số biến như $dauso, $keyword, $ip, $time, $donvi cho phù hợp với dịch vụ của bạn.

Ví dụ bạn dùng keyword FIBO TCT của đầu số 8017, ip hiện tại của hệ thống sms gateway là 112.78.7.18 và thời gian được up tự động là 1 giờ thì bạn cấu hình lại

Code:
[COLOR=#000000][COLOR=#0000BB]$dauso[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"8017"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"FIBO TCT"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$ip[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"112.78.7.18"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$time[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$donvi[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"hours"[/COLOR][COLOR=#007700];  [/COLOR][/COLOR]

*Chế độ auto có thể sẽ làm chậm hệ thống nếu host không đủ mạnh. bạn có thể tắt bằng cách set biến $time=0;

Mở file forumdisplay.php tìm dòng

Code:
[COLOR=#000000][COLOR=#0000BB]define[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'CSRF_PROTECTION'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]true[/COLOR][COLOR=#007700]);  [/COLOR][/COLOR]


thêm vào dòng bên dưới
Code:
[COLOR=#000000][COLOR=#0000BB]define[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'IN_VBB'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]true[/COLOR][COLOR=#007700]);
include([/COLOR][COLOR=#DD0000]"sms_up.php"[/COLOR][COLOR=#007700]);  [/COLOR][/COLOR]

Bạn sửa đổi các phần văn bản mà phía sau có dòng "//Co the sua doi noi dung" thành nội dung phù hợp với diễn đàn của bạn.

Sau khi cài xong bạn có thể vào sửa đổi giao diện để thông báo cho thành viến khi vào xem bài viết.

Vì chỉ là bản alpha nên có thể sẽ có lỗi xảy ra. Rất mong nhận được phản hồi từ các bạn

Bạn có thể tải sẵn file sms_up.php đính kèm dưới bài viết.

Chúc các bạn triển khai hiệu quả.
support by FIBO
 
Á cái này msv cũng có.sms gửi b.v lên d.đàn...thak a hoà
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top