Sunday, December 19, 2010

Use this form to search Blogger.com profiles

Blogger have not provided a search facility for their profiles, yet. So here's a form to search Blogger.com profiles for interests, books, music and movies (updated Aug 07) or industry or occupation (also in my sidebar, you need to scroll down towards the end) - feel free to try it out (results open in a new window).

Javascript

Here is the Javascript code for the profile search form which you can just copy and paste into your template sidebar if you want to use it in your own blog (I put it under a sidebar heading entitled "Search Blogger.com profiles", but that's not necessary; also note that I haven't yet worked out how to get it to open the search results in a new window without the original window going weird, so it opens them in the same window):
<script language=javascript>
//results open in new window, to change this
//edit target on selectedIndex e.g. target=_self
//by Improbulus http://www.consumingexperience.com/
// licensed under Creative Commons License
//http://creativecommons.org/licenses/by-nc-sa/2.5/
//- based with thanks on code by Petra Richardson at
//http://www.js-x.com/javascript/?id=1041
//and thanks to G-BOAC of Blogger Forum for the fix
//to open results in a new window properly

function send_search()
{
var searchstring=window.document.searchengine.search.value;

if(window.document.searchengine.engine.selectedIndex == "0")
{
window.document.interests.t.value="i";
window.document.interests.q.value=searchstring;
window.document.interests.action="http://www.blogger.com/profile-find.g";
window.document.interests.target="_blank";
window.document.interests.submit()
;
}

if(window.document.searchengine.engine.selectedIndex == "1")
{
window.document.movies.t.value="m";
window.document.movies.q.value=searchstring;
window.document.movies.action="http://www.blogger.com/profile-find.g";
window.document.movies.target="_blank";
window.document.movies.submit()
;
}

if(window.document.searchengine.engine.selectedIndex == "2")
{
window.document.music.t.value="s";
window.document.music.q.value=searchstring;
window.document.music.action="http://www.blogger.com/profile-find.g";
window.document.music.target="_blank";
window.document.music.submit()
;
}

if(window.document.searchengine.engine.selectedIndex == "3")
{
window.document.books.t.value="b";
window.document.books.q.value=searchstring;
window.document.books.action="http://www.blogger.com/profile-find.g";
window.document.books.target="_blank";
window.document.books.submit()
;
}
}
</script>

<!-- below are the submission forms -->
<form name=interests action="http://www.blogger.com/profile-find.g" method="get" />
<input type="hidden" name="t" value="i" />
<input type="hidden" name="q" />
</form>

<form name=movies action="http://www.blogger.com/profile-find.g" method="get" />
<input type="hidden" name="t" value="m" />
<input type="hidden" name="q" />
</form>

<form name=music action="http://www.blogger.com/profile-find.g" method="get" />
<input type="hidden" name="t" value="s" />
<input type="hidden" name="q" />
</form>

<form name=books action="http://www.blogger.com/profile-find.g" method="get" />
<input type="hidden" name="t" value="b" />
<input type="hidden" name="q" />
</form>

<!-- below is the multiple search box that you will see on your webpage -->

<form name=searchengine method=post action="javascript:send_search()">
Find this word or phrase:
<input name="search" type="text" size="25">
within this profile section:
<select name="engine">
<option>Interests</option>
<option>Movies</option>
<option>Music</option>
<option>Books</option>
</select>
<p>
<input type="button" value="Search profiles" name="B1" onclick="javascript:send_search()">
</p>
</form>


HTML

a much simpler search form, which produces exactly the same result, using HTML rather than Javascript.

Here's the code :

<!-- Please do not delete this note
Form to search Blogger.com profiles - results open in new window, to change this delete target="_self"
Copyright Improbulus 2005-2007 http://www.consumingexperience.com/ licensed under Creative Commons License http://creativecommons.org/licenses/by-nc-sa/2.5/
-->
<form action="http://www.blogger.com/profile-find.g" method="get" target="_blank">
<label for="q">Find this word or phrase:</label><br />
<input type="text" size="25" name="q" id="q" /><br />
<label for="t">within this profile section:</label><br />
<select name="t" id="t">
<option value="i">Interests</option>
<option value="m">Movies</option>
<option value="s">Music</option>
<option value="b">Books</option>
<option value="j">Industry</option>
<option value="o">Occupation</option>
</select>
<input type="submit" value="Search" /> <input type="reset" value="Clear" />
</form>

 

No comments:

Post a Comment