Kroc / NoNonsenseForum

A free, open source, PHP-based simple discussion forum. It favours removing barriers to conversation rather than massaging egos. Download Here: https://github.com/Kroc/NoNonsenseForum/archive/master.zip
http://camendesign.com/nononsense_forum
Other
247 stars 34 forks source link

Google site search should be configurable #235

Closed cboulanger closed 9 years ago

cboulanger commented 9 years ago

The target for the google site search is hardcoded to your own server. It would be great if the target was configurable by a defining a constant.

Zegnat commented 9 years ago

Everyone agrees: #188

cboulanger commented 9 years ago

Hi, seems to me that #188 ist about a different search engine. This issue deals with the domain for which the search should be done, since currently, it is hardcoded to

<input type="hidden" name="as_sitesearch" value="forum.camendesign.com">

In my case, I solved the problem by adding

document.getElementById ("search").as_sitesearch.value = window.location.host; to each template page. But maybe it makes sense to be able to set specific values, i.e., if the search should include the main domain and not just the specific virtual host.

Zegnat commented 9 years ago

Ah, sorry @cboulanger, I misread it! I thought this was already fixed in code. I’ll give it a look if I can find the time. @Kroc is pretty busy.

Kroc commented 9 years ago

Actually, NNF should be changing that sitesearch to the user's domain name -- if it isn't, then that's a bug too.

Yes, I'm super-super busy. My son doesn't sleep well at night and I have to juggle that with work.

Zegnat commented 9 years ago

@cboulanger do you get any PHP errors? The as_sitesearch value is definitely supposed to be changed by the forum system in theme.php:

                //set the forum URL for Google search-by-site
                '//input[@name="as_sitesearch"]/@value'              => $_SERVER['HTTP_HOST'],

This code means that, yes, it is hardcoded in the theme’s HTML files, but when pages are rendered it should be swapped out by your current domain.

cboulanger commented 9 years ago

Ok, sorry, I missed that! I have to see why I thought that it didn't work. Will reopen the issue if there is a problem.