|
|
CBAuthorBot Hack - Show CB Avatar in articles
|
|
Date: 2006/03/27 12:27
|
By: ccdog
|
Status:
|
|
|
Karma: 18  
|
|
Fresh Joomlapolitan  | Posts: 23 |   | |
|
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: | <?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 : http://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;
}
?>
|
Post edited by: ccdog, at: 2006/03/27 05:29
Post edited by: ccdog, at: 2006/03/27 17:26 http://www.howtojoomla.net http://www.joomlaform.com
|
|
The administrator has disabled public write access. |
|
|
|
Re:CBAuthorBot Hack - Show CB Avatar in articles
|
|
Date: 2006/03/27 13:34
|
By: Red1000
|
Status: User
|
|
|
Karma: 1  
|
|
Senior Joomlapolitan  | Posts: 55 |   | |
|
I copied your code and pasted it into the .php file and it didn't work... not sure why, it looks great on your site, though! Joomla 1.0.8 + CB Stable
|
|
The administrator has disabled public write access. |
|
|
|
Re:CBAuthorBot Hack - Show CB Avatar in articles
|
|
Date: 2006/03/27 23:25
|
By: ccdog
|
Status:
|
|
|
Karma: 18  
|
|
Fresh Joomlapolitan  | Posts: 23 |   | |
|
OK, I think I just figured it out...
Wherever it says
| Code: | $mosConfig_livesite
|
you need to change that to
| Code: | $mosConfig_live_site
|
Post edited by: ccdog, at: 2006/03/27 16:36 http://www.howtojoomla.net http://www.joomlaform.com
|
|
The administrator has disabled public write access. |
|
|
|
Re:CBAuthorBot Hack - Show CB Avatar in articles
|
|
Date: 2006/03/28 04:16
|
By: Red1000
|
Status: User
|
|
|
Karma: 1  
|
|
Senior Joomlapolitan  | Posts: 55 |   | |
|
Indeed... great work! Now all I have to do is style the css 
Thanks! Karma goes...
up! haha Joomla 1.0.8 + CB Stable
|
|
The administrator has disabled public write access. |
|
|
|
Re:CBAuthorBot Hack - Show CB Avatar in articles
|
|
Date: 2006/03/28 08:34
|
By: ccdog
|
Status:
|
|
|
Karma: 18  
|
|
Fresh Joomlapolitan  | Posts: 23 |   | |
|
I'm glad you like it...Thanks for the karma!
On a side note...
You probably already noticed this, but I put class="authorimg" in the "<img..." tag. So, if you want to style the picture, you simply have to use:
img.authorimg { ... } http://www.howtojoomla.net http://www.joomlaform.com
|
|
The administrator has disabled public write access. |
|
|
|
Re:CBAuthorBot Hack - Show CB Avatar in articles
|
|
Date: 2006/03/28 09:35
|
By: Red1000
|
Status: User
|
|
|
Karma: 1  
|
|
Senior Joomlapolitan  | Posts: 55 |   | |
|
sure did, thanks! Joomla 1.0.8 + CB Stable
|
|
The administrator has disabled public write access. |
|
|