When I add the code from the readme to template,php, I get this text while the page is loading (and after the page loads, it appears above the header area):
// Removes User tab from Search (replaced by the ProfilePlus "User Profile" tab) /** * Override or insert PHPTemplate variables into the templates. */ function _phptemplate_variables($hook, $vars) { if ($hook == 'page') { bluemarine_removetab('Users', $vars); // replace "aquamarine" to switch themes return $vars; } return array(); } /** * Removes a tab */ function bluemarine_removetab($label, &$vars) { // replace themename with your theme's name $tabs = explode("\n", $vars['tabs']); $vars['tabs'] = ''; foreach($tabs as $tab) { if(strpos($tab, '>' . $label . '<') === FALSE) { $vars['tabs'] .= $tab . "\n"; } } }
This is the entirety of my template.php:
// Removes User tab from Search (replaced by the ProfilePlus "User Profile" tab)
/**
* Override or insert PHPTemplate variables into the templates.
*/
function _phptemplate_variables($hook, $vars) {
if ($hook == 'page') {
bluemarine_removetab('Users', $vars); // replace "bluemarine" to switch themes
return $vars;
}
return array();
}
/**
* Removes a tab
*/
function bluemarine_removetab($label, &$vars) { // replace "bluemarine" with your theme's name
$tabs = explode("\n", $vars['tabs']);
$vars['tabs'] = '';
foreach($tabs as $tab) {
if(strpos($tab, '>' . $label . '<') === FALSE) {
$vars['tabs'] .= $tab . "\n";
}
}
}
Thoughts? Is there something I'm supposed to put in my template.php before these functions are added? Thanks.
Comments
Comment #1
icecreamyou commentedI'm going to say this is critical. It's really confusing for users. There's not even a message (custom or not) that instructs users what the difference is.
Comment #2
brenda003You need to put <?php at the top of your file.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
pablo demono commentedI had the same problem, and I solved in my way:
In my configuration $line is set to '1'. You should try 1-3 or 2-4 depending on your theme.