<?php
/*
eKudos Plugin
door Tri Pham

http://www.scriptorama.nl/
http://www.seoking.nl/
http://www.tripham.nl/

Gebaseerd op de plugin van eKudos door Robert van Gaal.
Getest op Wordpress 2.1, niet op 2.0.x.
Installatie: plaats dit bestand in de WP plugin map, hernoem dit bestand naar .php 
en activeer plugin.

De ekudos knop zit onderaan bij elke post. 

Spread the link love! - Tri Pham
*/

/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/


function ekudos_html($content) {
    
$html $content;

    
// Load the post's data
    
$blogname urlencode(get_bloginfo('wpurl'));
    global 
$wp_query
    
$post $wp_query->post;
    
$permalink get_permalink($post->ID);
    
$title urlencode($post->post_title);
    

if (
is_home()) {

  global 
$post;

  
$html .= '<script type="text/javascript">';
  
$html .= 'ekudos_url = "'$post->guid .'";';
  
$html .= '</script>';
  
$html .= '<script src="http://www.ekudos.nl/javascripts/kudobox.js" type="text/javascript"></script>';
  
$html .= '';
}
elseif (
is_single()) {
  
$html .= '<script src="http://www.ekudos.nl/javascripts/kudobox.js" type="text/javascript"></script>';
}

    return 
$html;
}
add_filter('the_excerpt''ekudos_html');
add_filter('the_content''ekudos_html'0);


?>