1
dtrimpey
Excluding Searching on certain modules
  • 2004/4/13 19:34

  • dtrimpey

  • Just popping in

  • Posts: 6

  • Since: 2004/4/13


Is there a way to keep the search feature from returning results from certain modules and not others? I have a section of info in one module that I only want available to registered users, but currently anonymous users can search and find those pages.
Thanks for your help!

2
Catzwolf
Re: Excluding Searching on certain modules
  • 2004/4/13 21:23

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


There is a file call xoops_module.php that contains information regarding the module.

Look for:
$modversion['hasSearch'] = 1;

and change this to:

$modversion['hasSearch'] = 0;

That should stop the search function for the module.

3
marcan
Re: Excluding Searching on certain modules
  • 2004/4/14 0:25

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


I've hacked the search function to correct this problem.

This hack corrects the following problem. If a user does not have the permission to access a module, he still can view the results belonging to this module when he uses the search functionnality of the XOOPS site.

With this hack, for example, if a user does not have access to MyLinks module, he won't see any results from this module when he uses the search function.

To install, copy the 2 files at the root of your XOOPS site.

Please note that if you already installed other hacks that modified those 2 files, you will have to merge the files manually.

You can download this hack here : Hacked Search

4
dtrimpey
Re: Excluding Searching on certain modules
  • 2004/4/14 2:31

  • dtrimpey

  • Just popping in

  • Posts: 6

  • Since: 2004/4/13


Awesome!

Thanks guys, I will give these things a try tommorrow.


5
Dave_L
Re: Excluding Searching on certain modules
  • 2004/4/14 3:17

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


marcan, do those two files in Hacked Search.zip contain other hacks? Some of the changes are labelled MLPatch, and add calls to makeTareaData4Show().

6
marcan
Re: Excluding Searching on certain modules
  • 2004/4/14 13:11

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


Dave_L : yes, they do contain hack for MLPatch. MLPath is the xack to make XOOPS multilingual. However, even if you dont have the hack install, there is nothing wrong to pass some variable by the textsanitizer so it wont be bugging you !

Tell me if it's working !

Cheers !

7
Dave_L
Re: Excluding Searching on certain modules
  • 2004/4/14 15:09

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Thanks

I left out the MLPatch. I'd prefer to avoid nonessential hacks, since it will make upgrading more complicated.

On my test setup, the Forum module is the only one that supports searching.

I've only seen a couple of minor issues so far:

1) Even if the user doesn't have access to the forum, the Forum checkbox still shows up on the advanced search page.

2) The "No results" text doesn't get displayed, since that's within the "if" that doesn't get executed.

8
marcan
Re: Excluding Searching on certain modules
  • 2004/4/14 15:47

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


Quote:
I left out the MLPatch. I'd prefer to avoid nonessential hacks, since it will make upgrading more complicated.
Fine with me

You are right regarding the little issues. I will correct it so the user with no permissio on a module does not get the module check box.

However, If a user does not have the permissions to access a module, should he even see the 'No result found' in the search results ?

Cheers !

Login

Who's Online

166 user(s) are online (83 user(s) are browsing Support Forums)


Members: 0


Guests: 166


more...

Donat-O-Meter

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

Latest GitHub Commits