• 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.

Tạo 1 trang custome vbulletin powered

Admin

Well-Known Member
Staff member
Administrator
//============================/
//Create your own VBulletin Custome Pages
//Moonlight Knight
//============================\
MK xin trình bày cách tạo 1 trang vbb mới với đầy đủ header,navbar,footer,thậm chí cả phân quyền user nữa.
Step 1 : Tạo 1 trang php,đặt tên tùy ý,ở đây mình demo là test.php
PHP:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);
// get special data templates from the datastore
$specialtemplates = array(
    
);
// pre-cache templates used by all actions
$globaltemplates = array(
    'TEST_PAGE',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits[$parent] = 'Test Page';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST_PAGE') . '");');
?>
Chú ý "TEST_PAGE" ,đây chính là template mình bạn sẽ tạo để hiển thị.
Step 2 : Tạo 1 template trong vbb options,đặt tên "TEST_PAGE" ,đây sẽ là template bạn muốn hiển thị .
PHP:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
      <td class="smallfont">Hello,I'm MK</td>
</tr>
</table>
$footer
</body>
</html>
He he,vậy là với template trên,ta đã có 1 trang vbb mới tự tạo test.php,xuất ra màn hình 1 table với row "Hello,I'm MK" như 1 trang vbb chính gốc.
//============================/
//End here
//============================\
 

Facebook Comments

New posts New threads New resources

Back
Top