1
demian
set new default avatar for new user
  • 2010/11/18 0:44

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


Im using the profile module,

how do I set the default avatar that new user get when they register..i want to change it to something else

right now it is the blank.gif

i want to change it to custom.jpg

2
mariane
Re: set new default avatar for new user
  • 2010/11/18 8:59

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


there is a picture called : blank.gif inside the folder uploads, it's a blank picture, you can create on your photoshop or your favorite picture's editor an image to be used as default for new users, then save it as : blank.gif and upload it to the same path, it means the uploads folder and replace the current blank one.
try it and let me know the results
the road of success is always under construction

3
ghia
Re: set new default avatar for new user
  • 2010/11/18 10:37

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


blank.gif is used in other places too. So, it may popup on unexpected places.
Better is it to replace it in the following places by blank.png:
// Dans le fichier /edituser.php (il y a 4 blank.gif):
     
Vers la ligne 246:     if (!empty($oldavatar) && $oldavatar != 'blank.gif') {
    
Vers la ligne 267:     $avatar_selected in_array($avatar_selectedarray_keys($avatar_list)) ? $avatar_selected "blank.gif";
    
Vers la ligne 363:             $user_avatar 'blank.gif';
    
Vers la ligne 388:         if ($user_avatar != 'blank.gif') {
// Dans le fichier /register.php (il y a 1 blank.gif):
    
Vers la ligne 125:             $newuser->setVar('user_avatar''blank.gif'true);
// Dans le fichier /class/commentrenderer.php (il y a 2 blank.gif):
    
Vers la ligne 330:                 $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif';
    
Vers la ligne 343:         $poster['avatar'] = 'blank.gif';
// Dans le fichier /include/findusers.php (il y a 2 blank.gif):
    
Vers la ligne 547:                 $criteria->add(new Criteria('user_avatar'"('', 'blank.gif')"'NOT IN'));
    
Vers la ligne 549:                 $criteria->add(new Criteria('user_avatar'"('', 'blank.gif')"'IN'));
// Dans le fichier /kernel/avatar.php (il y a 1 blank.gif):
    
Vers la ligne 380:             'blank.gif' => _NONE);
// Dans le fichier /modules/profile/edituser.php (il y a 4 blank.gif):
    
Vers la ligne 111:     if (!empty($oldavatar) && $oldavatar != 'blank.gif') {
    
Vers la ligne 131:     $avatar_selected in_array($avatar_selectedarray_keys($avatar_list) ) ? $avatar_selected "blank.gif";
    
Vers la ligne 221:             $user_avatar 'blank.gif';
    
Vers la ligne 246:         if ($user_avatar != 'blank.gif') {
// Dans le fichier /modules/profile/userinfo.php (il y a 1 blank.gif):
    
Vers la ligne 138: if ($thisUser->getVar('user_avatar') && "blank.gif" != $thisUser->getVar('user_avatar')) {
// Dans le fichier /modules/system/admin/avatars/main.php (il y a 2 blank.gif):
    
Vers la ligne 225:             $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif' WHERE uid=".intval($user_id));
    
Vers la ligne 227:             $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif' WHERE user_avatar='".$file."'");
// Dans le fichier /modules/system/admin/users/main.php (il y a 1 blank.gif):
    
Vers la ligne 181:             $newuser->setVar("user_avatar",'blank.gif');
// Dans le fichier /modules/system/admin/users/users.php (il y a 1 blank.gif):
    
Vers la ligne 78//  $avatar_value = "blank.gif";
// Dans le fichier /modules/system/blocks/system_blocks.php (il y a 2 blank.gif):
    
Vers la ligne 291:             $block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') != 'blank.gif' XOOPS_UPLOAD_URL.'/'.$newmembers[$i]->getVar('user_avatar') : '';
    
Vers la ligne 320:             $block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') != 'blank.gif' XOOPS_UPLOAD_URL.'/'.$topposters[$i]->getVar('user_avatar') : '';

4
demian
Re: set new default avatar for new user
  • 2010/11/22 13:26

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


i change in root register
from
$newuser->setVar('user_avatar', 'blank.gif', true);
to
$newuser->setVar('user_avatar', 'avatars/custom.gif', true);

and it not working

the user still got blank.gif as avatars

have updated the profile module and the system module

Im using xoops 2.5 final

5
demian
Re: set new default avatar for new user
  • 2010/12/3 8:49

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


bump..still not working

6
ghia
Re: set new default avatar for new user
  • 2010/12/3 9:10

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


When you use the profile module, registering is done with /modules/profile/register.php
Change also there.

7
demian
Re: set new default avatar for new user
  • 2010/12/4 13:03

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


i can't find any blank.gif in modules/profile/register.php

8
ghia
Re: set new default avatar for new user
  • 2010/12/4 13:41

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Did you change it in all mentioned places?

9
demian
Re: set new default avatar for new user
  • 2010/12/5 23:42

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


Quote:
Did you change it in all mentioned places?


No. do i really need to ?

i want to test this in the registration before proceed to the other files ?


Thanks Ghia

10
ghia
Re: set new default avatar for new user
  • 2010/12/6 14:55

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I would suppose yes, for having a consistent working system and given that the things are related.

Login

Who's Online

331 user(s) are online (202 user(s) are browsing Support Forums)


Members: 0


Guests: 331


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits