Remove the content search -> only user profile search

JoachimK - May 22, 2008 - 17:56
Project:Profile Plus
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:JoachimK
Status:closed
Description

Hey,

I have installed the profile plus module and search works well. But now I would like to remove the content search so that you can only search for user profiles. How can I do that ?

Thanks for your help!

#1

Allthegearnoidea - June 20, 2008 - 11:18

Trust me I really am no coder, and I don't pretend to know what I am doing. But I managed to remove the content tab simply by adding in to the code that removes the user tab the following:

themename_removetab('Content', $vars);

Interestingly I never had to add my theme name in to this (where it says add replace themename with your theme's name).

As I say I know nothing about coding so accept no responsibility for any of this. But it worked for me! :-)

//-- start

/**
* Override or insert PHPTemplate variables into the templates.
*/
function _phptemplate_variables($hook, $vars) {
if ($hook == 'page') {
themename_removetab('Users', $vars); // replace themename with your theme's name
themename_removetab('Content', $vars);
return $vars;
}
return array();
}

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

#2

wallbay1 - August 3, 2008 - 19:09

does this thing even work on drupal 6
i installed that module on drupal 6 but does n't seems to work

#3

topwaya - September 25, 2008 - 05:51

subscribing - I need it in drupal 6 as well

#4

ericduran - October 9, 2008 - 05:02

Hi,
This works on a drupal 6 site using the 6.x-1.x dev . I currently have it running on a live site. I also added a patch in order to get the search from a block.

You do need to enable the search module and the profile module for this to work.

#5

incrn8 - January 15, 2009 - 12:29
Priority:critical» normal
Status:active» fixed

#6

System Message - January 29, 2009 - 12:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.