PDA

View Full Version : Quick question regarding variable registration


Mythotical
01-18-2010, 12:27 AM
Does anything in this need to be registered or pre-registered?

Plugin hook location - profile_start:
if ($_REQUEST['do'] == 'ignoredthreadslist')
{
construct_usercp_nav('ignoredthreadslist');
$navbits[''] = $vbphrase['ignored_threads_list'];
$templatename = 'usercp_ignoredthreadslist';
}

if ($_REQUEST['do'] == 'ignorethread' || $_REQUEST['do'] == 'unignorethread')
{
$templatename = 'bogus';
}

How would I preregister variables without having to use a created template?

BBR-APBT
01-18-2010, 01:01 AM
This looks more correct to me:

if ($_REQUEST['do'] == 'ignoredthreadslist')
{
construct_usercp_nav('ignoredthreadslist');
$navbits[''] = $vbphrase['ignored_threads_list'];
$templater = vB_Template::create('usercp_ignoredthreadslist');
$templater->register_page_templates();
$templater->register('templatevar',$templatevar);
$templatename = $templater->render();
}

if ($_REQUEST['do'] == 'ignorethread' || $_REQUEST['do'] == 'unignorethread')
{
$templater = vB_Template::create('bogus');
$templater->register_page_templates();
$templater->register('templatevar',$templatevar);
$templatename = $templater->render();
}

Mythotical
01-18-2010, 01:11 AM
Thanks BBR-APBT, now the question I added was how to preregister variables without doing all the template creating of a custom template, etc?

--------------- Added 1263784378 at 1263784378 ---------------

And I have read this thread https://vborg.vbsupport.ru/showthread.php?t=228078 multiple times but it doesn't mention doing preregister without having to register a created template.