populist
Monday, 21 February 2011 15:03

Social button hyves in K2 component

Written by  Digitechs
    Instructions for inserting a Hyves social button in the Joomla K2 component.
    in the K2 component for Joomla is no standard Hyves button. With these instructions you can let visitors place a hyves tip.

     

    This manual covers the standard K2 template, found at the following location:

    components/com_k2/templates/default/item.php

    From line 345 find the following code:

    components/com_k2/templates/default/item.php
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    
    	  <?php if($this->item->params->get('itemShareLinks')): ?>
    	  <!-- Item social links -->
    		<divdiv class="itemSocialLinksBlock">
    			<spanspan><?php echo JText::_("Social sharing"); ?></spanspan>
    			<ulul class="itemSocialLinks">
    				<lili><aa class="googlebuzz" title="<?php echo JText::_("Add to Google Buzz"); ?>" href="http://www.google.com/buzz/post?url=<?php echo $this->item->socialLink; ?>&amp;message=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Google Buzz"); ?></spanspan></aa></lili>
    				<lili><aa class="facebook" title="<?php echo JText::_("Add to Facebook"); ?>" href="http://www.facebook.com/sharer.php?u=<?php echo $this->item->socialLink; ?>&amp;t=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Facebook"); ?></spanspan></aa></lili>
    				<lili><aa class="delicious" title="<?php echo JText::_("Add to Delicious"); ?>" href="http://del.icio.us/post?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Delicious"); ?></spanspan></aa></lili>
    				<lili><aa class="digg" title="<?php echo JText::_("Digg this"); ?>" href="http://digg.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Digg this"); ?></spanspan></aa></lili>
    				<lili><aa class="reddit" title="<?php echo JText::_("Add to Reddit"); ?>" href="http://reddit.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Reddit"); ?></spanspan></aa></lili>
    				<lili><aa class="stumble" title="<?php echo JText::_("Add to StumbleUpon"); ?>" href="http://www.stumbleupon.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to StumbleUpon"); ?></spanspan></aa></lili>
    				<lili><aa class="myspace" title="<?php echo JText::_("Add to MySpace"); ?>" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=<?php echo $this->item->socialLink; ?>&amp;t=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to MySpace"); ?></spanspan></aa></lili>
    				<lili><aa class="technorati" title="<?php echo JText::_("Add to Technorati"); ?>" href="http://www.technorati.com/faves?add=<?php echo $this->item->socialLink; ?>" target="_blank"><spanspan><?php echo JText::_("Add to Technorati"); ?></spanspan></aa></lili>
    				<lili class="clr"></lili>
    			</ulul>
    			<divdiv class="clr"></divdiv>
    		</divdiv>
    	  <?php endif; ?>
     

    Place the follwing line in between:
    (after: "<li><a class="technorati")

     

    <lili><aa class="hyves" title="<?php echo JText::_("Add to Hyves"); ?>" href="http://www.hyves-share.nl/button/tip/?tipcategoryid=12&rating=5&title=<?php echo $this->item->title; ?>&body=<?php echo $this->item->socialLink; ?>" target="_blank"><spanspan><?php echo JText::_("Add to Hyves"); ?></spanspan></aa></lili>

     

    So you should get this:

    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    
    	  <?php if($this->item->params->get('itemShareLinks')): ?>
    	  <!-- Item social links -->
    		<divdiv class="itemSocialLinksBlock">
    			<spanspan><?php echo JText::_("Social sharing"); ?></spanspan>
    			<ulul class="itemSocialLinks">
    				<lili><aa class="googlebuzz" title="<?php echo JText::_("Add to Google Buzz"); ?>" href="http://www.google.com/buzz/post?url=<?php echo $this->item->socialLink; ?>&amp;message=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Google Buzz"); ?></spanspan></aa></lili>
    				<lili><aa class="facebook" title="<?php echo JText::_("Add to Facebook"); ?>" href="http://www.facebook.com/sharer.php?u=<?php echo $this->item->socialLink; ?>&amp;t=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Facebook"); ?></spanspan></aa></lili>
    				<lili><aa class="delicious" title="<?php echo JText::_("Add to Delicious"); ?>" href="http://del.icio.us/post?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Delicious"); ?></spanspan></aa></lili>
    				<lili><aa class="digg" title="<?php echo JText::_("Digg this"); ?>" href="http://digg.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Digg this"); ?></spanspan></aa></lili>
    				<lili><aa class="reddit" title="<?php echo JText::_("Add to Reddit"); ?>" href="http://reddit.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to Reddit"); ?></spanspan></aa></lili>
    				<lili><aa class="stumble" title="<?php echo JText::_("Add to StumbleUpon"); ?>" href="http://www.stumbleupon.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to StumbleUpon"); ?></spanspan></aa></lili>
    				<lili><aa class="myspace" title="<?php echo JText::_("Add to MySpace"); ?>" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=<?php echo $this->item->socialLink; ?>&amp;t=<?php echo urlencode($this->item->title); ?>" target="_blank"><spanspan><?php echo JText::_("Add to MySpace"); ?></spanspan></aa></lili>
    				<lili><aa class="technorati" title="<?php echo JText::_("Add to Technorati"); ?>" href="http://www.technorati.com/faves?add=<?php echo $this->item->socialLink; ?>" target="_blank"><spanspan><?php echo JText::_("Add to Technorati"); ?></spanspan></aa></lili>
    				<lili><aa class="hyves" title="<?php echo JText::_("Add to Hyves"); ?>" href="http://www.hyves-share.nl/button/tip/?tipcategoryid=12&rating=5&title=<?php echo $this->item->title; ?>&body=<?php echo $this->item->socialLink; ?>" target="_blank"><spanspan><?php echo JText::_("Add to Hyves"); ?></spanspan></aa></lili>
    				<lili class="clr"></lili>
    			</ulul>
    			<divdiv class="clr"></divdiv>
    		</divdiv>
    	  <?php endif; ?>
     

     

    You can eventually remove the social links you're not using bij remove them from  <li> to </li>. Or you can rearrange the items.

    To finish the whole story, you can add a language item.
    Dit doe je op de volgende wijze:

    Open  ' nl-NL.com_k2.ini ' That's in the folder '/language/nl-NL/'
    (Unless you don't use the dutch language: just replace 'nl-NL' by 'en-GB')

    In this file you find the next line:

     

    ADD TO TECHNORATI=Toevoegen aan Technorati

     

     

    An below this line you add the next line:

     

    ADD TO HYVES=Tip plaatsen op Hyves

    (or in english file: ADD TO HYVES=Tip to Hyves

    Now you have a hyves social button in your K2 component.

    If you're lazy, you can download this at the bottom of this article. Upload the contents of the file to the root of your joomal installation and you're done.

    Good luck.

     

    Last modified on Monday, 28 February 2011 16:13

    Add comment


    Security code
    Refresh