User Avatar Module
Posted by CH
Re: Warning: getimagesize(): September 18, 2005 07:09PM |
Registered: 19 years ago Posts: 7 |
Hello,
Sure. Head into mod_user_avatar.php. Delete lines 66 through 78 (contents of the mod_user_avatar_check_dimensions function), and replace them with this line:
return true;
You will not be able to limit the dimensions of a user's avatar. However, everything else should still work.
Chris
Sure. Head into mod_user_avatar.php. Delete lines 66 through 78 (contents of the mod_user_avatar_check_dimensions function), and replace them with this line:
return true;
You will not be able to limit the dimensions of a user's avatar. However, everything else should still work.
Chris
September 19, 2005 02:27PM |
Registered: 22 years ago Posts: 793 |
I question the wisdom of using URL file access.
There are times that the script will receive a password prompt instead of the image even if the user is logged in and allowed to see the image.
this will show as a broken image.
wouldn't it be better to open the file via the file system or a database select if it's not there?
Re: User Avatar Module September 19, 2005 03:13PM |
Registered: 19 years ago Posts: 34 |
If I disable the check_dimensions function I will not be able to limit the dimensions of a user's avatar as you say.
But I have an idea (but not the skills) on how to limit the dimensions.
Pat have posted picProcessor.php on [phorum.org]
as your properly know :-)
And I am wondering if its possible to use the picProcessor.php
to resize all files uploaded in the “Edit My Files page” ?
Then all pictures would be resized when somebody uploads a picture.
I only use the “Edit My Files page” in connection whit “User Avatar Module”
And I only allow users to upload jpg and gif.
And if it is, how would you do it ?
Hope it’s possible and that somebody can/will help me.
Regarts
Troels
Edited 1 time(s). Last edit at 09/19/2005 03:14PM by dragonbook.
But I have an idea (but not the skills) on how to limit the dimensions.
Pat have posted picProcessor.php on [phorum.org]
as your properly know :-)
And I am wondering if its possible to use the picProcessor.php
to resize all files uploaded in the “Edit My Files page” ?
Then all pictures would be resized when somebody uploads a picture.
I only use the “Edit My Files page” in connection whit “User Avatar Module”
And I only allow users to upload jpg and gif.
And if it is, how would you do it ?
Hope it’s possible and that somebody can/will help me.
Regarts
Troels
Edited 1 time(s). Last edit at 09/19/2005 03:14PM by dragonbook.
Re: User Avatar Module September 20, 2005 02:22AM |
Registered: 19 years ago Posts: 7 |
Hi all,
rhoe: Re: getting a broken image because of the password prompt.
I noticed this problem too. I fixed it by hacking Phorum NOT to attach the forum ID number to a user's file-access URL. I have no idea why it would be needed, and I haven't had any problems related to it being disabled.
dragonbook:
Good idea. I hadn't actually seen the picProcessor; I don't really follow the forums here. Anyway, I believe the images are stored in the database. The problem with the existing code is that it uses the built-in image-manipulation functions which only work on files (not arbitrary byte sequences in memory); I guess you knew that. Unfortunately, I am very busy right now (and probably will be for the next few years), so I really don't have time to integrate big changes into the module. Don't take this the wrong way, I'm happy to hear your criticisms, but I built this module for myself, and released it to the public as an afterthought because I thought someone might find it useful. As long as it works for me (which it does right now, being on my own server with URL-fopen enabled), I'm happy. If someone asks me something that's a trivial edit, I'll probably do it. If it involves big changes and lots of work, I'm sorry, but that's just not my priority, so it probably won't get done.
Having said that, if there's somebody out there who wants to take over ownership of the module - GO AHEAD! I'd be happy for that to happen!
Chris
rhoe: Re: getting a broken image because of the password prompt.
I noticed this problem too. I fixed it by hacking Phorum NOT to attach the forum ID number to a user's file-access URL. I have no idea why it would be needed, and I haven't had any problems related to it being disabled.
dragonbook:
Good idea. I hadn't actually seen the picProcessor; I don't really follow the forums here. Anyway, I believe the images are stored in the database. The problem with the existing code is that it uses the built-in image-manipulation functions which only work on files (not arbitrary byte sequences in memory); I guess you knew that. Unfortunately, I am very busy right now (and probably will be for the next few years), so I really don't have time to integrate big changes into the module. Don't take this the wrong way, I'm happy to hear your criticisms, but I built this module for myself, and released it to the public as an afterthought because I thought someone might find it useful. As long as it works for me (which it does right now, being on my own server with URL-fopen enabled), I'm happy. If someone asks me something that's a trivial edit, I'll probably do it. If it involves big changes and lots of work, I'm sorry, but that's just not my priority, so it probably won't get done.
Having said that, if there's somebody out there who wants to take over ownership of the module - GO AHEAD! I'd be happy for that to happen!
Chris
Re: User Avatar Module September 20, 2005 12:56PM |
Registered: 21 years ago Posts: 683 |
Hi Troels,
its quite easy to use picProcessor.php to do what you want, just call the pics through picProccessor and they will be resized and cached automaticly. picProccessor will save the pics in a seperate folder (not the db), so they can be accessed for future use. All you have to do is change the links in your template files as I suggested in my hack-description.
This might be interessting for you, too: [phorum.org]
pat
its quite easy to use picProcessor.php to do what you want, just call the pics through picProccessor and they will be resized and cached automaticly. picProccessor will save the pics in a seperate folder (not the db), so they can be accessed for future use. All you have to do is change the links in your template files as I suggested in my hack-description.
This might be interessting for you, too: [phorum.org]
pat
Re: User Avatar Module September 20, 2005 02:43PM |
Registered: 19 years ago Posts: 34 |
> its quite easy to use picProcessor.php to do what
> you want, just call the pics through picProccessor
> and they will be resized and cached automaticly.
To be absolute honest I don't have a clue how to do this, which file do I have to
edit and to what ?
> picProccessor will save the pics in a seperate
> folder (not the db), so they can be accessed for
> future use. All you have to do is change the links
> in your template files as I suggested in my
> hack-description.
I have installed your hack from here: [phorum.org]
When I upload a image the file is saved in a folder as you say, but how do I make the image eligible by the user ?
Another question…. is the uploaded file located two places after upload.. in db and a folder ?
Regarts
Troels
> you want, just call the pics through picProccessor
> and they will be resized and cached automaticly.
To be absolute honest I don't have a clue how to do this, which file do I have to
edit and to what ?
> picProccessor will save the pics in a seperate
> folder (not the db), so they can be accessed for
> future use. All you have to do is change the links
> in your template files as I suggested in my
> hack-description.
I have installed your hack from here: [phorum.org]
When I upload a image the file is saved in a folder as you say, but how do I make the image eligible by the user ?
Another question…. is the uploaded file located two places after upload.. in db and a folder ?
Regarts
Troels
Re: User Avatar Module September 21, 2005 04:39PM |
Registered: 21 years ago Posts: 683 |
hi dragonbook,
> To be absolute honest I don't have a clue how to
> do this, which file do I have to
> edit and to what ?
As I said its fairly simple, wherever you want to display the pic in your templates you have to change the url
from something like this:
<img src="{MESSAGES->mod_avatar}" alt="{LANG->mod_avatar->Avatar}">
to something like that:
<img src="picProcessor.php?filname={MESSAGES->mod_avatar}&newX=70&newY=70" alt="{LANG->mod_avatar->Avatar}">
the paratmeters newX and newY in the url will be the size picProccessor is going to size the pic.
Please read my instructions and the sourcecode of picProcessor (You'll find extensive comments) also get familiar with the templates.
> I have installed your hack from here:
> [phorum.org]
> g-7249
Don't do this - the given files where just for testing and are from an old phorum-version I don't know if the core files have changed in the meanwhile. The files are for "pic in profile" anyway and I think you want to use the avatar mod, right? There is no installation intended, you'll have to hack it in yourself, I'm afraid. In contrast to "pic in profile" you don't have to hack the core of phorum to use the avatar mod - just drop picProccessor.php in the main phorum folder and modify the templates -or the avatar mod- as discribed.
> When I upload a image the file is saved in a
> folder as you say, but how do I make the image
> eligible by the user ?
see the instructions - picProcessor will automaticly look for the file in the cache or create file from the original which will be cached from there on. You can call the file on any page the way I outlined above.
> Another question…. is the uploaded file located
> two places after upload.. in db and a folder ?
Yes, the original will be left untouched in the db.
pat
Edited 4 time(s). Last edit at 09/24/2005 04:26AM by pat.
> To be absolute honest I don't have a clue how to
> do this, which file do I have to
> edit and to what ?
As I said its fairly simple, wherever you want to display the pic in your templates you have to change the url
from something like this:
<img src="{MESSAGES->mod_avatar}" alt="{LANG->mod_avatar->Avatar}">
to something like that:
<img src="picProcessor.php?filname={MESSAGES->mod_avatar}&newX=70&newY=70" alt="{LANG->mod_avatar->Avatar}">
the paratmeters newX and newY in the url will be the size picProccessor is going to size the pic.
Please read my instructions and the sourcecode of picProcessor (You'll find extensive comments) also get familiar with the templates.
> I have installed your hack from here:
> [phorum.org]
> g-7249
Don't do this - the given files where just for testing and are from an old phorum-version I don't know if the core files have changed in the meanwhile. The files are for "pic in profile" anyway and I think you want to use the avatar mod, right? There is no installation intended, you'll have to hack it in yourself, I'm afraid. In contrast to "pic in profile" you don't have to hack the core of phorum to use the avatar mod - just drop picProccessor.php in the main phorum folder and modify the templates -or the avatar mod- as discribed.
> When I upload a image the file is saved in a
> folder as you say, but how do I make the image
> eligible by the user ?
see the instructions - picProcessor will automaticly look for the file in the cache or create file from the original which will be cached from there on. You can call the file on any page the way I outlined above.
> Another question…. is the uploaded file located
> two places after upload.. in db and a folder ?
Yes, the original will be left untouched in the db.
pat
Edited 4 time(s). Last edit at 09/24/2005 04:26AM by pat.
Re: User Avatar Module September 22, 2005 03:18PM |
Registered: 19 years ago Posts: 34 |
Re: Warning: getimagesize(): December 20, 2005 06:47AM |
Registered: 19 years ago Posts: 1 |
Hello,
I've installed the module into a phorum 5.0.21 and it seems to work.
Only 2 problems:
1) the language file does not seem to work. (i.e. no text in the 'personal profile' link to the avatar settings) Where does the english file need to be put? Is it an old version?
2) No avatars are visible in the beginscreen / overview all threads. Allthough I've modified all the files that are named in the readme.txt
Thanks for your help,
rene
I've installed the module into a phorum 5.0.21 and it seems to work.
Only 2 problems:
1) the language file does not seem to work. (i.e. no text in the 'personal profile' link to the avatar settings) Where does the english file need to be put? Is it an old version?
2) No avatars are visible in the beginscreen / overview all threads. Allthough I've modified all the files that are named in the readme.txt
Thanks for your help,
rene
Re: User Avatar Module (no settings for this module error) January 10, 2006 10:07PM |
Registered: 19 years ago Posts: 2 |
I was getting that "No Settings for this module" Error too. The The problem went away when I finally made the directory name in mods user_avatar (When it was broken I was using the name mod_user_avatar).
Hope that helps......
Sorry for the double post.
Edited 1 time(s). Last edit at 01/10/2006 11:14PM by bo.
Hope that helps......
Sorry for the double post.
Edited 1 time(s). Last edit at 01/10/2006 11:14PM by bo.
Sorry, only registered users may post in this forum.