MyBB Community Forums
Default Profile İmage - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Default Profile İmage (/thread-151556.html)



Default Profile İmage - gbk - 2014-03-01

Hi, I installed this mod: http://mods.mybb.com/view/profile-image

it works perfectly BUT how can i make default profile image for users?

thank you already Smile


RE: Default Profile İmage - marcus123 - 2014-03-01

You will have to use either template conditionals or create a plugin that will show default image when the user didn't upload any!


RE: Default Profile İmage - effone - 2014-03-01

Here, in the plugin file, at line no. near about 324:

IF($userimg != ""){
$img_prof = $userimg;
eval("\$img_table = \"".$templates->get("usercp_prof_img")."\";"); 
}

make it:

IF($userimg == ""){
$userimg = $someimgreference; // Set your default image reference here
}
$img_prof = $userimg;
eval("\$img_table = \"".$templates->get("usercp_prof_img")."\";");

Follow the comment and set your default reference.


RE: Default Profile İmage - gbk - 2014-03-01

(2014-03-01, 07:24 PM)effone Wrote:
IF($userimg == ""){
$userimg = $someimgreference; // Set your default image reference here
}
$img_prof = $userimg;
eval("\$img_table = \"".$templates->get("usercp_prof_img")."\";");



thank you so much, but how can i set default image?
images/sample.jpg


RE: Default Profile İmage - effone - 2014-03-01

IF($userimg == ""){
$userimg = "uploads/imgprofile/default.jpg"; // Default image reference placed
}
$img_prof = $userimg;
eval("\$img_table = \"".$templates->get("usercp_prof_img")."\";"); 

... and upload the default.jpg under "uploads/imgprofile".


RE: Default Profile İmage - gbk - 2014-03-01

I appreciate. Thank you Smile