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

Joomlapolis Forums  


<< Start < Prev 21 Next > End >>
Re:CBAuthorBot Hack - Show CB Avatar in articles
Date: 2008/07/21 05:35 By: garciad Status: User  
Karma: 1  
Fresh Joomlapolitan

Posts: 5
graphgraph
I tested several ways of this hack, but I have a little question. I use the original hack sent by ccdog.
The hacks it's ok, but I want to know if there is a way to show the avatar in the intro of the article too.

In the way it is, it shows me the avatar only when I click on "Read More" and the full article opens. I want to show when the article is in the "intro" view, and when the article is in the "full view".

Is there a way to do this?

Thanks a lot to all!

GUe.
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: 2008/08/29 01:16 By: MMPatriko Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 1
graphgraph
Hey ccdog,

Great work on getting the avatars into articles. I'm wondering if it's possible to hide the avatar on certain articles once we've used your method. At the moment the avatar shows on all articles written by the user, even after hiding fields such as "Author Name" etc. This is great for blogs, but not when we want to make informational/static pages.

I've found a work around however. I just set the author to Administrator for now. But just thought you'd like to know if you want to add more functionality to your hack.

Again great work.
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: 2008/10/02 18:58 By: cherold Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 1
graphgraph
I hope this topic is still active, or someone responds soon...

I've installed the CB Author plugin and hack. It's implemented here: http://www.wmgt.com/index.php?option=com_content&task=view&id=2697&Itemid=103

But as you can see, there is a massive list of errors on the right hand side of the page. They say this:

Code:

 DB function failed with error number 1064 You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'AND avatarapproved = '1'' at line 1 SQL=SELECT avatar FROM jos_comprofiler WHERE user_id = AND avatarapproved '1'You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near \'AND avatarapproved = \'1\'\' at line 1 SQL=SELECT avatar FROM jos_comprofiler WHERE user_id = AND avatarapproved \'1\' 



The CBAuthorbot.php file currently looks like this:

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 $ * modified by ccdog then phleum to add author avatars and captions * -- this version requires a CB field "cb_bio" to function properly **/ 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_bio FROM #__comprofiler WHERE user_id = $row->created_by";         $database->setQuery$query );         $cb_bio $database->loadResult();     $caption $cb_bio// caption below author image     $show_all false// set to true to show author image everywhere     // Do not show general admin-- hardcoded to admin id     if ($row->created_by != 62) {     // allow usage of <!-- !Bio! --> to NOT show the author bot details     if(strstr($row->text"!Bio!")){         print str_replace("{!Bio!}"""$row->text);         return;     }     // allow usage of <!-- !bio! --> to NOT show the author bot details     if(strstr($row->text"nobio!")){         print str_replace("{nobio!}"""$row->text);         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 || $cb_bio ) {           $avatarlink $mosConfig_live_site.'/images/comprofiler/tn'.$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\" align=\"left\" hspace=\"10\" vspace=\"5\" /><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>"; } } ?>



Any help please?? It would be greatly appreciated!
Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 21 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