Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Suggestions Uploaded Image count bug & fix
Gamezonline
Posted on 21 Aug 2009, 02:32:06

Access: Member
Total Posts: 1
Joined: 2009-08-21

in 3.2 there seem to be a bug where if there are no images in the upload directory, the script still says there is "1" there.

here a quick fix i did to make it work right.

open modimageuploads.mod and go to line 92 & replace

Code:
$num = count(glob("uploads/*.*"));

with
Code:
$num=0;
$dir = "uploads/";
if (is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if($file != "." && $file != "..") $num++;
}
}
}

just my way of saying thanks for this great script :cheese:
#771
Chris
Posted on 21 Aug 2009, 02:37:21

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Hmm interesting. I tested this on my local server, deleted all the uploaded images and it shows as

Quote:
0 images in total, 0 KB total file size

either way it's not a major problem so I wouldn't worry about it to much. I appreciate you posting a fix for it though :happy:
#772
Network-13.com © 2013