1 automateexcel Aug 17, 2004 21:45
3 tim Aug 18, 2004 15:56
Yeah that is pretty cool! Thanks automateexcel
.
4 mattbta Aug 18, 2004 17:42
Neat!
5 edb Aug 18, 2004 21:32
Oops. If you have link a url to your title this hack falls apart. I've not done any investigating as to why - just observed that it happens. If I stumble across a solution I'll post it here.
6 isaac Aug 18, 2004 21:59
Change it from
$Item->title()
to
$Item->title('','',false)
to make it suppress the link.
I changed it in the code above.
7 edb Aug 18, 2004 22:06
Wow that was quick. It helps when you know what you're doing eh? I am happy to report that Isaac's patch has correctified the issue reported above.
8 automateexcel Aug 19, 2004 07:36
Thanks all, and Isaac for the code udpate! :D
9 ladybird Aug 21, 2004 13:44
It is working great but I want to modify it, I want to use a clickable button anyone have an idea how to do this in PHP?
I have a button ready in my img folder
10 automateexcel Aug 23, 2004 08:24
just a guess..
does it have to be a bonafide "button" or just a clickable image?
If a clickable image is the answer, replace Google It! with your <img src="googleit.gif"> code and that should do the trick.
11 edb Aug 23, 2004 21:40
If your image is in the img folder then you can use
<img src="<?php imgbase() ?>
Follow it with the name of the file only - the php deal will include the slash between /img and your file name.
12 ladybird Aug 24, 2004 19:53
it works thanks
13 mistake Jan 30, 2005 17:27
Hi!
Does anybody know how to send German Umlaut?s to google?
http://www.google.de/search?hl=de&ie=UTF-8&q=%D6l%20auff%FCllen ist sent via b2evolution, but it should be http://www.google.de/search?hl=de&q=%C3%96l+auff%C3%BCllen or at least http://www.google.de/search?hl=de&q=%C3%96l auff%C3%BCllen
14 flamesop2 Jan 30, 2005 23:26
Try this (non-mouseover version):
<a href="http://www.google.com/search?hl=en&ie=UTF-8&q=<?php urlencode($Item->title('','',false)); ?>"onmouseover="window.status='Search Google For This Topic';return true;" onmouseout="window.status=' ';return true;" title="Search Google For This Topic">Google it!</a>
15 sunset Jan 31, 2005 12:55
Thankyou :D it is a nice little addition to my blog.
16 mistake Jan 31, 2005 13:05
@FLamesOP2: Thank you, but I?m afraid it still returns http://www.google.de/search?hl=de&ie=UTF-8&q=%D6l%20auff%FCllen :-(
17 ma2t Jun 07, 2005 23:44
Very nice automateexcel, I see that you use google Adsense, and was wondering if you could intergrate this with the "Adsense for Search" part of google adsense?....... Basicly it just returns a custom google page, with sponsored links at the top.
Thanks for the mod :)
18 kraemers Jun 12, 2005 02:03
I made some modifications to the GoogleIt! hack if anyone is interested. I included the name of the blog in the search. It searches in this format: Your Blog Name - Your Post Title. I also changed the code so it searches within your site and has Google SafeSearch activated. The search results open up in a new window. Below is the new code: (replace yourdomain.com with your domain). The • is if you want to place the code next to your comments, trackbacks, etc. in _main.php (at the bottom of each post)
• <a href="http://www.google.com/search?hl=en&ie=UTF-8&q=<?php $Blog->disp('name', 'htmlhead'); ?> - <?php $Item->title('','',false); ?>&safe=strict&domains=yourdomain.com&sitesearch=yourdomain.com" target="_blank" onmouseover="window.status='Search Google For This Post';return true;" onmouseout="window.status=' ';return true;" title="Search Google For This Post">Google it!</a>
Original Code:
<a href="http://www.google.com/search?hl=en&ie=UTF-8&q=<?php $Item->title('','',false); ?>"onmouseover="window.status='Search Google For This Topic';return true;" onmouseout="window.status=' ';return true;" title="Search Google For This Topic">Google it!</a>
19 kf_man Jun 23, 2005 22:21
I know I'm pretty stupid, but I really can't figure out where you put this code. Any help would be appreciated as I'm new to this.
20 kraemers Jun 24, 2005 02:29
Look for the skins folder, select a skin folder (inside the skins folder) and open _main.php for editing. Look for the "Start of main area" and the "Start of posts" in _main.php. Look for this code several lines below:
<?php $Item->feedback_link( 'comments' ) // Link to comments ?>
<?php $Item->feedback_link( 'trackbacks', ' • ' ) // Link to trackbacks ?>
<?php $Item->feedback_link( 'pingbacks', ' • ' ) // Link to trackbacks ?>
<?php $Item->edit_link( ' • ' ) // Link to backoffice for editing ?>
<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
</div>
Place
• <a href="http://www.google.com/search?hl=en&ie=UTF-8&q=<?php $Blog->disp('name', 'htmlhead'); ?> - <?php $Item->title('','',false); ?>&safe=strict&domains=yourdomainhere.com&sitesearch=yourdomainhere.com" target="_blank" onmouseover="window.status='Search Google For This Post';return true;" onmouseout="window.status=' ';return true;" title="Search Google For This Post">Google it!</a>
inbetween
<?php $Item->feedback_link( 'comments' ) // Link to comments ?>
and
<?php $Item->feedback_link( 'trackbacks', ' • ' ) // Link to trackbacks ?>
That is where I have placed the Googleit! code. You can do as you please. Hope this helps
21 lazarbihms Sep 21, 2005 17:53
automateexcel wrote:
I'd seen on a few non b2evo blogs the option to "google it" in the comments/permalink/trackback section.
First off thanks for this great feature. I had been using it for a while and decided I wanted to have it adsense aware. So after much trial and error and learning a bit 'o PHP here are the results.
Note this code is designed to be run as a php include file (e.g. /includes/googleit.php), called from _main (for your skin) whereever you want the GoogleIt link to appear.
A lot of the options for google adsense search (like your id, the formatting of the results, etc.) are defined in variables ... so it should be fairly easy to customize to your need.
This is my first attempt at a hack (of a hack) so be gentle.
See it in action:[url=http://mrshiney.froppy.com/blog]Shiney Blog[/url]
<? php ;
// GoogleIt macro (originally by automateexcel http://www.automateexcel.com on b2evo forum) ;
// Hacked by Mr. Shiney <mrshiney@froppy.com> to include google adsense targeting ;
// Permission granted to reuse my paltry attempts if you credit me and original author ;
// This code should be called by php include code from _main for your skin where you want the GoogleIt link to appear ;
//thelinkname can be changed to something other than GoogleIt ;
$thelinkname = "GoogleIt!" ;
//thecof stores the formatting information - generate from your google adsense for search tab ;
$thecof = "GALT:#0066CC;GL:1;DIV:#999999;VLC:336633;AH:center;BGC:FFFFFF;LBGC:FF9900;ALC:0066CC;LC:0066CC;T:000000;GFNT:666666;GIMP:666666;FORID:1;" ;
//theclient stores your clientID for google adsense ;
//change to your google adsense ID ;
$theclient = "YOURID" ;
//thewintitle is the title of the new window you want googleit to open
$thewintitle = "GoogleIt" ;
// convert spaces for search string to make google happy ;
$thetitle=str_replace(" ","%20+",$Item->title);
// $thetitle=str_replace(" ","%20+",$Item->title('','',false));
?>
<a href="http://www.google.com/custom?q=<?php echo $thetitle ?>&sa=Search&client=<?php echo $theclient ?>&forid="1"&ie="ISO-8859-1"&oe="ISO-8859-1"&cof=<?php echo $thecof ?>&hl="en" TARGET=<?php echo $thewintitle ?> onmouseover="window.status='Search Google For This Topic';return true;" >
<?php echo $thelinkname ?></a>
22 cue Nov 29, 2005 09:22
Not trying to spoil the fun - this feature is great, but isn't it against Terms & Conditions of Adsense for Search?
AdSense for Search. If You have elected to receive Search Results, You will display on Your Site(s) a Google search box (a "Search Box") in accordance with the specifications provided by Google. Each Web page(s) that contains a Search Box must also contain other content related to Your Site. Except for related Google queries, all search queries (including queries entered into an Ad search box) must originate from individual human end users inputting data directly into a Search Box (or Ad search box, as applicable) on Your Site(s). You will send any and all queries (without editing, modifying, or filtering such queries individually or in the aggregate) to Google and Google will use commercially reasonable efforts to provide You with corresponding Search Results and/or Ads, as applicable and as available. Search Results and any accompanying Ads will be displayed on Web pages hosted by Google (each, a "Search Results Page"), the format, look and feel of which may be modified by Google from time to time.
23 staypuft Feb 07, 2006 16:08
Does anyone have any ideas about how to make this hack XHTML valid, because this does NOT convert spaces in the Post Titles to "+"s like I'd hoped:
urlencode($Item->title('','',false));
-------
EDIT:
Nevermind, I figured it out here:
very nice. thanks for sharing it!