WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

deleting unused Avatars and Images
budget host restrictions

Version:
printPrint


deleting unused Avatars and Images
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/05/05 - 06:23 AM:
quote post
#1
OK, here's what I'm trying to do. I want a specific image to show as their headshot/profile image. I came up with the (maybe) clever idea of customizing & using the Avatar field for this. I have uploaded several avatars for the same profile and noticed that the old avatar's remain in the folder.

Here's my first concern: I am on a budget host that has decent restrictions ( 5gb storage, 15,000 individual files) but, I have a database of 4,000 members. These avatars will start piling up if they aren't deleted by new uploads.

and the second: seems avatars are being CHMODed to 600 upon upload (can't view them). I searched and searched the control panel but, I cannot figure out how to change this to a readily viewable #. I got into edit.php to see if could easily make something out but, I don't want to start changing code (never dealt with php-ing file permissions).

Thanks!

Edited by knotworking on 05/05/05 - 08:33 AM
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 05/05/05 - 04:49 PM:
quote post
#2
1) See 'unused attachments' in the admin panel (though when you're talking about 5 GB, even supposing every avatar were 100 KB and every member had one it'd take 50,000 members).

2) They're whatever the default is, but they're probably not owned by your FTP user. See 'CHMOD Utility' in the admin panel to chmod them.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/05/05 - 06:26 PM:
quote post
#3
question on question 2.

All of the images I upload into member albums are automatically viewable (I tried to make everything uploaded automatically viewable in the control panel). How is it that my images upload at 666 (into the same folder) but, the avatars upload as 600? They are using seperate upload functions, from what I can see. Are these different functions affecting the CHMODing?

The CHMOD Itility looks very useful (I've used it in trying to figure out what was going on with the Avatars). But, I need these avatars to be automatically viewable for my members (otherwise, they'll think the upload failed). Seems that I would have to use the utility each time to change the file permissions, right? Maybe I could Cron job it???

Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 05/06/05 - 09:01 PM:
quote post
#4
There are no such issues with any server I've been on, but I guess somehow you've got a default value that makes it invisible.

The images are chmoded by WSN Gallery I believe in order to work around such matters. To make avatars do the same try replacing
if (move_uploaded_file($upload_temp, $target_file))
{
$uploaded = $upload_file;
}

with
if (move_uploaded_file($upload_temp, $target_file))
{
$uploaded = $upload_file;
@chmod($target_file, 0666);
}


in commonfuncs.php.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/07/05 - 07:21 AM:
quote post
#5
Yep, that worked.
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/09/05 - 11:38 AM:
quote post
#6
How easy would it be to use the same image resizing function for Avatars so they could be used as member profile pictures (with different limitations on X Y)?

I got into suggest.php and commonfunctions; it looks very similiar but, there are so many calls to diffent variables and functions, I don't know if it is feasable on my end. How challenging would it be to create this? Could I just cut and paste the existing resizing code and apply a static variable, say 300px by 300px?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 05/09/05 - 01:05 PM:
quote post
#7
You mean thumbnails of avatars? That'd require a lot of changes and I don't think I'm ever going to do it since it'd just be increasing the load with the extra thumbnails and it's more practical for 99% of people to make a profile picture be a distinct file field.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/09/05 - 01:51 PM:
quote post
#8
You know, maybe I'm just creating more hassle trying to use avatars. Would it be possible to resize images uploaded to a 'profile image' field at an X Y resize smaller than the general image resizes? I have a 300x500 cell space that I want to use for displaying headshots/ close-ups of members and, my general images resize at 500x700.

I'm not really concerned with thumbnails (though it would be handy at times). The important part is having a specific uploaded image at a set size for my member profiles.

Thanks!
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 05/10/05 - 05:48 PM:
quote post
#9
Not presently possible.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/10/05 - 07:28 PM:
quote post
#10
So, what if I just wanted to resize Avatars that were larger than a set X/Y, say no greater than 300 by 300. I don't need thumbnails or anything like that, just a way to keep them under a certain size that would break my layout. Could this be done in a way that uses the existing imagemagik functions?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 05/11/05 - 08:31 PM:
quote post
#11
Resizing of avatars is in WSN Forum and (like everything else applicable from WSN Forum) will be in Gallery 2.20, but it can't be done in the current version.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
knotworking
Experienced

Usergroup: Customer
Joined: Mar 31, 2004
Total Topics: 20
Total Posts: 83
Posted 05/11/05 - 08:46 PM:
quote post
#12
So, when is 2.20 going to be released? (no pressure wink ...)
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.