Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 08:31:47 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155552 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Search includes sub pages of page set to none - how to change?  (Read 275 times)
washoc

Offline Offline

Posts: 17


« on: September 23, 2011, 12:09:38 PM »

Hi,

I'm using WB2.81 and I've noticed that the frontend search facility returns results which include sub pages of parent or root_parent pages which have a visibility of none. My site has sections which are turned on and off seasonally so we set them to none when we don't want them to display. Each section has a lot of sub pages so setting the visibility for each sub page is not really an option.

Is there a way to change the search code so that it does not return results which include sub pages of parent pages that are set to "none"?

The search code, as far as I can tell, is in search/search.php:

Code:
$sections_query = $database->query("
SELECT s.section_id, s.page_id, s.module, s.publ_start, s.publ_end,
p.page_title, p.menu_title, p.link, p.description, p.keywords, p.modified_when, p.modified_by,
p.visibility, p.viewing_groups, p.viewing_users
FROM $table_s AS s INNER JOIN $table_p AS p ON s.page_id = p.page_id
WHERE s.module = '$module_name' AND p.visibility NOT IN ('none','deleted') AND p.searching = '1' $search_path_SQL $search_language_SQL
ORDER BY s.page_id, s.position ASC
");

"p.visibility NOT IN ('none','deleted')" works where the sub page itself has a visibility of none but I'm not sure how to change the query to check for the visibility of parent and root_parent pages where they are none.

Can anyone point me in the right direction please? Any help would be appreciated.

Many thanks.
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #1 on: September 23, 2011, 05:17:22 PM »

hi,

dont touch code. if you want to exclude page from search go to pages , page settings and find searh combo box and dissable searching for each page
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
washoc

Offline Offline

Posts: 17


« Reply #2 on: September 26, 2011, 12:32:04 PM »

Hi crnogorac081,

Thanks for your response but that is not really a practical solution. As I mentioned, some of the sections have quite a lot of sub pages so to go through each of them and change a setting whether it's the searchable setting or the visibility one, is not ideal.

Surely if a top level page has it's visibility set to "none", the sub pages and sub-sub pages of that page should inherit that? I can't imagine a situation where you would want to set the top level page to "none" but still be able to view and use its sub-page....?

I'm happy to change the search code but would appreciate some help.

Thanks,
Gary.
Logged
washoc

Offline Offline

Posts: 17


« Reply #3 on: November 09, 2011, 07:06:24 PM »

By way of a gentle bump - I don't suppose anyone has any ideas on how this might be achieved?

Any help would be appreciated!

Thanks.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!