vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding a new template? (https://vborg.vbsupport.ru/showthread.php?t=78455)

Xia 03-20-2005 07:07 PM

Adding a new template?
 
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
Code:

<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
Code:

<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

Code:

// ############################### 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


All times are GMT. The time now is 11:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01046 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete