Avatar Module
Posted by Chris Eaton
November 09, 2005 03:51PM |
Registered: 21 years ago Posts: 793 |
this module is quite the hack. it does work but in a very roundabout kind of way. i was using for a short time but eventually abandoned it because it confused my users too much. it would also break in non-public forums.
if you want to put a bit more work in but have an amazing avatar system check out the Phorum Integration forum's thread about working with phpGallery 2.0
I do that now and it lets my users upload as many images as they want to their own personal gallery and i can choose their highlighted image to be their avatar.
Gives the user the freedom to not have to resize their images at all and crop the thumbnail however they want..
very nice.
if you want to put a bit more work in but have an amazing avatar system check out the Phorum Integration forum's thread about working with phpGallery 2.0
I do that now and it lets my users upload as many images as they want to their own personal gallery and i can choose their highlighted image to be their avatar.
Gives the user the freedom to not have to resize their images at all and crop the thumbnail however they want..
very nice.
Re: Avatar Module November 21, 2005 01:08PM |
Registered: 19 years ago Posts: 61 |
hi,
i had setup avatar module for phorum5.1-4. but i can't set it working.
everything is working but when i'm choosing an avatar on a new post there's no avatar display. if edit the message avatar is setted as none, if i set another avatar on the edit page, then it will be corectly displayed.
is anyone have an idear about this ?
thanks for help :)
i had setup avatar module for phorum5.1-4. but i can't set it working.
everything is working but when i'm choosing an avatar on a new post there's no avatar display. if edit the message avatar is setted as none, if i set another avatar on the edit page, then it will be corectly displayed.
is anyone have an idear about this ?
thanks for help :)
Re: Avatar Module November 21, 2005 06:32PM |
Registered: 19 years ago Posts: 61 |
i found the problem became from the line 115 whith the check of existence or not of the avatar isset($PHORUM['DATA']['mod_avatar_files'][$_POST["mod_avatar"]])
is this really usefull ?
because in the control center user can only set name from existing image, so in the post form, avatar listed are user's avatar(i think)
so i propose to replace
--------------------------------
if (isset($_POST["mod_avatar"])){
// If they are trying to set an avatar, make sure the file is in
// their avatar list.
if ($_POST["mod_avatar"] >= 1 && isset($PHORUM['DATA']['mod_avatar_files'][$_POST["mod_avatar"]])){
$message["meta"]["mod_avatar"] = $_POST["mod_avatar"];
}
// If we get here, either they're not posting with an avatar
// or they tried to use an invalid file.
else {
unset($message["meta"]["mod_avatar"]);
}
}
-------------------------
by
-------------------------
if (isset($_POST["mod_avatar"]) && $_POST["mod_avatar"] >= 1){
// If they are trying to set an avatar, make sure the file is in
// their avatar list.
$message["meta"]["mod_avatar"] = $_POST["mod_avatar"];
}
else {
unset($message["meta"]["mod_avatar"]);
}
----------------------------
it semm's to work fine :)
is this really usefull ?
because in the control center user can only set name from existing image, so in the post form, avatar listed are user's avatar(i think)
so i propose to replace
--------------------------------
if (isset($_POST["mod_avatar"])){
// If they are trying to set an avatar, make sure the file is in
// their avatar list.
if ($_POST["mod_avatar"] >= 1 && isset($PHORUM['DATA']['mod_avatar_files'][$_POST["mod_avatar"]])){
$message["meta"]["mod_avatar"] = $_POST["mod_avatar"];
}
// If we get here, either they're not posting with an avatar
// or they tried to use an invalid file.
else {
unset($message["meta"]["mod_avatar"]);
}
}
-------------------------
by
-------------------------
if (isset($_POST["mod_avatar"]) && $_POST["mod_avatar"] >= 1){
// If they are trying to set an avatar, make sure the file is in
// their avatar list.
$message["meta"]["mod_avatar"] = $_POST["mod_avatar"];
}
else {
unset($message["meta"]["mod_avatar"]);
}
----------------------------
it semm's to work fine :)
November 22, 2005 02:46AM |
Registered: 20 years ago Posts: 868 |
Hhhm, what file are we talking about now? So this works ?
Sergej
------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Sergej
------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Re: Avatar Module December 04, 2005 08:49AM |
Registered: 17 years ago Posts: 2 |
Hi,
I've just installed phorum 5.0.21 and amended with the avatar module, but I seem to by getting a problem with the getimagesize function call in mod_avatar.php
No images are being displayed in my control centres, although images have been uploaded successfully and appear in edit my files.
The image is 60x60, max limit set to 100x100, file type is gif and gif is enabled.
After abit of debugging, the problem seems to be the getimagesize is returning no size details and as a consequence, the images are not displayed in the avatar image list.
To prove this I have removed the image size check (&& mod_avatar_check_dimensions($fileid)) from the if statement and its all working. There are no strange characters in the URL being passed as $filename and if I cut & Paste the url into a browser it returns the image.
debug output:
echo ("filename = ($filename) size = <$imagedata[0]> x <$imagedata[1] ($imagedata[3])");
returns
filename = (http://www.twinsclub.co.uk/forumFT/file.php?6,file=5) size = <> x <> ()
Any ideas would be gratefully appreciated
Teej
Edited 1 time(s). Last edit at 12/04/2005 08:49AM by teej710.
I've just installed phorum 5.0.21 and amended with the avatar module, but I seem to by getting a problem with the getimagesize function call in mod_avatar.php
No images are being displayed in my control centres, although images have been uploaded successfully and appear in edit my files.
The image is 60x60, max limit set to 100x100, file type is gif and gif is enabled.
After abit of debugging, the problem seems to be the getimagesize is returning no size details and as a consequence, the images are not displayed in the avatar image list.
To prove this I have removed the image size check (&& mod_avatar_check_dimensions($fileid)) from the if statement and its all working. There are no strange characters in the URL being passed as $filename and if I cut & Paste the url into a browser it returns the image.
debug output:
echo ("filename = ($filename) size = <$imagedata[0]> x <$imagedata[1] ($imagedata[3])");
returns
filename = (http://www.twinsclub.co.uk/forumFT/file.php?6,file=5) size = <> x <> ()
Any ideas would be gratefully appreciated
Teej
Edited 1 time(s). Last edit at 12/04/2005 08:49AM by teej710.
December 04, 2005 01:09PM |
Registered: 21 years ago Posts: 793 |
What are the permissions of the forum you are trying to access the image (or your control panel for that matter) through?
looks like forum_id = 6 from your example.
Because the image size is trying to open the image via the httpd, if that forum requires a login it breaks this avatar module.
sad but true.
Edited 4 time(s). Last edit at 12/04/2005 01:35PM by rheo.
looks like forum_id = 6 from your example.
Because the image size is trying to open the image via the httpd, if that forum requires a login it breaks this avatar module.
sad but true.
Edited 4 time(s). Last edit at 12/04/2005 01:35PM by rheo.
Re: Avatar Module December 04, 2005 04:57PM |
Registered: 17 years ago Posts: 2 |
January 19, 2006 12:48PM |
Registered: 18 years ago Posts: 609 |
Re: Avatar Module February 24, 2006 12:07AM |
Registered: 17 years ago Posts: 179 |
Re: Avatar Module March 07, 2006 07:14PM |
Registered: 17 years ago Posts: 5 |
Sorry, only registered users may post in this forum.