Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

MẠNG QUẢNG CÁO RAO VẶT TRỰC TUYẾN - ĐỊA ĐIỄM DU LỊCH HẤP DẪN


You are not connected. Please login or register

Code tự động cập nhật tin tức từ diễn đàn ra trang chủ

Go down  Thông điệp [Trang 1 trong tổng số 1 trang]

Admin

avatar
Admin
Admin

Code tự động cập nhật tin tức từ diễn đàn ra trang chủ

Bạn tạo file getnews.php ngang hàng file index.php với nội dung là
Code:

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('CSRF_PROTECTION', true);
require_once('./global.php');

echo $stylevar[htmldoctype];
echo "";
echo "";
echo "
body
{
background: #ffffff;
color: #000000;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
margin: 0px;
padding: 6px;
}
a:link
{
color: red;
text-decoration: none;
}

";
echo "";
echo "";

// #################### Lay Bai Moi #######################
if ($_REQUEST['do'] == 'thongbao')
{
$ketqua = 10;
$boxid = '2,3';
$latestpostq = $vbulletin->db->query_read("SELECT threadid,title FROM ". TABLE_PREFIX ."thread WHERE forumid IN ($boxid) AND visible = 1 ORDER BY dateline DESC LIMIT $ketqua");
while ($latestpost = $vbulletin->db->fetch_array($latestpostq))
{
echo "
[url=http://domain.com/showthread.php?t=%22.$latestpost[]".$latestpost['title']."[/url][url=http://domain.com/showthread.php?t=%22.$latestpost[]";
}
}

echo "";
echo "";
?>
$ketqua = 10; // SO luong bai moi
$boxid = '2,3'; // Id cac' box
xong để chèn vào trang nhạc bạn dùng


Với code trên bạn có thể làm nhiều mục bài viết mới khác, vd[/url]
Code:

[url=http://domain.com/showthread.php?t=%22.$latestpost[]// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);


// #################### DEFINE IMPORTANT CONSTANTS #######################
define('CSRF_PROTECTION', true);
require_once('./global.php');
echo $stylevar[htmldoctype];
echo "";
echo "";
echo "
body
{
background: #ffffff;
color: #000000;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
margin: 0px;
padding: 6px;
}
a:link
{
color: red;
text-decoration: none;
}

";
echo "";
echo "";

// #################### Thong Bao #######################
if ($_REQUEST['do'] == 'thongbao')
{
$ketqua = 10;
$boxid = '2,3';
$latestpostq = $vbulletin->db->query_read("SELECT threadid,title FROM ". TABLE_PREFIX ."thread WHERE forumid IN ($boxid) AND visible = 1 ORDER BY dateline DESC LIMIT $ketqua");
while ($latestpost = $vbulletin->db->fetch_array($latestpostq))
{
echo "[/url]
[url=http://domain.com/showthread.php?t=%22.$latestpost[]".$latestpost['title']."[/url][url=http://domain.com/showthread.php?t=%22.$latestpost[]";
}
}
// #################### Thong Bao #######################
if ($_REQUEST['do'] == 'congnghethongtin')
{
$ketqua = 20;
$boxid = '6,7';
$latestpostq = $vbulletin->db->query_read("SELECT threadid,title FROM ". TABLE_PREFIX ."thread WHERE forumid IN ($boxid) AND visible = 1 ORDER BY dateline DESC LIMIT $ketqua");
while ($latestpost = $vbulletin->db->fetch_array($latestpostq))
{
echo "[/url]
[url=http://domain.com/showthread.php?t=%22.$latestpost[]".$latestpost['title']."[/url][url=http://domain.com/showthread.php?t=%22.$latestpost[]";
}
}

echo "";
echo "";
?>

[/url]

https://websitedanang.forumvi.com

Về Đầu Trang  Thông điệp [Trang 1 trong tổng số 1 trang]

Permissions in this forum:
Bạn không có quyền trả lời bài viết