
Per tutti coloro che hanno e gestiscono un forum vBulletin spesso può risultare utile e necessario costruire delle nuove pagine personalizzate, con lo stesso tema e design del Forum.
Ecco per i nostri lettori una semplice guida per creare nuove pagine personalizzate in vBulletin, il miglior CMS (a pagamento) utilizzato per creare forum, community.
1. Allora per prima cosa creeremo un nuovo file php, chiamato “test.php“, con all’interno questo codice:
<?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’,
);
// 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’) . ‘”);’);
?>
// ####################### 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’,
);
// 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’) . ‘”);’);
?>
2. Carichiamo la pagina test.php via FTP nella cartella del forum (/forum)
3. Ora entriamo nel pannello di amministrazione di vBulletin e creiamo un nuovo template tramite la voce “Aggiungi nuovo modello“.
Chiamiamo il nuovo template “TEST” e all’interno inseriamo questo codice:
$stylevar[htmldoctype]
<html dir=“$stylevar[textdirection]“ lang=“$stylevar[languagecode]“>
<head>
<title>Titolo della pagina che andrà nel TITLE (in alto al browser)</title>
$headinclude
</head>
<body>
$header
$navbar
<table class=“tborder” cellpadding=“$stylevar[cellpadding]“ cellspacing=“$stylevar[cellspacing]“ border=“0″ width=“100%” align=“center”>
<tr>
<td class=“tcat”>Inserisci Titolo della pagina</td>
</tr>
<tr>
<td class=“alt1″>Inserisci Testo della pagina (in linguaggio html)</td>
</tr>
</table>
$footer
</body>
</html>
<html dir=“$stylevar[textdirection]“ lang=“$stylevar[languagecode]“>
<head>
<title>Titolo della pagina che andrà nel TITLE (in alto al browser)</title>
$headinclude
</head>
<body>
$header
$navbar
<table class=“tborder” cellpadding=“$stylevar[cellpadding]“ cellspacing=“$stylevar[cellspacing]“ border=“0″ width=“100%” align=“center”>
<tr>
<td class=“tcat”>Inserisci Titolo della pagina</td>
</tr>
<tr>
<td class=“alt1″>Inserisci Testo della pagina (in linguaggio html)</td>
</tr>
</table>
$footer
</body>
</html>
N.B.
Naturalmente potete creare tutte le pagine che volete, cambiando il nome che abbiamo utilizzato nel nostro esempio.
Per qualsiasi problema o domanda riguardo vBulletin, potete utilizzare il nostro forum di supporto ed assistenza per vBulletin


Sezioni
Vota questo articolo