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

Joomlapolis Forums  


Removing avatar / image function
Date: 2007/10/09 15:44 By: maxdg Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 6
graphgraph
Hello,

someone at joomla.org asks how to remove that function.
He has no needs to let users to put an avatar so the best I can suggest was to hack like this:

Edit file:

/components/com_comprofiler/plugin/user/plug_cbmenu/cb.menu.php - from 855 to 890

Change:

Code:

  // ----- EDIT MENU ----- if ( ! cbCheckIfUserCanPerformUserTask$user->id'allowModeratorsUserEdit') ) { if ( $user->id == $my->id ) { $menuTexts = array( '_UE_UPDATEPROFILE' => _UE_UPDATEPROFILE, '_UE_MENU_UPDATEPROFILE_DESC' => _UE_MENU_UPDATEPROFILE_DESC, '_UE_UPDATEAVATAR' => _UE_UPDATEAVATAR, '_UE_MENU_UPDATEAVATAR_DESC' => _UE_MENU_UPDATEAVATAR_DESC, '_UE_DELETE_AVATAR' => _UE_DELETE_AVATAR, '_UE_MENU_DELETE_AVATAR_DESC' => _UE_MENU_DELETE_AVATAR_DESC ); } else { $menuTexts = array( '_UE_UPDATEPROFILE' => _UE_MOD_MENU_UPDATEPROFILE, '_UE_MENU_UPDATEPROFILE_DESC' => _UE_MOD_MENU_UPDATEPROFILE_DESC, '_UE_UPDATEAVATAR' => _UE_MOD_MENU_UPDATEAVATAR, '_UE_MENU_UPDATEAVATAR_DESC' => _UE_MOD_MENU_UPDATEAVATAR_DESC, '_UE_DELETE_AVATAR' => _UE_MOD_MENU_DELETE_AVATAR, '_UE_MENU_DELETE_AVATAR_DESC' => _UE_MOD_MENU_DELETE_AVATAR_DESC ); } // Update Profile: $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEPROFILE"]=null; $this->_addMenuItem$mi$menuTexts['_UE_UPDATEPROFILE'],sefRelToAbs($ue_userdetails_url), "", "<img src=\"".$adminimagesdir."updateprofile.gif\" alt='' />",""$menuTexts['_UE_MENU_UPDATEPROFILE_DESC'],"" ); // Update Avatar: if($ueConfig['allowAvatar']==&& ($ueConfig['allowAvatarUpload']==|| $ueConfig['allowAvatarGallery']==1)) { $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEAVATAR"]=null; $this->_addMenuItem$mi$menuTexts['_UE_UPDATEAVATAR'],sefRelToAbs($ue_useravatar_url), "", "<img src=\"".$adminimagesdir."newavatar.gif\" alt='' />",""$menuTexts['_UE_MENU_UPDATEAVATAR_DESC'],"" ); // Delete Avatar: if($user->avatar!='' && $user->avatar!=null) { $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_DELETE_AVATAR"]=null; $this->_addMenuItem$mi$menuTexts['_UE_DELETE_AVATAR'],sefRelToAbs($ue_deleteavatar_url), "", "<img src=\"".$adminimagesdir."delavatar.gif\" alt='' />",""$menuTexts['_UE_MENU_DELETE_AVATAR_DESC'],"" ); } } }



To:

