| 
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 5 years, 4 months ago #22436

  • Posts:
  • Karma:
To follow up on redlaguna's inquiry, has anyone succeeded in incorporating this hack with Mamblog?
Joomla 1.0.12
CB 1.1

Re:CBAuthorBot Hack - Show CB Avatar in articles 5 years, 3 months ago #23025

  • Posts:
  • Karma:
Phleum wrote:
Here's another tweaking. It's based on above and some of the other things in this thread. This version has the controls from the one above, plus pulls an additional field from community builder (in my case, it's cb_biography). and sticks it under the avatar. city would work, as someone had previously requested.

It's probably redundant the way I did the queries- I don't know PHP/MySQL well. If anyone can clean it up, great. It seems to be working for me, though.

<?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;
 
// a few configs
$query = "SELECT cb_biography FROM #__comprofiler WHERE user_id = $row->created_by AND avatarapproved = '1'";
$database->setQuery( $query );
$cb_biography = $database->loadResult();
$caption = $cb_biography; // caption below author image
$show_all = false; // set to true to show author image everywhere
 
// allow usage of <!-- !CBAuthorBot --> to NOT show the author bot details
if(strstr($row->text, "!CBAuthorBot"«»)){
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 ) {
$avatarlink = $mosConfig_live_site.'/images/comprofiler/'.$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\"class=\"authorimg\" /><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>";
 
}



Has anyone got this version to work. I keep getting a STRING error? Thanks.

Re:CBAuthorBot Hack - Show CB Avatar in articles 5 years, 3 months ago #23437

  • Posts:
  • Karma:
This may be a content.html.php-related issue rather than CBAuthorBot.php, but how can I move the article title from top of the avatar to the right side of it, above the article text?

The attached pic shows the article title 'test blog 3' above the avatar. I need to move this title to the right side of the avatar and above the article text.

TIA



Post edited by: zen, at: 2006/10/28 00:51
Attachments:
Joomla 1.0.12
CB 1.1

Re:CBAuthorBot Hack - Show CB Avatar in articles 5 years, 3 months ago #23473

  • Posts:
  • Karma:
In other words, I need to move the hacked CBAuthorBot before the blog article title.
Joomla 1.0.12
CB 1.1

Re:CBAuthorBot Hack - Show CB Avatar in articles 5 years, 3 months ago #23735

  • Posts:
  • Karma:
This is more or less what I would like to do as well... I would like my articles to look like this:

Attachments:

Added profile fied 5 years, 3 months ago #24333

  • Posts:
  • Karma:
This is nothing big but I don't think anyone did this yet. I added a profile fied in which users can put a short "bio" like found in article indexes and some blogs like About.

You can see it at my test site www.macongoodtimes.com (no worries this is not a lame attempt to promote this. It has no content)

If anyone is interested I will attach the code. I am just at work now.
Time to create page: 0.88 seconds