This module works fine (finally, someone is putting the profile fields to proper use - otherwise they are not really doing much in drupal context)

until I pasted the code from the README.txt into my template.php

the wole screen went white and displayed this line:

Fatal error: Cannot redeclare _phptemplate_variables() (previously declared in C:\wamp\www\dev\sites\all\themes\garen\template.php:111) in C:\wamp\www\dev\sites\all\themes\garen\template.php on line 403

line 403 in my templete file is the one where the last "}" bracket of the following argument appears:

function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {
    themename_removetab('Users', $vars);              // replace themename with your theme's name
    return $vars;
  }
  return array();
}

it would be nice to remove that old "Users" tab in order not to confuse the end user.

Thank you very much for a great module!!!

CommentFileSizeAuthor
#4 template.php__3.txt12.79 KBdavemybes
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drupalina’s picture

Forgot to mention: I use Zen theme, which by the way has _phptemple_variables. I followed the instructions and pasted the short code just before "return $vars" in that templete.

And I left the paragraph that says:

/**
 * Removes a tab
 */
function themename_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";
    }
  }
}

//-- end

... I left this code at the very end of the template .php (below all other custom additions that I made to this templete.php)

After I did this, the Fatal Error was gone. But I noticed that my site loading had slowed down dramatically. And I also notived the following: If before I would search for some term in Users, it would bring me to asearch result page , where the "Users" tab was open and it would display the type of results that I want to see. Now, hoever, since the Users tab is gone a search in users results in "Content" tab open, and not the "User Profiles" tab as one would expect.

An I doing something wrong???

Please help

davemybes’s picture

Assigned: Unassigned » davemybes
Priority: Critical » Normal

I installed the module and used the Zen theme like you do. I copied the code from the README file and tried searching. If I select the User Profiles to do the search, the results still show on the User Profiles tab, not the Content tab. So I cannot tell you what the problem is on your site, I'm afraid. What versions of PHP and MySQL are you using.

When I activated the changes in template.php I took note of website speed, and didn't notice any slowness at all. If you remove the code from template.php does your site get faster again?

drupalina’s picture

can you please paste your template code here please... that would help a great deal.

I have a feeling that I must have put the wrong parts of the code in the wrong places.

Thank you very much

davemybes’s picture

FileSize
12.79 KB

Sure, here you go. This is the template.php taken from an otherwise clean zen theme install. The first bit of code is added at line 250, where it says: // REMOVE USER TAB FOR PROFILE_PLUS MODULE. The second bit of code is at the end of the file.

Make sure that if you have renamed your zen theme folder, that you rename all the functions in template php - I usually just do a search and replace for "zen".

davemybes’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.