Demo limit

Started by elvis.record holder
22/06/2009 20:02
Page 1 of 1
elvis.record holder22/06/2009 20:02

Hello, I've seen you guys here have a demo limiter
example: 5/20 demos have been uploaded so far.

How can I make the same thing on my e107 website?
I'm not a good coder.

waplet22/06/2009 20:06

Just ask XJ staff

SchlumPF22/06/2009 20:55

just lern php, its a simple script. i dont think xj will post the code here.

dEMolite mapper22/06/2009 21:48

make a variable which defines the limit.
read the upload folder out and count the files in it.
if it is higher then the limit close the upload form.

theL0w^03/08/2009 08:53

something like that:

$folder = '../your folder with demos/';
$max_demos = 20;

$total_demos = null;
if($handle = opendir($folder)) {
while(false !== ($file = readdir($handle))){
if(is_file($folder.$file) && $file !== '.' && $file !== '..' && $file !== '.htaccess'){
$total_demos++;
}
}
closedir($handle);
}

if($total_demos >= $max_demos){
$disable_kz = 'disabled="disabled"';
}

echo '

'.($total_demos == '' ? '0' : $total_demos).'/'.$max_demos.' demos have been uploaded so far.


Your demo:  



';
?>


simple code...

elvis.record holder03/08/2009 12:47

Do you write all that by yourself, or do you make the table with a program or something?

Page 1 of 1

Please log in to post replies.