Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
FuckFame.nl  
#1 Posted : Tuesday, April 24, 2007 2:47:45 AM(UTC)
FuckFame.nl

Rank: Member

Groups: Member
Joined: 12/22/2006(UTC)
Posts: 13

Quote:
Edit: Problem solved:

<? $albumMax = 50 - $albumA; ?>

iu.addParam("MaxFileCount", "<?=$albumMax; ?>");

Hi again,

My website is almost ready, but I'm stuck at this uploader issue:

I have a lot of members on my website (near 1200, and counting), and I want them to have a maximum of 50 images in their album (just to see how many members will use the upload).

If the user has 50 images, the indexpage of the uploader will say: "Please remove some images":

Code:
$albumQ = mysql_query("SELECT * FROM album_fotos WHERE album_id = '".$_SESSION['gebruikersID']."' AND foto_delete='0'");
$albumA = mysql_num_rows($albumQ); // for testing purposes
if($albumA<=50) {
...
?>

That's the index page. But the problem is, when the user has (for example) 49 images, he still can upload 50 more.

I can't fix this in the uploader.php-file.

I also tried to put a code which checks the total images after every uploaded image, but that doesn't work either.

Any suggestions?

Thnx for any reply's!

Frank Weima

Edited by user Tuesday, December 18, 2007 3:55:02 AM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Wednesday, April 25, 2007 3:11:01 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

Hello Frank,

Did you try to use the MaxFileCount property to add max file count restriction on the client side?

Edited by user Friday, February 22, 2008 4:04:56 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

FuckFame.nl  
#3 Posted : Wednesday, April 25, 2007 10:13:48 PM(UTC)
FuckFame.nl

Rank: Member

Groups: Member
Joined: 12/22/2006(UTC)
Posts: 13

Hello Alex,

Yes I did. But, when the user had 49 images in his/her photoalbum, the maxFileCount-param didn't work. So, the user could upload another 49 images (with the max of 99 -> 49 first time + 50 second time upload). Now I coded a script before the PARAMS are loaded Example written here:

Code:
<?php
$maxPhotos      = 50;
$userMaxQuery  = mysql_query("SELECT * FROM album.photos WHERE userID='".$_SESSION['userID']."'");
$userTotal        = mysql_num_rows($userMaxQuery);
$albumMax        = $maxPhotos - $userTotal; //For example: 50 - 21
?>
iu.addParam("MaxFileCount", "<?=$albumMax; ?>");

So, now the MaxFileCount is set to the total-images-left.

The user has a max file restriction of the total files left.

(when I have 21 images in my photoalbum, the total left is 50 - 21 = 29.)

Sorry for the bad English.. heh, but I hope you understand?

Edited by user Tuesday, December 18, 2007 3:55:25 AM(UTC)  | Reason: Not specified

Alex Makhov  
#4 Posted : Friday, May 4, 2007 7:58:22 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

So did this code fix your problem?
Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

FuckFame.nl  
#5 Posted : Wednesday, May 23, 2007 4:30:28 AM(UTC)
FuckFame.nl

Rank: Member

Groups: Member
Joined: 12/22/2006(UTC)
Posts: 13

The code above, which I created from scratch, did.

- PHP connects to my MYSQL-server

- PHP checks how many 'undeleted'-images someone has

- Sum: 50(max images) - [undeleted images] =

And that number will be put into the params :)

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.