• [Mod] User upload limits 5 0 5 1
Currently:  

Author Topic: [Mod] User upload limits  (Read 262999 times)

0 Members and 1 Guest are viewing this topic.

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [Mod] User upload limits
« Reply #135 on: June 15, 2006, 12:55:07 AM »
I am trying to erase an user by the control panel and do not get! It appears this message
please help my

my 4images is 1.7.2

Fatal error: Call to undefined function slashes() in /home/restricted/home/xxxxxx/public_html/site/admin/users.php on line 34

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] User upload limits
« Reply #136 on: June 15, 2006, 01:37:07 AM »
Restore admin/users.php from backups and try again, you made a misstake somewhere in the code.
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 mstgokcen

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: [Mod] User upload limits
« Reply #137 on: July 24, 2006, 02:33:57 PM »
in the 23th post you say use this code for 24hours limit...

Code: [Select]
function check_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);
$site_template->register_vars("upload_limit", $upload_limit);

$limit_cutoff = time() - 60 * 60 * 24;

$sql = "SELECT COUNT(*) AS num_rows_all
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND user_id=$user_id AND image_date > $limit_cutoff";
$row = $site_db->query_firstrow($sql);
$images_per_user = $row['num_rows_all'];

$site_template->register_vars("images_per_user", $images_per_user);

if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}

then in the 60th post now you say:

change it
Code: [Select]
function check_daily_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);
$site_template->register_vars("upload_limit", $upload_limit);

$limit_cutoff = time() - 60 * 60 * 24;

$sql = "SELECT image_id, image_date FROM ".IMAGES_TABLE." WHERE user_id=$user_id AND image_date > $limit_cutoff ORDER BY image_date ASC";
$result = $site_db->query($sql);
$images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_image_date = ($row['image_date']);

$sql = "SELECT image_id, image_date FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id ORDER BY image_date ASC";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_tmp_image_date = ($row['image_date']);
$images_per_user = $tmp_images_per_user + $images_per_user;

$latest_image_date = $latest_tmp_image_date > $latest_image_date ? $latest_tmp_image_date : $latest_image_date;
$time_to_go = gmstrftime("%H hrs %M min %S sec", 86400 - (time() - $latest_image_date));

$site_template->register_vars("images_per_user", $images_per_user);
$site_template->register_vars("time_to_go", $time_to_go);

if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}


then in 63rd post someone says

 If you don't have the
Code: [Select]
function check_daily_picture_limit($user_id) {
how are you using the User limits MOD?



of course there is no such code because in the 23rd post another said change it...

Now I am completely confused finally it doesnt work bu I dont know why I lost in somewhere in codes...
At the first it was working 1 photo for 1 user and then program said there is no limit call admin etc... then I put changings and then and then and then now I 'm lost..


moreover in somewhere u say change the whole code but in orginal code there were more lines...

 will those lines will stay or remove at the end ?

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;
 }

if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_picture_limit($user_id))) {
// if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {

//
// Depending on your requirements, you can either check against global or daily limit. For global check leave it as it is now.
// For daily limit comment first line and uncomment second one.
//

$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

Offline mstgokcen

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: [Mod] User upload limits
« Reply #138 on: July 27, 2006, 03:26:25 PM »
I'm lost in codes

is there anyone can send the codes which is exactly the final codes for the 24hours limit and explain exactly where I paste  the codes

Offline jafori

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [Mod] User upload limits
« Reply #139 on: August 06, 2006, 08:45:37 PM »
I have an question
can i make a specific upload limit for a few members without effecting the rest without using this MOD? I mean like trixing with db or control panel?
If yes, please tell me how...

My second question:
Can i make an upload limit for a specific category and its subcategories and when someone upload files in other categories, those uploads wont be count in the limit? If yes, please tell me how..

:) thanks

Offline jafori

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [Mod] User upload limits
« Reply #140 on: August 08, 2006, 08:58:03 PM »
ooh =( no ansers.... better go to bed and cry out =).. or maybe hit my head on the wall till i get an idea =)

thanks for reading my comment thoe :P

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [Mod] User upload limits
« Reply #141 on: August 25, 2006, 10:33:53 PM »
i like this but , i'm looking for it:

=> Not limited by time , but yes by number of pic's
=> Normal users 10 pic's
=> admin 25 pic's

how make it , without time limites ??

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [Mod] User upload limits
« Reply #142 on: October 07, 2006, 10:17:00 PM »

Offline Cipriano

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] User upload limits
« Reply #143 on: December 14, 2006, 01:36:41 PM »
Hi, does anyone have this mod in full working? If yes could you send me a pm where to download it?

Offline Mickman

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [Mod] User upload limits
« Reply #144 on: January 02, 2007, 07:38:10 AM »
i installed this mod and it works fine. unfortunately the variable {images_per_user} and {upload_limit} are not shown in the text. they seemed to be ignored.
what's the problem?
Ii have check many times the tutorial and i hanve't done any mistake... i guess.. someone help me please.

Ich habe das gleiche Problem. Gibt es dafür eine Lösung?

Danke,
Michael

Offline Ferus

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [Mod] User upload limits
« Reply #145 on: January 04, 2007, 02:09:25 PM »
Hello, i have n00b question.
Where is instruction for install this mod?
In install pack are not exist.
Please help me, Ferus

Offline qpatrick

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] User upload limits
« Reply #146 on: March 05, 2007, 01:54:18 PM »
:)
The script very good...but I discovered 1 bug.
When I upload images this link   /member.php?action=uploadform    the upload limit script doesn't work.  :roll:
The script only work, if I upload the images to the categories.
What's the result.

Is this a confirmed bug ? I noticed that a user of my site uploaded to many pictures. I don't know how that could be. Maybe this is the same bug as mentioned above....
How could we solve this problem ?

Thankx in advance !

Patrick

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [Mod] User upload limits
« Reply #147 on: March 09, 2007, 12:57:15 AM »
:)
The script very good...but I discovered 1 bug.
When I upload images this link   /member.php?action=uploadform    the upload limit script doesn't work.  :roll:
The script only work, if I upload the images to the categories.
What's the result.

Is this a confirmed bug ? I noticed that a user of my site uploaded to many pictures. I don't know how that could be. Maybe this is the same bug as mentioned above....
How could we solve this problem ?

Thankx in advance !

Patrick


Hi! obtained to discover as to correct this bug?

please help me!!!!  this problem this affecting my site!
« Last Edit: March 10, 2007, 11:59:53 PM by jotabonfim »

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [Mod] User upload limits
« Reply #148 on: March 10, 2007, 11:59:24 PM »
I discovered plus one bug in this module, it I am incompatible with version 1.7.4 !

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
[Mod] User upload limits
« Reply #149 on: March 20, 2007, 06:22:51 PM »
Hi all has some reply for this!

I am made use to pay to have this module functioning correctly. :oops: