Girando sul web ho trovato molti proprietari di
forum vBulletin che chiedevano come creare una pagina sul loro forum mantenendo header e footer, menù inclusi.
La procedura è spiegata
quì in inglese ma la ripropongo in italiano.
La prima cosa da fare è creare un file chiamandolo test.php con 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') . '");');
?>
Una volta creato bisogna fare l'upload nella cartella del forum.
Dopo bisogna andare in ACP>Stili e Modelli>Gestione stili e selezionare la voce "Aggiungi nuovo modello" nel menù a tendina, come nell'immagine seguente
Assegnargli come nome TEST (in maiuscolo) e come codice si inserisce questo
Codice:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - Titolo che andrà nel tag title</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">Titolo pagina</td>
</tr>
<tr>
<td class="alt1">Testo da inserire in formato html</td>
</tr>
</table>
$footer
</body>
</html>
Ora hai la tua pagina personalizzata.
Ovviamente test.php e TEST sono da cambiare con il nome che preferisci assegnargli. Stai attento però, vBulletin è case-sensitive e fa distinzione tra le variabili scritte in MAIUSCOLO o minuscolo quindi se scrivi TEST e test li riconosce come due templates differenti e non riesce a collegarsi!