Recent Topics

[4.1.x] Google +1 button plugin

started by on Mar 12, 2012 – Last touched: Apr 03, 2015

Mar 12, 2012 09:58    

My b2evolution Version: 4.1.x

Hello,

Does anyone know if there is a plugin created to add the Google +1 button to post ?

Thanks

Apr 17, 2012 19:56

There's no such plugin
It's not a big deal to place the code in your skin though. Here's the info
http://www.google.com/webmasters/+1/button/

Edit your _skin.class.php file

PHP

function display_init()
{
    // call parent:
    parent::display_init();
 
    /* some other stuff here */
 
    global $Item$disp;
    if( ($disp == 'single' || $disp == 'page') && !empty($Item) )
    {
        add_headline('<html itemscope itemtype="http://schema.org/Article">');
        add_headline('<meta itemprop="name" content="'.format_to_output$Item->title'htmlattr' ).'">');
        add_headline('<meta itemprop="description" content="'.format_to_output$Item->get_excerpt(), 'htmlattr' ).'">');
 
        add_js_headline("(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);
          })();");
    }
}

And then add the actual + button tag to your posts

PHP

Edit _item_block.inc.php to add g-plusone tag
    <h2><?php $Item->title(); ?></h2>
    <div class="g-plusone"></div>

Apr 17, 2012 20:38

Cool! We sure need a directory for b2evo extensions :)

Apr 17, 2012 20:46

sam2kb wrote:

Cool! We sure need a directory for b2evo extensions :)

yea, what about that ? have figured it out in your mind ? Ready when you are (:

Apr 18, 2012 01:46

I want to finish a social network sign-in plugin first.
It's probably doesn't make much sense to start working on extensions directory before b2evo 5 is released, since I would like it to be powered by b2evo 5.

Apr 18, 2012 02:59

sam2kb wrote:

I want to finish a social network sign-in plugin first.
It's probably doesn't make much sense to start working on extensions directory before b2evo 5 is released, since I would like it to be powered by b2evo 5.

i see.. do you need help with that sign-in plugin ? I have been messing with twitter & oAuth pretty much recently..

One of the guys has even started making a fb connect plugin, i thought i could help but never found time..

As far as the extension dir, how bout we make it using wordpress ? LOL

Apr 18, 2012 03:22

see.. do you need help with that sign-in plugin ? I have been messing with twitter & oAuth pretty much recently..

One of the guys has even started making a fb connect plugin, i thought i could help but never found time..

Creating a plugin for each provider will take a lot of time. I use Janrain Engage instead, it's free if you reЖ)ыегаагз to a 1000 users per year.
http://janrain.com/products/engage/

As far as the extension dir, how bout we make it using wordpress ? LOL

Then we would need to hire a wordpress geek, cos I'm not gonna mess with that stuff :)

Apr 18, 2012 12:15

sam2kb wrote:

see.. do you need help with that sign-in plugin ? I have been messing with twitter & oAuth pretty much recently..

One of the guys has even started making a fb connect plugin, i thought i could help but never found time..

Creating a plugin for each provider will take a lot of time. I use Janrain Engage instead, it's free if you reЖ)ыегаагз to a 1000 users per year.
http://janrain.com/products/engage/

As far as the extension dir, how bout we make it using wordpress ? LOL

Then we would need to hire a wordpress geek, cos I'm not gonna mess with that stuff :)

I dont approve of external services like "Engage"etc, whether the case is social login or anything else.I dont like relying on other services for my site to work..Heck i even use a local fallback for jquery (as if google cdn is ever going to be down ! )

Wordpress plugin API is rather simple, most plugin hooks are almost self-explanotary.. Even if i can work with it, you could easily do whatever you want.

I thought i would easily find a social login/register plugin for WP, however it wasnt that easy, most of the plugins were depending on external services like above, missing some features, not working or buggy etc...

I made a lot of research to find a suitable social login plugin for wordpress..I ended up using "wordpress-social-login", the best i could find.It supports most of the social providers..The only thing i didnt like about it was that it used "HybridAuth", because i used to work with Abraham's oAuth..Now i am trying to get the hang of Hybridauth and started to like it too..

Apr 18, 2012 18:51

That HybridAuth looks great. I missed that when I was searching for social sign-in app. Anyway, it's possible to easily adapt the plugin to use another service (or API) as a backend. The hardest thing was to sign-in or register a user in b2evo after its authentication.


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.