Code:

  // ----- EDIT MENU ----- if ( ! cbCheckIfUserCanPerformUserTask$user->id'allowModeratorsUserEdit') ) { if ( $user->id == $my->id ) { $menuTexts = array( '_UE_UPDATEPROFILE' => _UE_UPDATEPROFILE, '_UE_MENU_UPDATEPROFILE_DESC' => _UE_MENU_UPDATEPROFILE_DESC, // '_UE_UPDATEAVATAR' => _UE_UPDATEAVATAR, // '_UE_MENU_UPDATEAVATAR_DESC' => _UE_MENU_UPDATEAVATAR_DESC, // '_UE_DELETE_AVATAR' => _UE_DELETE_AVATAR, // '_UE_MENU_DELETE_AVATAR_DESC' => _UE_MENU_DELETE_AVATAR_DESC ); } else { $menuTexts = array( '_UE_UPDATEPROFILE' => _UE_MOD_MENU_UPDATEPROFILE, '_UE_MENU_UPDATEPROFILE_DESC' => _UE_MOD_MENU_UPDATEPROFILE_DESC, // '_UE_UPDATEAVATAR' => _UE_MOD_MENU_UPDATEAVATAR, // '_UE_MENU_UPDATEAVATAR_DESC' => _UE_MOD_MENU_UPDATEAVATAR_DESC, // '_UE_DELETE_AVATAR' => _UE_MOD_MENU_DELETE_AVATAR, // '_UE_MENU_DELETE_AVATAR_DESC' => _UE_MOD_MENU_DELETE_AVATAR_DESC ); } // Update Profile: $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEPROFILE"]=null; $this->_addMenuItem$mi$menuTexts['_UE_UPDATEPROFILE'],sefRelToAbs($ue_userdetails_url), "", "<img src=\"".$adminimagesdir."updateprofile.gif\" alt='' />",""$menuTexts['_UE_MENU_UPDATEPROFILE_DESC'],"" ); // Update Avatar: // if($ueConfig['allowAvatar']==1 && ($ueConfig['allowAvatarUpload']==1 || $ueConfig[' allowAvatarGallery']==1)) { // $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEAVATAR"]=null; // $this->_addMenuItem( $mi, $menuTexts['_UE_UPDATEAVATAR'],sefRelToAbs($ue_useravatar_url), "", // "<img src=\"".$adminimagesdir."newavatar.gif\" alt='' />","", $menuTexts[' _UE_MENU_UPDATEAVATAR_DESC'],"" ); // Delete Avatar: // if($user->avatar!='' && $user->avatar!=null) { // $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_DELETE_AVATAR"]=null; // $this->_addMenuItem( $mi, $menuTexts['_UE_DELETE_AVATAR'],sefRelToAbs($ue_deleteavatar_url), "", // "<img src=\"".$adminimagesdir."delavatar.gif\" alt='' />","", $menuTexts[' _UE_MENU_DELETE_AVATAR_DESC'],"" ); // } // } }



It seems to be an hardcoding to do that, but it works..
Is there any other way to do the same?


Thank You, Staff!
You do a great job with this component...
Click here to see the profile of this user The administrator has disabled public write access.

Re:Removing avatar / image function
Date: 2007/10/09 16:18 By: nant Status: Admin  
Karma: 466  
Admin

Posts: 6232
graph
Well, first of all I guess I should thank you for responding to the question (I didn't see the initial request).

Yup, this would work ... but if you look closer at some of the code you hacked (aka commented out) you will notice the if statement:

Code:

 if($ueConfig['allowAvatar']==&& ($ueConfig['allowAvatarUpload']==|| $ueConfig['allowAvatarGallery']==1)) {



yup - this means that there is a backend parameter that actually does this for you.
Nick A.
CB Core Team Member
Support CB Development and Get Detailed Documentation
Developer of Nant's Gallery plugin
CB Gallery Extensions Listing, Rate CB Gallery on Extensions Site
Developer of CB AutoWelcome Plugin
CB AutoWelcome Extensions Listing,Rate CB AutoWelcome on Extensions Site
People ignoring your call for help? Read this!
FAQ you
Joomlapolis Extensions Directory (new)- check it out!
Click here to see the profile of this user The administrator has disabled public write access.

Re:Removing avatar / image function
Date: 2007/10/09 17:01 By: maxdg Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 6
graphgraph
nant wrote:
Well, first of all I guess I should thank you for responding to the question (I didn't see the initial request).
No surprise... it is an OT inside another OT..
Was posted by Bergmann in the Italian Board, here

yup - this means that there is a backend parameter that actually does this for you.

... shame on me... and thanks to you...
Click here to see the profile of this user The administrator has disabled public write access.

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC4)

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 RC4, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers and now also to all registered joomlapolitans.

CB Login