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

Joomlapolis Forums  


<< Start < Prev 11 12 13 14 15 16 17 18 19 20 Next > End >>
Re:CBAuthorBot Hack - Show CB Avatar in articles
Date: 2008/06/02 01:20 By: that1bander Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 3
graphgraph
Hey, does this work in 1.5? I have been looking for a way to have an avatar/gravatar/anything show up in an article's heading forever now. There is a bot called "Avatar/gravatar," but it screws up the css of your site.
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/06/04 18:00 By: studee Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 6
graphgraph
mediaguru wrote:
I'm so proud of myself. I figured out my own question.

Line 55:

Code:

           $avatarlink $mosConfig_live_site.'/images/comprofiler/'.$avatar;



Change to:
Code:

           $avatarlink $mosConfig_live_site.'/images/comprofiler/tn'.$avatar;



This loads the thumbnail instead of the full sized avatar.



Hi mediaguru!!,

it works well but adding the "tn" solves the problem only for the users with uploaded avatar , the users who selected a avatar from the avatar gallery available the path is "gallery/filename.gif" , how to fix this any solutions !!!


thanks for any help
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/06/04 19:07 By: fwd Status: User  
Karma: 1  
Fresh Joomlapolitan

Posts: 5
graphgraph
Here is a class I wrote a while back that retrieves the CB avatar among other thihngs:

