well i know you didn't make it, but i thought you could help me,
well i have a diggbot and it shows the digg on the content viewed, when you sumbit there is a digg_title function so it auto inserts the title i made this work using getPageTitle(); but i want to remove the site title so its just the article. how would i do this?
diggbot script:
<?php
/**
* DiggBot
* www.chadbrantly.com
*
* @package DiggBot
* @copyright (C)2007 Chad Brantly
* @license GNU/GPL
*
**/
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
global $mosConfig_lang, $mosConfig_absolute_path;
$_MAMBOTS->registerFunction( 'onPrepareContent', 'botShowDigg' );
/*$_MAMBOTS->registerFunction( 'onBeforeDisplayContent', 'botShowDigg' );*/
function botShowDigg( $published, &$row, &$params, $page=0 ) {
global $_MAMBOTS, $mosConfig_live_site, $database, $Itemid;
if( $published && isset($row->title_alias) ) {
$query = "SELECT params"
. "n FROM jos_mambots"
. "n WHERE element = 'diggbot'"
. "n AND folder = 'content'"
;
$database->setQuery( $query );
$database->loadObject($mambot);
$query = "SELECT id "
. "n FROM `jos_menu` "
. "n WHERE `menutype`='mainmenu'"
. "n AND `published` =1"
. "n ORDER BY `ordering` ASC "
. "n LIMIT 0, 1 ";
$database->setQuery( $query );
$frontpage_id = $database->loadResult();
$botParams = new mosParameters( $mambot->params );
$frontpage = $botParams->def( 'frontpage', 0 );
if( $Itemid != $frontpage_id || $frontpage ) {
ob_start(); ?>
<?php global $mainframe;
if($mainframe->getCustomPathWay){
$pageTitle = $mainframe->getCustomPathWay;
}else{
$pageTitle = $mainframe->getPageTitle();
}
?>
<div style="float:right; margin-left:8px;">
<script type="text/javascript">
digg_url = "<?php echo $site.diggbot_buildLink($row->id); ?>";
digg_title = "<?php echo $pageTitle ?>";
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
$row->text = $html.$row->text;
}
}
return true;
}
// build the link to the content item given its id
function diggbot_buildLink($contentid) {
$link = '';
if ($contentid) {
$Itemid = diggbot_getItemId($contentid);
// Blank itemid checker for SEF
if ($Itemid == NULL) {
$Itemid = '';
} else {
$Itemid = '&Itemid='. $Itemid;
}
$link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $contentid . $Itemid );
}
return $link;
}
// get the itemid for content item given its id
function diggbot_getItemId($id) {
global $database, $mainframe;
// get itemid if contentitem in menu
$query = "select id from jos_menu where published = '1' and (type = 'content_item_link' OR type = 'content_typed') and componentid='$id';";
$database->setQuery( $query );
$Itemid = $database->loadresult();
if (!$Itemid) {
// needed to reduce queries used by getItemid
$bs = $mainframe->getBlogSectionCount();
$bc = $mainframe->getBlogCategoryCount();
$gbs = $mainframe->getGlobalBlogSectionCount();
// get Itemid
$Itemid = $mainframe->getItemid( $id, 0, 0, $bs, $bc, $gbs );
}
return $Itemid ? $Itemid : 0;
}
?>