إضافة صفحة جديدة بتنسيق المنتدى الجيل الرابع لـvBulletin 4.0
أول شي تصنع صفحة php تحت أي مسمى ، ولنفترض test.php .. نضع بداخلة الكود التالي ..
الكود بالمرفقات
غير الإعدادات بما يناسبك ، "TEST" أسم القالب ، و"Test Page" بأسم الصفحة الذي يظهر بالنافبار ..
ثم علينا انشاء قالب - بالأسم اللي وضعتة بملف الصفحة - فنحن أفترضنا TEST ..ووضع الكود الآتي
كود PHP:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
define('CSRF_PROTECTION', true);
// 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',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = construct_navbits(array('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', 'Test Page');
print_output($templater->render());
?>