Hi,
I'm a bit lost in this thread. I'm trying to find the plugin for download but can't find it anywhere.
What am I missing?
Thanks.
Michael.
If you change the code in CBAuthorBot.php to the following, it will show the author's picture in the content. You can see it in action at www.lovelearnlive.com
If you use this and find it useful, please post here and let me know. I want to know that this is useful for more than just me. Some Karma would be nice too, but it's not necessary.
[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 $
**/
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;
//var_dump($row);
$query = "SELECT avatar FROM #__comprofiler WHERE user_id = $row->created_by AND avatarapproved = '1'";
$database->setQuery( $query );
$avatar = $database->loadResult();
$avatarlink = "";
$txt = "";
if ( $avatar ) {
$avatarlink = $mosConfig_live_site.'/images/comprofiler/tn'.$avatar;
$txt = "<a href=\"".sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$row->created_by)."\"><img src=\"$avatarlink\" border=\"0\" align=\"left\" class=\"authorimg\" /></a>";
}
$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>";
$row->text = $txt.$row->text;
//return $txt;
//<div class=\"authorimg\"></div>
//echo $row->created_by_alias;
}
?>[/code:1]
Post edited by: ccdog, at: 2006/03/27 05:29
Post edited by: ccdog, at: 2006/03/27 17:26
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Here's a new twist to the same idea. I hacked CBAuthorBot to display the avatar in a popup when you mouseover it.
This also works in my Newest Users module, and Who Is Online module.
Check it out at my site to see what I am talking about.
Arundel Class of 1983
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.