Removing avatar / image function

16 years 6 months ago #47524 by maxdg
Removing avatar / image function was created by maxdg
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:1] //
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,sefRelToAbs($ue_userdetails_url), "",
"<img src=\"".$adminimagesdir."updateprofile.gif\" alt='' />","", $menuTexts,"" );
// Update Avatar:
if($ueConfig==1 && ($ueConfig==1 || $ueConfig==1)) {
$mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEAVATAR"]=null;
$this->_addMenuItem( $mi, $menuTexts,sefRelToAbs($ue_useravatar_url), "",
"<img src=\"".$adminimagesdir."newavatar.gif\" alt='' />","", $menuTexts,"" );
// Delete Avatar:
if($user->avatar!='' && $user->avatar!=null) {
$mi = array(); $mi["_UE_MENU_EDIT"]["_UE_DELETE_AVATAR"]=null;
$this->_addMenuItem( $mi, $menuTexts,sefRelToAbs($ue_deleteavatar_url), "",
"<img src=\"".$adminimagesdir."delavatar.gif\" alt='' />","", $menuTexts,"" );
}
}
}[/code:1]

To:

[code:1] //
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,sefRelToAbs($ue_userdetails_url), "",
"<img src=\"".$adminimagesdir."updateprofile.gif\" alt='' />","", $menuTexts,"" );
// Update Avatar:
// if($ueConfig==1 && ($ueConfig==1 || $ueConfig==1)) {
// $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_UPDATEAVATAR"]=null;
// $this->_addMenuItem( $mi, $menuTexts,sefRelToAbs($ue_useravatar_url), "",
// "<img src=\"".$adminimagesdir."newavatar.gif\" alt='' />","", $menuTexts,"" );
// Delete Avatar:
// if($user->avatar!='' && $user->avatar!=null) {
// $mi = array(); $mi["_UE_MENU_EDIT"]["_UE_DELETE_AVATAR"]=null;
// $this->_addMenuItem( $mi, $menuTexts,sefRelToAbs($ue_deleteavatar_url), "",
// "<img src=\"".$adminimagesdir."delavatar.gif\" alt='' />","", $menuTexts,"" );
// }
// }
}[/code:1]

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... ;)

Please Log in to join the conversation.

16 years 6 months ago #47530 by nant
Replied by nant on topic Re:Removing avatar / image function
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:1]if($ueConfig==1 && ($ueConfig==1 || $ueConfig==1)) {[/code:1]

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

Please Log in to join the conversation.

16 years 6 months ago #47536 by maxdg
Replied by maxdg on topic Re:Removing avatar / image function
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.. :D
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... :whistle:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.195 seconds

Facebook Twitter LinkedIn