Author Topic: upload limit by time  (Read 18621 times)

0 Members and 1 Guest are viewing this topic.

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
upload limit by time
« on: February 20, 2003, 04:19:44 AM »
is it possible to limit the upload limit by time
like only one image per day (24 hours) ?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
upload limit by time
« Reply #1 on: February 20, 2003, 04:24:17 AM »
no, it's not possible.
And I dont recall any mods for that.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
upload limit by time
« Reply #2 on: February 20, 2003, 04:25:18 AM »
:cry: ok

thanks for your quick answer

Offline Ernesto Taseffa

  • Full Member
  • ***
  • Posts: 151
    • View Profile
upload limit by time
« Reply #3 on: February 26, 2003, 01:31:38 PM »
.
« Last Edit: August 09, 2009, 01:33:54 AM by Ernesto Taseffa »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
upload limit by time
« Reply #4 on: February 26, 2003, 06:25:46 PM »
well, actualy there is a way to do so, without any modification of database.
since each uploaded photo has date when it was uploaded, it's possible make a script that will check last uploaded by that user picture and check the date.
but, this way only would work correctly when the category has "direct upload" permission. otherwise, uploaded date will be when admin validated it.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Ernesto Taseffa

  • Full Member
  • ***
  • Posts: 151
    • View Profile
upload limit by time
« Reply #5 on: February 26, 2003, 07:21:31 PM »
.
« Last Edit: August 09, 2009, 01:33:35 AM by Ernesto Taseffa »

Offline FreDyz

  • Newbie
  • *
  • Posts: 36
    • View Profile
upload limit by time
« Reply #6 on: March 13, 2003, 10:46:02 AM »
Quote from: V@no
well, actualy there is a way to do so, without any modification of database.
but, this way only would work correctly when the category has "direct upload" permission. otherwise, uploaded date will be when admin validated it.


Hmmm!! It's indeed what I was looking for, in my Web all the categories have "direct upload" permission.

Can you explain how to make the script? I don't know PHP :(

Thanks

Offline zoolmann

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • www.fotoseznam.cz
Re: upload limit by time
« Reply #7 on: January 11, 2006, 12:24:47 AM »
How please create the upload limit by one image per day (24 hours) ?

PLEASE  :cry: :cry: :cry:
Sorry for my bad English :-)
----------------------------------

- Today's visit rate

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: upload limit by time
« Reply #8 on: January 11, 2006, 12:39:51 AM »
Try this (no guests support). In member.php find:
Code: [Select]
if ($action == "uploadform") {
  if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
    show_error_page($lang['no_permission']);
    exit;
  }

Insert below:
Code: [Select]
  if ($user_info['user_level'] > GUEST && $user_info['user_level'] != ADMIN)
  {
    $sql = "SELECT COUNT(image_id) AS num
            FROM ".IMAGES_TABLE."
            WHERE user_id = ".$user_info['user_id']." AND image_date > ".(time()-60*60*24);
    if ($result = $site_db->query_firstrow($sql))
    {
      if ($result['num'] >= 1)
      {
        $lang['upload_limit_reached'] = "Sorry, your upload limit per 24 hours has been reached";
        show_error_page($lang['upload_limit_reached']);
        exit;
      }
    }
  }

Also, it wont hurt if you also insert the same code below:
Code: [Select]
if ($action == "uploadimage") {
  if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
    show_error_page($lang['no_permission']);
    exit;
  }


Done :)

Its not so hard to figure out what numbers must be changed if you want use different timing and number of allowed images per that time ;)

P.S. you can move
Code: [Select]
$lang['upload_limit_reached'] = "Sorry, your upload limit per 24 hours has been reached"; into lang/<your language>/main.php
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zoolmann

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • www.fotoseznam.cz
Re: upload limit by time
« Reply #9 on: January 11, 2006, 10:36:34 PM »
it's not functional (it is no go)  :cry:

help me please!
Sorry for my bad English :-)
----------------------------------

- Today's visit rate

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: upload limit by time
« Reply #10 on: January 12, 2006, 12:46:33 AM »
Ok, now should defenetly work. Make sure you test it with a regular member, not admin.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zoolmann

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • www.fotoseznam.cz
Re: upload limit by time
« Reply #11 on: January 13, 2006, 05:59:59 PM »
Im tested as reg. member...  :roll:

it's not functional

help me please !!!!!!
Sorry for my bad English :-)
----------------------------------

- Today's visit rate

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: upload limit by time
« Reply #12 on: January 14, 2006, 12:54:36 AM »
Im tested as reg. member...  :roll:

it's not functional

help me please !!!!!!
I've tested on fresh v1.7 and v1.7.1 - works fine for me. You do something wrong then or possible some other mods interfernce.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zoolmann

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • www.fotoseznam.cz
Re: upload limit by time
« Reply #13 on: January 16, 2006, 06:25:16 PM »
Thank you V@no,
i have got installed MOD "small credit system" and there are some conflicts with this modifikation.

So I deleted "MOD CSS" a than :upload limit by time " works perfectly ;]
Sorry for my bad English :-)
----------------------------------

- Today's visit rate

Offline Philmax

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • Fotos-zeigen.de
Re: upload limit by time
« Reply #14 on: February 26, 2006, 10:34:40 PM »
Hello Vano,
how can i limit the upload for example 10 Pics per Week?

I have many requests for this in my Gallery.

Fotos-zeigen.de
Zeig deine schönsten Fotos!

 

Post your comments here