Bookmarking n Joomla

Posted by Aruna on Stack Overflow See other posts from Stack Overflow or by Aruna
Published on 2010-03-24T06:09:06Z Indexed on 2010/03/24 6:13 UTC
Read the original article Hit count: 517

Filed under:
|

Hi, i am using the Plugin Content Bookmarker downloaded from http://dev.aarthikaindia.com/downloads/category/3-plugins.html for my site.

Some of the Articles are able to Bookmark like if i click on the Bookmark (twitter) , it directly bookmarks in Twitter with Some description of the Article where some of the Articles are not bookmarked instead it just links to http://www.twitter.com..

Code :

 <?php

// no direct access

 defined( '_JEXEC' ) or die( 'Restricted access' );



$mainframe->registerEvent( 'onAfterDisplayContent', 'plgContentBookmarker' );



   function plgContentBookmarker( &$row, &$params, $page=0 )

  {

$plugin = & JPluginHelper::getPlugin('content', 'bookmarker');

// Load plugin params info

$pluginParams = new JParameter($plugin->params);

$id = $row->id;

$desc_tags = addslashes(str_replace("\n","",  $row->title ));

$desc_tags = trim($desc_tags);

$desc_tags_space= str_replace(',', ' ', @$desc_tags_space);

$desc_tags_semi = str_replace(',', ';', @$desc_tags_semi);

$desc_tags_space    = str_replace('  ', ' ', @$desc_tags_space);

$description1       = strip_tags( $row->introtext );

$description2       = str_replace("'", '', strip_tags($description1));

$description        = str_replace('"', '', strip_tags($description2));

$markme_title = $desc_tags;

$markme_ddesc = substr($description,0,400).'...';

$baseurl = JURI::base();

$title      = $pluginParams->def('title', 'Book Mark this Article');
    $facebook   = $pluginParams->def('facebook', '1');

$twitter    = $pluginParams->def('twitter', '1');

        $html.= '<div  onmouseover="javascript:if(document.getElementById(\'divShowAddBookmarker'.$id.'\').style.display ==\'none\'){document.getElementById(\'divShowAddBookmarker'.$id.'\').style.display =\'block\';}" 

                onmouseout="javascript:if(document.getElementById(\'divShowAddBookmarker'.$id.'\').style.display ==\'block\'){document.getElementById(\'divShowAddBookmarker'.$id.'\').style.display =\'none\';}"

                id="divShowAddBookmarker'.$id.'" style="display:none;position:absolute; background-color:#F4F4F4;width:240px;padding:3px;border:2px solid #999999;z-index:999">

        <div style="padding:2px;">';



if( $facebook == 1 ) { 

    $html.= '<div style="width:115px;float:left">

    <a style="text-decoration:none;" href="http://www.facebook.com/" onclick="window.open(\'http://www.facebook.com/share.php?u=\'+encodeURIComponent(location.href)+\'&amp;t='.$markme_title.'&amp;d='.$markme_ddesc.'\');return false;">

    <img style="vertical-align:bottom;padding:1px;" src="'.$baseurl."plugins/content/smart_bookmarker/facebook.gif".'" title="Facebook" name="facebook" border="0" id="facebook" alt="" />

                '.JText::_( 'Facebook' ).'

            </a>

            </div>';

}

if( $twitter == 1 ) {

    $html.= '<div style="width:115px;float:left">

                <a style="text-decoration:none;" href="http://www.twitter.com/" onclick="window.open(\'http://twitter.com/home/?status=\'+encodeURIComponent(location.href)+\'-'.$markme_ddesc.'\');return false;">

                    <img style="vertical-align:bottom;padding:1px;" src="'.$baseurl."plugins/content/smart_bookmarker/twitter.gif".'" title="twitter" name="twitter" border="0" id="twitter" alt="" />

                    '.JText::_( 'Twitter' ).'

                </a>

            </div>';

}







$html.= '<div style="clear:both"></div>

        </div>

        </div>';



return $html;

}

?>

In the CODE $markme_ddesc is used to give the status message which is the actual portion of the content which is tweeted ..

I had a doubt whether this $markme_ddesc is used to make the issue.. Is it so.. Please suggest me..

© Stack Overflow or respective owner

Related posts about php5

Related posts about joomla1.5