Skip to Content Skip to Menu

CBAuthorBot Hack - Show CB Avatar in articles

  • asteroidy
  • asteroidy
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
18 years 2 months ago #21367 by asteroidy
Replied by asteroidy on topic Re:CBAuthorBot Hack - Avatar popup on mouseover
ericfoster3 wrote:

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


Can you tell us how this is done? :(

Please Log in or Create an account to join the conversation.

  • Benson
  • Benson
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 1
18 years 1 month ago #21959 by Benson
asteroidy wrote:

ericfoster3 wrote:

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


Can you tell us how this is done? :(


I double this, could you post your modifications?

cheers,
Benson

Please Log in or Create an account to join the conversation.

18 years 1 month ago #21963 by ericfoster3
Replied by ericfoster3 on topic Re:CBAuthorBot Hack - Avatar popup on mouseover
Ok, here the steps you need to follow:

1. Upload wz_tooltip.js to the same directory, where the joomla configuration files is stored.

2. Open the index.php of your template and at this at the bottom before the </body> tag:
<script language="JavaScript" type="text/javascript" src="wz_tooltip.js"></script>

3. upload my CBAuthorBot.php and replace the original one.

I tried to attach the file wz_tooltip.js to this post. Didn't work. You can get it from my profile as soon as Nant approves it.


Here is the code of my CBAuthorBot.php file:
[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();


if ($avatar!='')
{
$image = "<img src=/images/comprofiler/".$avatar." width=40>";

}
else
{
$image = "<img src=/components/com_comprofiler/images/english/tnnophoto.jpg width=40>";
}

/**
* $content.= "<a href='".sefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user=$row->userid"«»)
*
* ."' class='mod_login".$class_sfx."' onmouseover=\"this.T_WIDTH=40;return escape('".$image."')\">".($row->created_by_alias!='' ? $row->created_by_alias : $row->author)."</a>\n";
*
**/


$row->created_by_alias="<a href=\"".sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&Itemid=2&user='.$row->created_by)."\" onmouseover=\"this.T_WIDTH=40;return escape('".$image."')\">".($row->created_by_alias!='' ? $row->created_by_alias : $row->author)."</a>";
//echo $row->created_by_alias;

}


?>[/code:1]

I remember having trouble getting this to work, but it was so long ago, I forgot what the issues were.

Good luck.
.

Post edited by: ericfoster3, at: 2006/10/03 21:31

CB 3rd Party Developer: DatsoTab | KarmaTab
Joomla! 1.0.10
Community Builder 1.0
joomlaboard 1.1.2

Please Log in or Create an account to join the conversation.

  • Benson
  • Benson
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 1
18 years 1 month ago #21965 by Benson
Thank you very much for your answer! :)

cheers,
Benson

Please Log in or Create an account to join the conversation.

  • bjraines
  • bjraines
  • OFFLINE
  • Posts: 87
  • Thanks: 0
  • Karma: 2
18 years 1 month ago #22388 by bjraines
This is exactly what I am looking for!

However I can't tell from the thread where to start or what the most updated version is.

I can't tell if it is a mambot I upload or a just some code I add in.

Any help would be awesome. I am notorious for teaing up code so I want to make sure I know exactly what I am doing.

Thanks!

Please Log in or Create an account to join the conversation.

  • Marc72
  • Marc72
  • OFFLINE
  • Posts: 22
  • Thanks: 0
  • Karma: 2
18 years 1 month ago #22424 by Marc72
Thats awesome I get it work at my page:) thxxx and karma up :)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum