Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1630 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Graphic Design, Multimedia and Photography     Web Design Resources :

How to add Google Search to a PHProxy Theme :)

Thread title: How to add Google Search to a PHProxy Theme :)
Closed Thread    
    Thread tools Search this thread Display Modes  
08-21-2007, 08:18 PM
#1
Daniel591992 is offline Daniel591992
Status: Member
Join date: Jul 2006
Location:
Expertise:
Software:
 
Posts: 161
iTrader: 0 / 0%
 

Daniel591992 is on a distinguished road

Send a message via AIM to Daniel591992 Send a message via MSN to Daniel591992

  Old  How to add Google Search to a PHProxy Theme :)

I was working on coding my second PHProxy theme a few days ago and wanted to add Google Search functionality to it. I had that planned since I started the design. I'm not great at Javascript, so I had no clue how to do it. A friend helped me do it, and I'd like to share.

What it Does
It adds Google Search functionality to a proxy site. You don't need to enter www.google.com in the textbox to go to Google, and then search. Instead, you can enter a search query in the same textbox and click on Google search. This is something I've never seen before on proxies.

Preview
Go here and click on test.

How to do it
Add this between your head tags:
Code:
<script language="JavaScript" type="text/javascript">
function submitForm()
{
document.FORM_NAME.submit();
}
</script>
<script language="JavaScript" type="text/javascript">
function google(){
text = document.FORM_NAME.TEXT_FIELD_NAME.value;
document.a.q.value = "http://google.com/search?q=" + text;
}
</script>
I know the coding isn't great, but what it does it when someone clicks on the Google Search button on your page, the second script will write the search url, and the first script will submit it.

On the Google Search button, you need this:
Code:
onclick="google(),submitForm()"


That's it



I'd appreciate it if you link to my site, share it, or just subscribe to my RSS feed for other free designs.

08-22-2007, 12:24 PM
#2
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

Wow Thanks! Great

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed