TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 481
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 308
  • Total: 308

forum/google search block

Started by extacy, February 27, 2006, 11:32:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eldacar

That has to go in a new file called search.php (or anything else). Did you put it in the Search.php SMF source file? Haha, i should have been more clear..

G6Cad

I allready have a search.php file in my source directory folder of SMF.

It contains a lot more code then the one i made from this code. Is it just to overwrite the old one, or is there an other way to do this?

extacy

Ok, Mines all sorted out....

First cheers!!!!!!

Second,
Mine was giving me problems until I changed...

method="post"
to
method="get"
in
<form action="http://somedomain.com/search.php"method="post" style="text-align: center; margin: 0; margin-bottom: 3px;">

Don't ask me how or why, it works in that's good enough for me.... ;)

QuoteI allready have a search.php file in my source directory folder of SMF.


Thats the same problem I was making...

What I figured out is, he said we could make a file called anything (thingy.php) and put it just about anywhere in your directory w_w.mysite.com/lingerie/thingy.php

and as long as this matches the TPortal searchblock script he gave us, then you should be working. Provided you don't have the same issue I did....


// TPortal searchblock
function TPortal_searchbox()
{
    global $context, $settings, $options, $txt , $scripturl;

echo '<form action="http://w_w.mysite.com/lingerie/thingy.php" method="post" style="text-align: center; margin: 0; margin-bottom: 3px;">
<input type="text" name="q" value="" style="width: 85%;" />

<select id="where" name="where" style="width: 42%; margin-top: 2px;" >
<option value="entire">Entire Site</option>
<option value="forum" selected="selected">Forum</option>
</select>
<button type="submit" style="width: 42%; font-size: 85%;">', $txt[182], '</button>
</form>';

}


Thx Again eldacar
Great stuff!!!


eldacar

Yes sorry, I should have explained more clearly. The code needs to go in a new file, which can be called anything, and can be located anywhere. Just change the url extacy coloured red in the last post and it should be fine ;)
And you don't have to use Google, it should work with any search engine.

G6Cad

Now even I got this to work :)
Thanks for the extra help  :-*

extacy

Ok, that worked great, now let's take it to the next level and have it "carry over" our google id/info so we get credit for the site searches that may occur. Somehow our google info needs to get incorporated in there.



<input type="hidden" name="client" value="pub-xxxxxxxxxxxxxxxxx"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#009900;GL:1;DIV:#FFFFFF;VLC:660099;AH:center;BGC:FFFFFF;LBGC:303030;ALC:3300FF;LC:3300FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>


thanks!!!

eldacar


TwinsX2Dad

Quote from: extacy on March 24, 2006, 06:25:23 AM
Ok, that worked great, now let's take it to the next level and have it "carry over" our google id/info so we get credit for the site searches that may occur. Somehow our google info needs to get incorporated in there.

Perfect - you took a great idea and made it better. Nice job.

nite0859

Quote from: eldacar on March 24, 2006, 11:03:18 AM
What is that for?
Quote from: extacy on March 24, 2006, 06:25:23 AM
Ok, that worked great, now let's take it to the next level and have it "carry over" our google id/info so we get credit for the site searches that may occur. Somehow our google info needs to get incorporated in there.



<input type="hidden" name="client" value="pub-xxxxxxxxxxxxxxxxx"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#009900;GL:1;DIV:#FFFFFF;VLC:660099;AH:center;BGC:FFFFFF;LBGC:303030;ALC:3300FF;LC:3300FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>


thanks!!!

The problem is that Google will punish you if you modify their code in any way whatsoever. Also, I don't know if Google will consider having their search executing at the same time as another kind of search as violating TOS.

eldacar

Modifying google's code? another search at the same time? I still don't understand :S

This website is proudly hosted on Crocweb Cloud Website Hosting.