| 
Welcome, Guest

CBAuthorBot Hack - Show CB Avatar in articles
(1 viewing) (1) Guest

TOPIC: CBAuthorBot Hack - Show CB Avatar in articles

Re:CBAuthorBot Hack - Show CB Avatar in articles 6 years ago #11868

  • ccdog
  • ccdog
  • OFFLINE
  • Junior Boarder
    Junior Boarder
  • Posts: 23
  • Karma: 21
@peerlink

OK, try this:

 
 
<?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, cb_city FROM #__comprofiler WHERE user_id = $row->created_by AND avatarapproved = '1'";
$database->setQuery( $query );
$rows = $database->loadObjectList();
$row = $rows[0];
$avatar = $row->avatar;
$cb_city = $row->cb_city;
$avatarlink = "";
$txt = "";
if ( $avatar ) {
$avatarlink = $mosConfig_live_site.'/images/comprofiler/tn'.$avatar;
$txt = "<div class=\"akoauthorimg\"><a href=\"".sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$row->created_by)."\"><img src=\"$avatarlink\" border=\"0\" align=\"left\" class=\"authorimg\" /></a><br />$cb_city</div>";
}
$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;
}
 
 
?>
 
 


I have not tested this solution, but give it a try and see if it does what you want it to.

You will have to modify your CSS file to get it exactly how you want it. It puts the image and cb_city within a div with the class name akoauthorimg.

I hope this works for you

Re:CBAuthorBot Hack - Show CB Avatar in articles 6 years ago #13787

  • ffaabbss
  • ffaabbss
  • OFFLINE
  • Gold Boarder
    Gold Boarder
  • Posts: 288
  • Karma: 6
Bummer... somehow that hack doesn't work for me.. no images show up in articles... did somebody say before this didn't work in mamblog?

Re:CBAuthorBot Hack - Show CB Avatar in articles 6 years ago #13800

  • ccdog
  • ccdog
  • OFFLINE
  • Junior Boarder
    Junior Boarder
  • Posts: 23
  • Karma: 21
Bummer... somehow that hack doesn't work for me.. no images show up in articles... did somebody say before this didn't work in mamblog?


This probably won't work in Mamblog because Mamblog does not display Mambots. It should work with regular content items.

Re:CBAuthorBot Hack - Show CB Avatar in articles 6 years ago #13830

  • ericfoster3
  • ericfoster3
  • OFFLINE
  • Expert Boarder
    Expert Boarder
  • Posts: 83
  • Karma: 144
Is there any way to make the avatar show ONLY on the full story, and not on the front page, or the blog view?
CB 3rd Party Developer: DatsoTab | KarmaTab
Joomla! 1.0.10
Community Builder 1.0
joomlaboard 1.1.2

Re:CBAuthorBot Hack - Show CB Avatar in articles 6 years ago #13876

  • stevebor1
  • stevebor1
  • OFFLINE
  • Gold Boarder
    Gold Boarder
  • Posts: 311
  • Karma: 235
I really like what's going on here. your lovelearnlive.com site looks great.

I am interested in having the ability to enter in a users name/id the same way instead of just the author, kinda like {cbauthorbot_61} or even ditch the auhor part

because i write the articles, but feature members i want to link to. check out my pic I'll start a new thread if we get this going



Post edited by: stevebor1, at: 2006/05/25 10:24
Attachments:
Karma Me Up!


FITcommunity
Joomla! 1.0.12 - Community Builder 1.0.2 - Joomlaboard 1.1.2
Own Mods Featured Profile Mod
My Real Day Job

Mobile Wallet and Social Lending, Anywhere!

Re:CBAuthorBot Hack - Show CB Avatar in articles 6 years ago #13925

  • ccdog
  • ccdog
  • OFFLINE
  • Junior Boarder
    Junior Boarder
  • Posts: 23
  • Karma: 21
ericfoster3 wrote:
Is there any way to make the avatar show ONLY on the full story, and not on the front page, or the blog view?


I'm sure this is possible. You might try looking at the code for AKOCommentBot, and see how it accomplishes showing different things based on whether it is on the full sotry or front page/blog view.

stevebor1 wrote:
I really like what's going on here. your lovelearnlive.com site looks great.


Thanks! The kids in our youth group really seem to like it. It gives them an alternative to Xanga/MySpace.

I am interested in having the ability to enter in a users name/id the same way instead of just the author, kinda like {cbauthorbot_61} or even ditch the auhor part

because i write the articles, but feature members i want to link to. check out my pic I'll start a new thread if we get this going


I'm not sure what you are asking for here, but it sounds like a lot of work. I'm kind of limited on time right now, but maybe someone else can take a look at the hack that I did and modify it to suit your needs. All it amounts to is an SQL query and some presentation logic.

Good luck!
Time to create page: 0.93 seconds