hello, this is a simple trick to force  pligg avatar system to use user id instead of username.  the problem of pligg avatar system arise with non english letter. it happens when pligg try to write the avatar image file using the username_30.jpg which gives a wrong filename so pligg can not reuse the image file again.

this problem was solved in pligg 1.0.1.  I am writing this post to whom using an older version of pligg and do not want to upgrade to the newer version.

all required steps are written in this file: pligg avatar based on userId


#######################################
lines to modify per file
#######################################
----------------------
/profile.php:
----------------------
change line 78
$imagename = $current_user->user_login . "_original.jpg";
to
$imagename = $current_user->user_id . "_original.jpg";
 
change line 93
$img->pSave($user_image_path . $current_user->user_login . "_".Avatar_Large.".jpg");
to
$img->pSave($user_image_path . $current_user->user_id . "_".Avatar_Large.".jpg");
 
change line <a href="http://onlinelevitracheap.net ">cheap levitra order</a>  101
$img-&gt;pSave($user_image_path . $current_user-&gt;user_login . "_".Avatar_Small.".jpg");
to
$img-&gt;pSave($user_image_path <a href="http://ampicillinpills.com">buy cheap Ampicillin online Drugstore</a>  . $current_user-&gt;user_id . "_".Avatar_Small.".jpg");
 
change lines 133 &amp; 134
$main_smarty-&gt;assign('Avatar_ImgLarge', get_avatar('large', <a href="http://amoxilpills.net">cheap Amoxil without prescription online  buy</a>  $user-&gt;avatar_source, $user-&gt;username, $user-&gt;email));
$main_smarty-&gt;assign('Avatar_ImgSmall', get_avatar('small', $user-&gt;avatar_source, $user-&gt;username, $user-&gt;email));
to
$main_smarty-&gt;assign('Avatar_ImgLarge', get_avatar('large', $user-&gt;avatar, "", $user-&gt;email,$user-&gt;id));
$main_smarty-&gt;assign('Avatar_ImgSmall', get_avatar('small', <a href="http://amoxil-pharm.com">amoxicillin</a>  $user-&gt;avatar, "", $user-&gt;email,$user-&gt;id));
 
----------------------
/libs/html1.php:
----------------------
change line 49
$voters[$key]['Avatar_ImgSrc'] = get_avatar($avatar_size, "", $val['user_login'], $val['user_email']);
to
$voters[$key]['Avatar_ImgSrc'] = get_avatar($avatar_size, "", $val['user_login'], $val['user_email'], $val['user_id']);
 
change line 177
$imgsrc = my_pligg_base . User_Upload_Avatar_Folder . "/" . $user_name . "_" . $imgsize . ".jpg";
to
$imgsrc = my_pligg_base . User_Upload_Avatar_Folder . "/" . $user_id . "_" . $imgsize . ".jpg";
 
----------------------
/user.php:
----------------------
change line 72
$last_viewers_avatar[] = get_avatar('small', "", $viewers-&gt;username, $viewers-&gt;email);
to
$last_viewers_avatar[] = get_avatar('small', "", $viewers-&gt;username, $viewers-&gt;email,$viewers-&gt;id);
 
change <a href="http://moneygramlocations.info/moneygram-texas-abilene.php">moneygram texas</a>  line 91
$main_smarty-&gt;assign('Avatar_ImgSrc', get_avatar('large', '', $user-&gt;username,   $user-&gt;email));
to
$main_smarty-&gt;assign('Avatar_ImgSrc', <a href="http://onlinelevitracheap.com ">order levitra</a>  get_avatar('large', '', $user-&gt;username, $user-&gt;email,$user-&gt;id));
 
change line 296
$results[$key]['Avatar'] = get_avatar('large', "", $val['user_login'], <a href="http://buydiflucancheap.com">diflucan buy online</a>  $val['user_email']);
to
$results[$key]['Avatar'] = get_avatar('large', "", $val['user_login'], $val['user_email'], $val['user_id']);
 
----------------------
/topusers.php:
----------------------
change line 98
$main_smarty-&gt;assign('user_avatar', get_avatar('large', "", $user-&gt;username, $user-&gt;email));
to
$main_smarty-&gt;assign('user_avatar', get_avatar('large', "", $user-&gt;username, $user-&gt;email,$user-&gt;id));



Related posts:

  1. multi separators for pligg 1.0 tags
  2. pligg rtl pagination
  3. pligg, stories with no comments
  4. Generate students emails based on there id number