1
noo-b
Search Block - drop down selection ?
  • 2008/1/2 12:32

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


how do i modify the search block to have a drop down list of modules

example

when i select news in the drop down it will only search in the news module


i've seen some XOOPS site that does this
I Love Xoops

2
noo-b
Re: Search Block - drop down selection ?
  • 2008/1/5 7:40

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


anyone ?
I Love Xoops

3
noo-b
Re: Search Block - drop down selection ?
  • 2008/1/7 18:02

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


bump
I Love Xoops

4
mboyden
Re: Search Block - drop down selection ?
  • 2008/1/7 21:42

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


While I don't have an exact answer for you, I can give you some pointers unless someone else can give you the code.

You will need to edit both the code for the block (in /modules/system/blocks/system_blocks.php, find the b_system_search_show function) and it's associated template (/modules/system/templates/blocks/system_block_search.html, but done via the database or your themes).

In the block code, you will need to run a SQL query to get the active modules similar to what is done in the xoops_module_list function found in /modules/system/admin/modulesadmin/modulesadmin.php. Then you load that into an array (say as $modules) and pass it into the $block array (say as $block['modules']).

In the HTML template, you will need to see if $block.modules exists, then loop through them into a drop down select button.

Hope that helps, some. If you get it figured out, then please post here for everyone else to help out. It's a good idea, and similar to what I was trying to do recently with a theme solution to be able to search the current module, but even enhances upon that concept.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

Login

Who's Online

291 user(s) are online (258 user(s) are browsing Support Forums)


Members: 0


Guests: 291


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits