| User Pics | |
|---|---|
| Tweet Topic Started: Oct 23 2008, 03:26 AM (178 Views) | |
| bustya | Oct 23 2008, 03:26 AM Post #1 |
![]()
The Master Bitchslapper
|
I'm working on this now... all elements are building up to the forum which will incorporate all these other applications. I'm not ready to post code for this yet, still working bugs out but just popping in to say, it's coming along and it's bad ass. So far I've added another form to handle images only. This is important because of the error checking I'm doing. If the data being sent through the form is binary only you can check to make sure it's a valid image. So I'd suggest a separate form to handle images for this reason (in other words, not useredit). So okay, I added another form to handle images, I've got serious error checking going on. I allow users to upload 20 pics up to 30KBs each (those settings can be changed). I just finished working the bugs out of a sorting form that allows users to sort the order (drag and drop) in which their pics are displayed (just like MySpace). Next I'm going to add a delete pic function (easy but might get complicated with the sorted order add-on) and allow the user to pick which image to use as their avatar. Now, for the avatar... I'm going to resize their pic so it's not too big, so I'll actually be copying it and leaving the original pic intact. The resized avatar won't count against their 20 pic limit and any future changes to which image is being used for the avatar will "over-write" the existing avatar (actually I'll delete the old one and replace it). Oh, I'm also adding an option for a "accesslevel" per image... so you can set the value of this to allow a particular person access to some images and everyone access to others. I'm going to be adding this tiered access level throughout the user features (blogs, profile, images). The image sorting will also work for friends lists as well as blog entries. I'll keep you posted on this. Edited by bustya, Oct 23 2008, 03:28 AM.
|
![]() |
|
| Admin | Oct 23 2008, 07:11 PM Post #2 |
|
Administrator
|
nice job we have to all start coming together with all the different features and combinie it together. |
![]() |
|
| bustya | Nov 2 2008, 01:58 AM Post #3 |
![]()
The Master Bitchslapper
|
Still working on this and I've added in yet another feature, cropping pics without destroying the originals. I have a JavaScript interface that allows users to select the portion of the image they want to crop to, then using ajax I call up another file that uses imagecopy() along with the coordinates of the crop (width, height, x-axis and y-axis) and outputs a "new" image according to the coordinates. The image is not a duplicate... well, it doesn't create a new image file it's actually a PHP script that copies the portion of the image file. This value can then be inserted into the database for say, their avatar. So it works like this. Upload a pic of you and a friend, then via the cropping script crop the image down to just you and then use that cropped value as your avatar. The full image of you and your friend still exists and can be accessed via your user pics, but when viewing your profile you'll see the cropped pic. Furthermore, since the original is not destroyed you can go back and edit the cropped value again and again. The url looks like this: crop.php?image=someuploadedpic.jpg&w=100&h=100&x=20&y=40 I've added a bunch of error checking on this to make it idiot proof. So if someone was trying to edit the value of the cropped pic's url and removed one of the coordinates, a header in the file will kick it back to the full-size (uncropped) pic. If the user tries to edit the image name "someuploadedpic.jpg" to a name that doesn't existed in the uploaded files, a default "missing image" is displayed instead of a PHP error. I've run some tests on actually using this cropping mechanism on hotlinked pics as well, and it works. I had to add a little extra error checking to prevent XSS but if all goes as planned I'll be adding this feature to the forum design. So you'll be able to hotlink a pic then crop it to whatever value you like. That url would look something like this: crop.php?file=http://www.someothersite.com/somepic.jpg&w=100&h=100&x=20&y=40 I've got all this working, I'm just cleaning up the code and trying to make it as efficient and logical as possible. I should have something to post soon. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Other · Next Topic » |






12:49 AM Jul 11