Hi all --
A bit new to the whole 'registering' variable scene. Trying to append to a template hook in the modifyoptions template (usercp_options_start) and it's giving me a very pretty stark white page. Any clue what I'm doing wrong here? (this is on the profile_editoptions_start hook)
PHP Code:
<?php
if($vbulletin->options['username_markup_enabled']) {
$groups = explode(',', $vbulletin->options['username_markup_groupids']);
$userid = $vbulletin->userinfo['userid'];
if(in_array($vbulletin->userinfo['usergroupid'], $groups) || $vbulletin->options['username_markup_groupids'] == 'ALL') {
$colors = explode(',', $vbulletin->options['username_markup_colors']);
$styling = explode(',', $vbulletin->options['username_markup_styling']);
foreach($styling as $style) {
if($style == 'blink') {
$blink = true;
} else if($style == 'bold') {
$bold = true;
} else if($style == 'italics') {
$italics = true;
} else if($style == 'marquee') {
$marquee = true;
} else if($style == 'strikethrough') {
$strike = true;
} else {
die('Bah. You configured an invalid style type. (' . $style . ') Go fix that.<br /><br />Settings -> Options -> Username Markup Settings');
}
}
if($blink || $bold || $italics || $marquee || $strike) {
$mchecked = $vbulletin->db->query_first("SELECT markup FROM vb4." . TABLE_PREFIX . "user WHERE userid='$userid'");
$mchecked = $mchecked['markup'];
if(empty($mchecked)) {
$mchecked = array();
$mchecked['blink'] = NULL;
$mchecked['bold'] = NULL;
$mchecked['italics'] = NULL;
$mchecked['marquee'] = NULL;
$mchecked['strikethrough'] = NULL;
} else {
$mchecked = explode(',', $mchecked);
$checked = 'checked=\"checked\"';
foreach($mchecked as $num => $value) {
if($num == 0) {
if($value) {
$mchecked['blink'] = $checked;
} else {
$mchecked['blink'] = NULL;
}
} else if($num == 1) {
if($value) {
$mchecked['bold'] = $checked;
} else {
$mchecked['bold'] = NULL;
}
} else if($num == 2) {
if($value) {
$mchecked['italics'] = $checked;
} else {
$mchecked['italics'] = NULL;
}
} else if($num == 3) {
if($value) {
$mchecked['marquee'] = $checked;
} else {
$mchecked['marquee'] = NULL;
}
} else if($num == 4) {
if($value) {
$mchecked['strike'] = $checked;
} else {
$mchecked['strike'] = NULL;
}
} else {
die('Something went wrong.');
}
}
}
$menabled = $vbulletin->db->query_first("SELECT markup_enabled FROM vb4." . TABLE_PREFIX . "user WHERE userid='$userid'");
$menabled = $menabled['markup_enabled'];
if($menabled) {
$mchecked['enabled'] = true;
}
} else {
$disabled = true;
}
$templater = vB_Template::create('usernamemarkup_editoptions');
$templater->register('blink', $blink);
$templater->register('bold', $bold);
$templater->register('italics', $italics);
$templater->register('marquee', $marquee);
$templater->register('strike', $strike);
$templater->register('disabled', $disabled);
$templater->register('mchecked', $mchecked);
$template_hook['usercp_options_start'] .= $templater->render();
}
}
?>