[SOLVED] Google+ button in sharing articles?

GK User
Fri Sep 23, 2011 11:23 am
Hello,

Is there any way to add G+ button to social sharing of articles?

It would be much appreciated. :)

If yes, please send a path to a file that I need to edit, and code that I need to add. :) I`ll manage to edit a picture of sharing option probably by myself.




Image 22.jpg
User avatar
Fresh Boarder

GK User
Fri Sep 23, 2011 11:29 pm
Here is a quick hack , check attached image on how it looks.

Open templatesgk_myfoliolayoutsblockshead.php
Find Line 104, 105
Code: Select all
   // include JavaScript
   $this->addJS($this->URLtemplate() . '/js/gk.scripts.js');


Add After below code:
Code: Select all
   $this->addJS('http://apis.google.com/js/plusone.js');


So it looks like
Code: Select all
   // include JavaScript
   $this->addJS($this->URLtemplate() . '/js/gk.scripts.js');
   $this->addJS('http://apis.google.com/js/plusone.js');


Open file "templatesgk_myfoliohtmlcom_k2templatesdefaultitem.php"
Find Lines: 450,451,452 which is
Code: Select all
                           <li>
                                 <a class="technorati" title="<?php echo JText::_('K2_ADD_TO_TECHNORATI'); ?>" href="http://www.technorati.com/faves?add=<?php echo $this->item->socialLink; ?>" target="_blank"><span><?php echo JText::_('K2_ADD_TO_TECHNORATI'); ?></span></a>
                           </li>


Add Below after:
Code: Select all
            <li>
                             <g:plusone size="small" ></g:plusone>
                           </li>


So it looks like
Code: Select all
                           <li>
                                 <a class="technorati" title="<?php echo JText::_('K2_ADD_TO_TECHNORATI'); ?>" href="http://www.technorati.com/faves?add=<?php echo $this->item->socialLink; ?>" target="_blank"><span><?php echo JText::_('K2_ADD_TO_TECHNORATI'); ?></span></a>
                           </li>
            <li>
                   <g:plusone size="small" ></g:plusone>
                           </li>
User avatar
Platinum Boarder

GK User
Sat Sep 24, 2011 5:26 am
Thanks once again for your help ( and for all the future cases in advance :D ). I'll try the code today, and just post a quick reply with results.But I don't have a doubt that it works. :)
User avatar
Fresh Boarder

GK User
Thu Sep 29, 2011 9:50 am
Nice hack, thanks for sharing, works fine.
User avatar
Expert Boarder

GK User
Thu Sep 29, 2011 9:55 am
No problem at all...
User avatar
Platinum Boarder

GK User
Thu Sep 29, 2011 10:37 am
I just wonder would that be possible also for linkedin? would be a good one for a folio to share it at linked in.
User avatar
Expert Boarder

GK User
Thu Sep 29, 2011 10:50 am
For linkedin you need to code extra php to get current url , url title etc etc and then combine them into a link which can be submitted to linkedin. So kind of takes a bit of time...
I am sure there are plugins available in joomla extensions which can be used perhaps...
User avatar
Platinum Boarder

GK User
Thu Sep 29, 2011 10:55 am
The social icons in the module at the bottom right, i think i just add the icon and link it directly to my page... the easiest way ;)
User avatar
Expert Boarder

GK User
Thu Sep 29, 2011 11:36 am
Well i just had a quick try and i can get the icon and links etc but we cant customize the looks of the button by simply using a simple script loading from linked in. If you like to try and see if you like it use it: )
After you add below code which was for G+

Code: Select all
            <li>
                             <g:plusone size="small" ></g:plusone>
                           </li>


Add this after it which shows button with bubble on the right.
Code: Select all
            <li>
                   <script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-counter="right"></script>
                                </li>

If you only want the button and no bubble data counter then add as below instead of above.
Code: Select all
            <li>
                   <script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share"></script>
                                </li>
User avatar
Platinum Boarder

GK User
Thu Sep 29, 2011 1:04 pm
I will try and let you know!
User avatar
Expert Boarder

GK User
Thu Sep 29, 2011 1:23 pm
works great! thnx B)
User avatar
Expert Boarder

GK User
Thu Sep 29, 2011 5:44 pm
No problem at all...
User avatar
Platinum Boarder


cron