Log in

View Full Version : Adding a new template?


Xia
03-20-2005, 07:07 PM
Hi,

I want to add a new template to vBulletin. This is what I tried.

- Added new template directly in database (phpmyadmin), table templates.

templateID autonumber
styleID -1
title register_choice
template <html>
<body>
<a href="http://www.example.com/forums/register.php?do=register_forumsonly">Register forums only</a>
<br>
<a href="http://www.example.com/forums/register.php?do=register_forumsandwebsite">Register forums and website</a>
</body>
</html>
template_un <html>
<body>
<a href="http://www.example.com/forums/register.php?do=register_forumsonly">Register forums only</a>
<br>
<a href="http://www.example.com/forums/register.php?do=register_forumsandwebsite">Register forums and website</a>
</body>
</html>

- Changed code in register.php


// ############################### start choice - website and forum or forum only registration ###############################
if ($_REQUEST['do'] == 'register')
{

globalize($_REQUEST, array(
'month' => INT,
'day' => INT,
'year' => INT,
'agree' => INT,
'options'
));

if (empty($agree))
{
eval(print_standard_error('register_not_agreed'));
}
if (!$vboptions['allowregistration'])
{
eval(print_standard_error('error_noregister'));
}

if ($bbuserinfo['userid'] != 0 AND !$vboptions['allowmultiregs'])
{
eval(print_standard_error('error_alreadyregistered '));
}

eval('print_output("' . fetch_template('register_choice') . '");');
}

However, when I call this code, it just displays a blank page. When i call fetch_template('register') however, it works. The title is the same as in the database, so there's no error there. Do I need to register this template elsewhere?

Thanks!

Zachery
03-20-2005, 07:13 PM
Unlike ALOT of other forum softwares, it is not recomended to edit the database for any reason, unless you have a very very specific understanding of how it works. So...

NEVER add templates directly to the database, thats what the style manager is there for.

Also... that template is not in a proper post parsed format. Remove the template and add it in directly though the style manager.

If you want to add it to the master template set, enable debug mode for the time being.

Xia
03-20-2005, 07:53 PM
Thanks for the help Zachery.

Another question, do templates get cached? I'm echoing some stuff in register.php (for debugging purposes) but it doesn't seem to change at all. Thanks