I hope this topic is still active, or someone responds soon...
I've installed the CB Author plugin and hack. It's implemented here:
www.wmgt.com/index.php?option=com_content&task=view&id=2697&Itemid=103
But as you can see, there is a massive list of errors on the right hand side of the page. They say this:
[code:1]DB function failed with error number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND avatarapproved = '1'' at line 1 SQL=SELECT avatar FROM jos_comprofiler WHERE user_id = AND avatarapproved = '1'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'AND avatarapproved = \'1\'\' at line 1 SQL=SELECT avatar FROM jos_comprofiler WHERE user_id = AND avatarapproved = \'1\' [/code:1]
The CBAuthorbot.php file currently looks like this:
[code:1]<?php
/**
* CB Link 2 author mambot
* @package Community Builder
* @subpackage CB Link 2 author mambot
* @Copyright (C) MamboJoe
* @ All rights reserved
* @ Released under GNU/GPL License :
www.gnu.org/copyleft/gpl.html
* @version $Revision: 1 $
* modified by ccdog then phleum to add author avatars and captions
* -- this version requires a CB field "cb_bio" to function properly
**/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$_MAMBOTS->registerFunction( 'onBeforeDisplayContent', 'CBAuthorBot');
function CBAuthorBot (&$row, &$params, $page) {
global $database, $mosConfig_live_site;
// a few configs
$query = "SELECT cb_bio FROM #__comprofiler WHERE user_id = $row->created_by";
$database->setQuery( $query );
$cb_bio = $database->loadResult();
$caption = $cb_bio; // caption below author image
$show_all = false; // set to true to show author image everywhere
// Do not show general admin-- hardcoded to admin id
if ($row->created_by != 62) {
// allow usage of <!-- !Bio! --> to NOT show the author bot details
if(strstr($row->text, "!Bio!"«»)){
print str_replace("{!Bio!}", "", $row->text);
return;
}
// allow usage of <!-- !bio! --> to NOT show the author bot details
if(strstr($row->text, "nobio!"«»)){
print str_replace("{nobio!}", "", $row->text);
return;
}
$task = mosGetParam($_REQUEST, 'task', false);
$option = mosGetParam($_REQUEST, 'option', false);
//var_dump($row);
if ( ( ($option == 'com_content' || $option == 'content') && $task == 'view') || $show_all) {
$query = "SELECT avatar FROM #__comprofiler WHERE user_id = $row->created_by AND avatarapproved = '1'";
$database->setQuery( $query );
$avatar = $database->loadResult();
$avatarlink = "";
$txt = "";
if ( $avatar || $cb_bio ) {
$avatarlink = $mosConfig_live_site.'/images/comprofiler/tn'.$avatar;
$txt = "<div class=\"author_profile\"><a href=\"".sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$row->
created_by)."\" align=\"left\"><img src=\"$avatarlink\" border=\"0\" align=\"left\" hspace=\"10\" vspace=\"5\" /><div class=\"authorimg_caption\">$caption</div></a></div>";
}
$row->text = $txt.$row->text;
}
$row->created_by_alias="<a href=\"".sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$row->created_by)
."\">".($row->created_by_alias!='' ? $row->created_by_alias : $row->author)."</a>";
}
}
?>
[/code:1]
Any help please?? It would be greatly appreciated!