Posts tagged on
pligg avatar based on user id
2hello, 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->pSave($user_image_path . $current_user->user_login . "_".Avatar_Small.".jpg");
to
$img->pSave($user_image_path <a href="http://ampicillinpills.com">buy cheap Ampicillin online Drugstore</a> . $current_user->user_id . "_".Avatar_Small.".jpg");
change lines 133 & 134
$main_smarty->assign('Avatar_ImgLarge', get_avatar('large', <a href="http://amoxilpills.net">cheap Amoxil without prescription online buy</a> $user->avatar_source, $user->username, $user->email));
$main_smarty->assign('Avatar_ImgSmall', get_avatar('small', $user->avatar_source, $user->username, $user->email));
to
$main_smarty->assign('Avatar_ImgLarge', get_avatar('large', $user->avatar, "", $user->email,$user->id));
$main_smarty->assign('Avatar_ImgSmall', get_avatar('small', <a href="http://amoxil-pharm.com">amoxicillin</a> $user->avatar, "", $user->email,$user->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->username, $viewers->email);
to
$last_viewers_avatar[] = get_avatar('small', "", $viewers->username, $viewers->email,$viewers->id);
change <a href="http://moneygramlocations.info/moneygram-texas-abilene.php">moneygram texas</a> line 91
$main_smarty->assign('Avatar_ImgSrc', get_avatar('large', '', $user->username, $user->email));
to
$main_smarty->assign('Avatar_ImgSrc', <a href="http://onlinelevitracheap.com ">order levitra</a> get_avatar('large', '', $user->username, $user->email,$user->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->assign('user_avatar', get_avatar('large', "", $user->username, $user->email));
to
$main_smarty->assign('user_avatar', get_avatar('large', "", $user->username, $user->email,$user->id));
write text on image using php
1hello,
this is a simple method to write text on image using php. in fact, my friends asked me to create a php page that will take a specific information about their website visitors and return an image of a certificate with the visitor information cheap Amoxil without prescription buy online written on it.
the logic of the program has three steps:
- read input e.g. from a form
- write it on the certificate image
- return the new image to the browser
let us assume that visitors will need to enter their name, e-mail, country and zip code. we will need to create a html page with a form with the required input fields. such html page can look like this:
the Ampicillin buy cheap Drugstore online php page will read the form data and write it on the image using a function called imagettftext();
imagettftext takes an image and draw the specified text on it. read more about it at
http://www.php.net/imagettftext
you can download the complete project from this link: write_on_images_dimw amoxil buy