Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
CBAuthorBot Hack - Show CB Avatar in articles
Date: 2006/03/27 12:27 By: ccdog Status: CB Doc subscriber  
Karma: 18  
Fresh Joomlapolitan

Posts: 23
graphgraph
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
Click here to see the profile of this user 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
graphgraph
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
Click here to see the profile of this user The administrator has disabled public write access.

Re:CBAuthorBot Hack - Show CB Avatar in articles
Date: 2006/03/27 23:25 By: ccdog Status: CB Doc subscriber  
Karma: 18  
Fresh Joomlapolitan

Posts: 23
graphgraph
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
Click here to see the profile of this user 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
graphgraph
Indeed... great work! Now all I have to do is style the css

Thanks! Karma goes...

up! haha
Joomla 1.0.8 + CB Stable
Click here to see the profile of this user The administrator has disabled public write access.

Re:CBAuthorBot Hack - Show CB Avatar in articles
Date: 2006/03/28 08:34 By: ccdog Status: CB Doc subscriber  
Karma: 18  
Fresh Joomlapolitan

Posts: 23
graphgraph
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
Click here to see the profile of this user 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
graphgraph
sure did, thanks!
Joomla 1.0.8 + CB Stable
Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login