Maybe someone can move this thread to the installation forum?
-Matt
Fyi, I'm particularly interested in whether or not this google search stuff is 1) purely software-based, as in I can plug in a software module and away I go (I would not want to get this away for free if I were google...but I'd sure love to get in on that action if I could!), 2) requires a "service" tie-in to their website (and thus might generate ad revenue for them), or 3) requires the dreaded "google search appliance," which is a hardware/server mechanism and costs big bucks (for typical accounts, anyway)....or something else?
-Matt
It's (reasonably) simple block that enables you to have a google search on your home or course pages. It uses existing Google features in its entirity. It can restrict it's search to just your Moodle site *if* (and only if) your moodle site is not sitting on a virtual directory (ie, http://www.mysite.ac/ not http://www.mysite.ac/moodle) as Google doesn't do that.
It will also automatically pick up your selected language, translate it to the equivalent Google language and restrict the results that way. That's it - it's work in progress really though.
I started with David's block but trimmed it right down for moodle.org. David's original is here and is easy to modify to your tastes.
Re: How do I add Google search capability to my site?
The translation of search forum in Thai misleads users into thinking that he will get information from the entire site. Because it was cut short as "search" only in Thai. Who do the translation for you. and how can I contribute.
I have downloaded David'sscript on google search, but can anyone tell me how to add this block to moodle front page.
Google Search | |
Re: How do I add Google search capability to my site?
To install the block, you need to create a new folder in 'blocks' called "google" and put the script in there, called "block_google.php".
A proper blocks repository will be implemented as soon as someone writes one.
Re: How do I add Google search capability to my site?
Re: How do I add Google search capability to my site?
I think you've got a couple of minor problems in your code here:
<input name="hl" type="hidden" id="hl" value=\"th\">
The extra slashes around the th prevent Google showing it's Thai interface. There are similar extra slashes in the lines specifying encoding:
<input name="ie" type="hidden" id="ie5" value=\"windows-874\">
<input name="oe" type="hidden" id="oe2" value=\"windows-874\">
Also, Google can't search in areas smaller than a domain so each mention of "http://www.bangkaew.com/elearning" should really be ".bangkeaw.com" or elearning.bangkeaw.com"
Re: How do I add Google search capability to my site?
That got me the first time I tried to install a custom block.
Re: How do I add Google search capability to my site?
although not directly related, some time ago I wrote an alternative Google's block using APIs from Google. Its main difference is that you can show results inside Moodle.
It can be tasted here.
(l/p: moveblocks)
And source code is available in contrib directory.
Ciao
Re: How do I add Google search capability to my site?
Hi Eloy. Amazing this Google block with result inside Moodle. Just a question: it is possible to add an option such as "search the web" and "search this site". Would be tremendous, I think.
Are you using another browser than IE6? I'm getting a Javascript error "Identifier required", row 93 Char 32 code 0 in IE6 when accessing the result pages. IE6 oddity I think.
http://moodle.org/mod/forum/discuss.php?d=11264
Yes, in order for Google to index your site it needs access and then any member of the public can read your content on Google.
However they do sell a Google-in-a-box search appliance for intranets that could probably be hooked up in a similar manner. A new cut-down version was just introduced at a cost of only $5,000 (maybe they do an educational discount too. edit: I just checked, they don't ).
http://www.google.com/enterprise/
The equivalent open source solution for institutions is probably to have a separate Java machine running a Lucene (using one of the PHP based interfaces for more control) or perhaps Nutch (which would spider the entire web interface just like Google)-based search engine and hooking it up in the same way as Google. However these solutions are probably useless in standard hosting situations.
Unfortunately PHP's Unicode-issues seem to have left it behind the state-of-the-art in search technology so SQL based searches are probably the best you can hope for at the moment in a pure PHP environment.
Re: How do I add Google search capability to my site?
the javascript problem should be solved now (I haven't IE to test it!) both in contrib and in the test site.
About the "search this site" option, I've to examine Google's API to see it it's possible but I haven't time to do it just now. I've a new Post-It in the wall remembering it!
Ciao
Re: How do I add Google search capability to my site?
Note that the external results, as seen here on Moodle.org's Google search, can be modified to look like your own site to some degree by logging into Google and providing a header, footer and color options (these details from memory) despite the results actually being hosted on google.com.
However, the result is not anywhere near as seamless as the Google API approach shown above.
I didn't notice this question last week but the Google search uses code straight from the Google mothership. You can use it without paying for anything. There is a Terms of Service document, but I believe that only applies if you use the more advanced forms and customise the search results page and/or try to gain ad revenue from the ads displayed alongside the results.
There's lots more info (including links to the Google pages about this) in the thread where I originally posted my code though you may prefer to get the code straight from Moodle's CVS where I assume Martin's version is available.