Page 1 of 1

Searching the forums

Posted: Mon May 19, 2008 7:43 am
by melonkernel
Hi. I have noticed that PHPbb2 forums have (like this one) have a rather uneffective search function (PHPbb3 is out, that might have a better search function). You find the thing you are interrested in much better if you use google and narrow the search to the specific site you are interested in.

You search like this in Google

Code: Select all

organizing lego site:classic-castle.com
Which means that Google will only show results that come from that specific site. And i find it more effective than using the buil in search function of the forum itself.

But it is of course difficult to leave the page, and go to google, and having to type in the extra site:classic-castle.com, therefore i made a little JavaScript snippet that you can save as a bookmark, and have it as a shortcut in your bookmark bar (if your browser has one)

I did this, copy pasted the code, created a new bookmark, added the whole thing as an URL.
When you click on the bookmark, a box opens where you can write your search term, then you are taken to google showing the search results for the site in question.

I made two version.
The first one searches for the term in classic-castles forum only.

Code: Select all

javascript:document.write("<script>var site='http://classic-castle.com/forum/'; var searchTerm = prompt('Search in Classic-Castle forums for:'); window.location = 'http://www.google.com/search?q=' + searchTerm + ' site%3A' + site;</script>");
The other version searches on the site you have currently open (but it can become confusing).

Code: Select all

javascript:document.write("<script>var site=window.location.hostname; var searchTerm = prompt('Search in '+site+' for:'); window.location = 'http://www.google.com/search?q=' + searchTerm + ' site%3A' + site;</script>");
Love
- Melonkernel

Posted: Mon May 19, 2008 7:46 am
by melonkernel
Oh, you can test them, If you want to see how it works by copy-pasting the code into your Address field as a normal address.

I have tested it on Safari and Firefox, but not in Internet Explorer, so please tell me if it works there as well.

Posted: Mon May 19, 2008 7:54 am
by melonkernel
However, new posts might not be found, because it takes a while for Google to index the pages. But, new posts are seen by all anyway when we eagerly following what happens in the forums and check new post as they come. So this is good for reading a week old or older threads.

This is what it looks like

Posted: Mon May 19, 2008 8:16 am
by melonkernel
I click on the bookmark ...
Image

... enter the search term
Image

... And voilá, Google finds it for me.
Image


p.s. this is my 50'th post here. Yay. :) This is the best forum ever.

Posted: Mon May 19, 2008 12:53 pm
by E of Alshire
This is really neat... I'll play around with it a bit in IE when I get a few minutes! I'm envious of anyone who can code even the most rudementary of scripts.

Re: Searching the forums

Posted: Mon May 19, 2008 3:39 pm
by Aliencat
Nice summary melonkernel, I would like to add a few things:
melonkernel wrote:Hi. I have noticed that PHPbb2 forums have (like this one) have a rather uneffective search function (PHPbb3 is out, that might have a better search function). You find the thing you are interrested in much better if you use google and narrow the search to the specific site you are interested in.
PHPbb3's search function is about as broad as that of PHPbb2, so you still get a million threads that have the word you seek somewhere in it. It's not any better in the new version.
melonkernel wrote:Oh, you can test them, If you want to see how it works by copy-pasting the code into your Address field as a normal address.

I have tested it on Safari and Firefox, but not in Internet Explorer, so please tell me if it works there as well.
Just to confirm: it works the same in Internet Explorer.

Posted: Mon May 19, 2008 7:35 pm
by wunztwice
Hey great, and as far a leaving the site to search, if you have firefox, (or the new versions of Explorer or Safari, I hear) you can simply open a new tab for google, and still have C-C and google in the same window.

Posted: Mon May 19, 2008 9:31 pm
by wobnam
Well, even before tabbed browsing (IE 6 or lower, for instance) you could still just open another browser - the only difference would be where the tab ended up, in your browser or on your task bar ;)

But that's off topic. Nice work, melonkernel.

Posted: Mon May 19, 2008 9:46 pm
by Bruce N H
Hey,

This is really cool. I'm going to shift it to "Administrative", which would be a better fit for this topic.

Bruce

Posted: Mon May 19, 2008 10:02 pm
by FirebenderDude2
I just looked it over, and I have one comment:

USE THE EDIT BUTTON! Four posts in a row is overdoing it.

Posted: Tue May 20, 2008 2:03 am
by architect
FirebenderDude2 wrote:I just looked it over, and I have one comment:

USE THE EDIT BUTTON! Four posts in a row is overdoing it.
While you are correct that multiple posts in a row are in bad taste, a regular forum member should not enforce the Terms of Service. In the future, please pm an administrator or moderator to deal with any problem you have with another CC member.

Ben
CC Sets Admin