Code:

  <?php /**  * @author gabe@fijiwebdesign.com  * @copyright (c) fijiwebdesign.com  * @license http://fijiwebdesign.com/ajaxchat/license/  * @package ajaxchats  * @name ajaxchat  */   defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); /** * Ajax Chat Comprofiler integration class * @package ajaxchat */ class ajc_comprofilerProfile {     var $_db// db object     var $query// sql     var $err// error     var $img_dir// image base dir     var $lang// configured language          /**     * Constructor     */     function ajc_comprofilerProfile($db) {         $this->_db $db;         $this->img_dir $GLOBALS['mosConfig_live_site'].'/images/comprofiler/';         $this->lang 'english';     }          /**     * Returns the cb fields     */     function userFields($sensitive = array('user_id')) {         $this->query "SELECT * FROM #__comprofiler_fields AS cf"         ."\n WHERE cf.table = '#__comprofiler' AND cf.name != 'NA'";         $this->_db->setQuery($this->query);         $all_fields $this->_db->loadObjectList();         $this->err $this->_db->stderr();                  // avoid sensitive info         $fields = array();         $tbl 'cb.';         $n count($all_fields);         for ($i 0$i $n$i++) {             /*if (in_array($all_fields[$i]->name, $sensitive)) {                 continue; // sensitive data, skip             }*/             $fields[$i]->Field $tbl.$all_fields[$i]->name;             $fields[$i]->Com 'com_comprofiler';         }                  return $fields;     }     /**     * Set a new Image base dir     */     function setImgDir($dir) {         $this->img_dir $dir;     }     /**     * Returns the img src for comprofiler user avatar     * @param string avatar url in db     * @param int comprofiler user id     */     function avatarUrlByEntry($avatar$userid) { // internal         if ($avatar && $avatar != '') {             if (!stristr($avatar'gallery/')) {                 $thumb_url sefRelToAbs($this->img_dir.'tn'.$avatar);             } else {                 $thumb_url sefRelToAbs($this->img_dir.$avatar);             }         } else {             $thumb_url sefRelToAbs($GLOBALS['mosConfig_live_site'].'/components/com_comprofiler/images/'.$this->lang.'/tnnophoto.jpg');         }         return $thumb_url;     }          /**     * Returns the img src for comprofiler user avatar given the user id     * @param int comprofiler user id     */     function avatarUrlById($userid) { // internal                  $this->query "SELECT c.avatar FROM #__comprofiler as c "         ."\n WHERE c.user_id = ".intval($userid)." LIMIT 1";         $this->_db->setQuery($this->query);         $avatar $this->_db->loadResult();         $this->err $this->_db->stderr();         return $this->avatarUrlByEntry($avatar$userid); // return avatar url     }          /**     * Returns the comprofiler details for user by userid     * @param int comprofiler user id     */     function userDetailsById($userid) {              // allow only published fields         require_once( $GLOBALS['mosConfig_absolute_path'].'/components/com_ajaxchat/ajaxchat.config.php' );         global $ajaxChat_config;         $fields $ajaxChat_config['field_published'];         if (count($fields) > 0) {             $query implode(','$fields);         }         print_r($query);         return;              $this->query "SELECT u.id, u.name, u.username, u.email, u.usertype, u.gid, u.registerDate, u.lastvisitDate, "         ."\n s.guest, s.time, "         ."\n a.is_ban, a.ban_by, a.ban_reason, a.last_login, a.karma, a.is_mod, "         ."\n c.*, ct.*, aa.* "         ."\n FROM #__comprofiler AS c "         ."\n LEFT JOIN #__users AS u ON (u.id = c.user_id)"         ."\n LEFT JOIN #__session AS s ON (s.userid = u.id)"         ."\n LEFT JOIN #__ajax_chat_users as a ON (a.userid = u.id)"         ."\n LEFT JOIN #__contact_details as ct ON (ct.user_id = u.id)"         ."\n LEFT JOIN #__ajax_chat_connections as aa ON (aa.userid = u.id)"         ."\n WHERE c.user_id = ".intval($userid)." LIMIT 1";         $this->_db->setQuery($this->query);         $this->_db->loadObject($row);         $this->err $this->_db->stderr();                  return $row;     } } ?>



The part of interest is: avatarUrlById() and avatarUrlByEntry():

Code:

     /**     * Returns the img src for comprofiler user avatar     * @param string avatar url in db     * @param int comprofiler user id     */     function avatarUrlByEntry($avatar$userid) { // internal         if ($avatar && $avatar != '') {             if (!stristr($avatar'gallery/')) {                 $thumb_url sefRelToAbs($this->img_dir.'tn'.$avatar);             } else {                 $thumb_url sefRelToAbs($this->img_dir.$avatar);             }         } else {             $thumb_url sefRelToAbs($GLOBALS['mosConfig_live_site'].'/components/com_comprofiler/images/'.$this->lang.'/tnnophoto.jpg');         }         return $thumb_url;     }          /**     * Returns the img src for comprofiler user avatar given the user id     * @param int comprofiler user id     */     function avatarUrlById($userid) { // internal                  $this->query "SELECT c.avatar FROM #__comprofiler as c "         ."\n WHERE c.user_id = ".intval($userid)." LIMIT 1";         $this->_db->setQuery($this->query);         $avatar $this->_db->loadResult();         $this->err $this->_db->stderr();         return $this->avatarUrlByEntry($avatar$userid); // return avatar url     }



documentation inline...
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/06/04 23:26 By: beat Status: Admin  
Karma: 242  
Admin

Posts: 4063
graphgraph
Cool

Thanks for sharing, could you please clarify the licensing terms, as the referenced licencing page is not avaliable ?
Beat - Developer on Community Builder core Team
- If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now
- Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
Click here to see the profile of this user The administrator has disabled public write access.

Re:CBAuthorBot Hack - Positioning???
Date: 2008/06/22 22:42 By: artketubah Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 4
graphgraph
How do I position the authorbot so that it isn't inside a <td id=contentpanelopen">

What if I want the avatar and bio to be on the bottom of the page or side by side with the content?

Right now, that can't happen because it is placed inside a <table> with the content of the article directly underneath.

I went over the mambot's code but that's not where the <table> is being added...
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/06/23 08:11 By: fwd Status: User  
Karma: 1  
Fresh Joomlapolitan

Posts: 5
graphgraph
The code I posted is GPL.
Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 11 12 13 14 15 16 17 18 19 20 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