1
warty
search on specific module only
  • 2005/1/16 22:19

  • warty

  • Just popping in

  • Posts: 3

  • Since: 2005/1/16


Hi, I'm new on XOOPS world but I think it;s a fantastic CMS, I am starting with my site, but XOOPS seems to have everything I need to my site.

I have a question, I am using a theme with search dialog integrated in it.

theme.html has this code fro the search dialog:

<td align="right" valign="middle">
<
form style="margin-bottom: 0px; margin-top: 0px;" action="<{$xoops_url}>/search.php" method="post">
<
input class="srchinput" name="query" type="text" size="15" />
<
input type="hidden" name="action" value="results" />
<
input name="Submit" type="image" value="Search" src="<{$xoops_imageurl}>srchbut.gif" align="middle" width="44" height="22" />
</
form></td>


My problem is that I want that this search dialog will search only in a specific module (mydownloas to be more specific)

there is any way to do this?

I will apreciate your help and excuse my english

10x in advance

Warty

2
warty
Re: search on specific module only
  • 2005/1/18 12:03

  • warty

  • Just popping in

  • Posts: 3

  • Since: 2005/1/16


please, I need your help.

3
Mithrandir
Re: search on specific module only

<form style="margin-bottom: 0px; margin-top: 0px;" action="<{$xoops_url}>/search.php" method="post">
<
input class="srchinput" name="query" type="text" size="15" />
<
input type="hidden" name="action" value="results" />
[
b]<input type="hidden" name="mids[]" value="5" />[/b]
<
input name="Submit" type="image" value="Search" src="<{$xoops_imageurl}>srchbut.gif" align="middle" width="44" height="22" />
</
form>


Replace 5 with the id of the module you want searched.

4
warty
Re: search on specific module only
  • 2005/1/20 11:32

  • warty

  • Just popping in

  • Posts: 3

  • Since: 2005/1/16


thanks for your help buddy

5
tzvook
Re: search on specific module only
  • 2005/1/25 9:17

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

Mithrandir wrote:
Replace 5 with the id of the module you want searched.


Is there any way to use it dynamicly ($var) ?
for use in a new module ...

6
xueming
Re: search on specific module only
  • 2005/2/10 6:25

  • xueming

  • Not too shy to talk

  • Posts: 127

  • Since: 2005/2/7 6


Is it possible to specify more than one module to search and how to do it. Thanks.

7
Mithrandir
Re: search on specific module only

Quote:

xueming wrote:
Is it possible to specify more than one module to search and how to do it. Thanks.

<form style="margin-bottom: 0px; margin-top: 0px;" action="<{$xoops_url}>/search.php" method="post">
<
input class="srchinput" name="query" type="text" size="15" />
<
input type="hidden" name="action" value="results" />
[
b]<input type="hidden" name="mids[]" value="5" />
<
input type="hidden" name="mids[]" value="6" />
<
input type="hidden" name="mids[]" value="7" />[/b]
<
input name="Submit" type="image" value="Search" src="<{$xoops_imageurl}>srchbut.gif" align="middle" width="44" height="22" />
</
form>

Just add more hidden variables

Quote:

Is there any way to use it dynamicly ($var) ?
for use in a new module ...

$mod_handler =& xoops_gethandler('module');

$newsModule =& $mod_handler->getByDirname('news');
$mids[] = $newsModule->getVar('mid');

$newbbModule =& $mod_handler->getByDirname('newbb');
$mids[] = $newbbModule->getVar('mid');

$faqModule =& $mod_handler->getByDirname('smartfaq');
$mids[] = $faqModule->getVar('mid');

Then assign the mids array to the template and use it there:

<form style="margin-bottom: 0px; margin-top: 0px;" action="<{$xoops_url}>/search.php" method="post">
<
input class="srchinput" name="query" type="text" size="15" />
<
input type="hidden" name="action" value="results" />
<{foreach 
item=mid from=$mids}>
    <
input type="hidden" name="mids[]" value="<{$mid}>" />
<{/foreach}>
<
input name="Submit" type="image" value="Search" src="<{$xoops_imageurl}>srchbut.gif" align="middle" width="44" height="22" />
</
form>

8
xueming
Re: search on specific module only
  • 2005/2/13 5:50

  • xueming

  • Not too shy to talk

  • Posts: 127

  • Since: 2005/2/7 6


Thanks a lot. I like the dynamic one.

I got another related question. I have use a laguage pack for my site. And when I go to this: www.mysite.com/search.php, I can see that it is translated to the new language. But when I use the above code in my module, they are not translated, Is there a way to use the search.php in my module and still got the same language?

Thanks.

Login

Who's Online

201 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 201


more...

Donat-O-Meter

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

Latest GitHub Commits