Changing search box text

yolise

Joined: 2005-09-27
Posts: 24
Posted: Mon, 2005-10-03 12:09

Where do I find the following so I can change it:

1. The text that says "Search the Gallery".

2. The Search fields. I want to remove "Custom Fields" from the advanced search page.

Thanks!

Gallery version = 2.0 core 1.0.0
PHP version = 4.3.10 cgi
Webserver = Apache/1.3.33 (Unix)
Database = mysql 4.0.25-standard-log
Toolkits = ArchiveUpload, NetPBM, SquareThumb, Thumbnail, Gd
Operating system = Linux infong 2.4 #1 SMP Mon Aug 9 10:21:08 CEST 2004 i686 unknown
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-03 13:12

1. /modules/search/templates/blocks/SearchBlock.tpl
2. unload the Custom Fields module

 
yolise

Joined: 2005-09-27
Posts: 24
Posted: Mon, 2005-10-03 13:29
icpix wrote:
1. /modules/search/templates/blocks/SearchBlock.tpl

Cheers.

Quote:
2. unload the Custom Fields module

I don't want to remove custom fields, I just don't want them searchable.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2005-10-03 14:15

For the custom fields I don't know exactly, but you'll probably need to edit module.inc so it doesn't register itself with the search functionality. I don't know if you'll just need to clear the db and template cache or uninstall and reinstall the module. If you do the uninstall/reinstall you'll lose all of your current custom field data.

For module.inc I was referring to this /modules/customfield/module.inc :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-03 14:30

Picky aren't you yolise;~) You didn't say that initially. That solution was the simplest answer to your question.

File: /modules/customfield/classes/CustomFieldSearch.class
You could comment out this area, doesn't show onscreen but doesn't save any search cpu cycles.

/*
$info = array('name' => $module->translate('Custom Fields'),
'description' => $module->translate('Custom Fields Module'),
'options' => array(
'customfield' => array(
'description' => $module->translate('custom      '),
'enabled' => 1)));
*/

POSTEDIT: scrub this workaround attempt, I thought I had it working but it's now causing an error.

 
yolise

Joined: 2005-09-27
Posts: 24
Posted: Mon, 2005-10-03 14:41

I did say 'I want to remove "Custom Fields" from the advanced search page.' which I thought was fairly clear. Apologies if it was not.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-03 15:21

Was nearly right the first time...;~)

File: /modules/customfield/classes/CustomFieldSearch.class
//==========================================================================
// amendment to remove the repetitive word 'search' from the custom box
// and/or spread out the words and/or stop the custom stuff appearing
//==========================================================================
/*
$info = array('name' => $module->translate('Custom Fields'),
'description' => $module->translate('Custom Fields Module'),
'options' => array(
'customfield' => array(
'description' => $module->translate('custom      '),
'enabled' => 1)));
*/
return array(GalleryStatus::success(), $info);
}

This workaround works. It's not terribly ergonomic probably but I don't even pretend to be a coder (I'm a photographer).

 
weslemos

Joined: 2007-01-26
Posts: 5
Posted: Fri, 2009-08-14 17:50

Hey there,

I was looking for the answer to this same question myself and I tried the solution above and for some reason it didn't work for me. The page just stayed blank.

So I played with the code and this ended up working for me:

in file:/modules/customfield/classes/CustomFieldSearch.class
find:

Quote:
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'customfield');
if ($ret) {
return array($ret, null);
}

And change it to:

Quote:
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'customfield');
if (!$ret) {
return array($ret, null);
}

That seems to work for me. Hope it does for anyone else out there too.

Wes