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

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

0 Members and 1 Guest are viewing this topic.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] User upload limits
« on: January 15, 2003, 01:46:11 PM »
Code: [Select]
################################################################################################
## Title: User Upload Limits for 4images - Image Gallery Management System.
## Version: 1.2
## Author: Silly Little Lamer <sll@dalnet.ru>
## Description: This Mod sets limits to the number of images, that user could upload to the gallery.
## Default limit is set to all existing users during installation of this MOD, and can
## be changed later via Control Panel. Individual upload limits for every user can also
## be changed via Edit User Panel.
##
## New in v.1.2 - Daily limits + ability to check uploaded but not yet validated images.
##
##
## Installation Level: Medium
## Installation Time: 20 Minutes
##
## Files To Edit: 6
## /4images/member.php
## /4images/register.php
## /4images/admin/users.php
## /4images/admin/settings.php
## /4images/lang/english/admin.php
## /4images/lang/english/main.php
##
################################################################################################
download: http://faces.dalnet.ru/files.php?l=english
[EDIT]
updated instructions with fixes you can find attached to this post
In the original package the installation script is broken, please use the fixed version from attachment below.


[EDIT2]
more and more people reported errors when they try add a new user.
Please apply Lord Nite fix:
After mod installed find in admin/users.php:
Code: (MySQL) [Select]
($user_id, $user_level, '$user_name', '$user_password', '$user_email', $user_showemail, $user_allowemails, $user_invisible, $current_time, '$activationkey', $current_time, $current_time, 0, '$user_homepage', '$user_icq', $user_limit".$additional_value_sql.")";
Replace it with:
Code: [Select]
($user_id, $user_level, '$user_name', '$user_password', '$user_email', $user_showemail, $user_allowemails, $user_invisible, $current_time, '$activationkey', $current_time, $current_time, 0, '$user_homepage', '$user_icq', '$user_limit'".$additional_value_sql.")";
« Last Edit: August 06, 2010, 02:34:27 PM by V@no »

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
[Mod] User upload limits
« Reply #1 on: January 16, 2003, 11:56:49 AM »
Thanks a lot ! Havn't tried it yet though.

Maybe with this code someone will be able to do the same for download limits and change limits per user ? I think it will be as close as we could get to a credits system. Anyone up for the challenge PLEASE.....

Thanks

Steve

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] User upload limits
« Reply #2 on: January 16, 2003, 12:02:21 PM »
Quote from: widgit1981
Maybe with this code someone will be able to do the same for download limits and change limits per user ?


Unfortunately, it's absolutely useless to protect images downloads this way. To understand why, try to set "Scripting -> Disable" in your web browser, then go any image in your gallery, press right mouse button and select "Save Picture As..."

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
[Mod] User upload limits
« Reply #3 on: January 16, 2003, 12:21:30 PM »
That is where your wrong. My idea is that a medium sized image is on but it limits you to the full size image which is available via the download button. Ive already got a mod done for that. I want to limit the amount of download button clicks per user and change restrictions at will via the control panel.

I think it is possible but needs a little work. NE1???


Thanks

Steve

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] User upload limits
« Reply #4 on: January 16, 2003, 02:24:46 PM »
Quote from: widgit1981
My idea is that a medium sized image is on but it limits you to the full size image which is available via the download button.


I see... well, you could try to do exactly the same thing, as my MOD doing. Just add more fields to database and check download button instead of upload..

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
[Mod] User upload limits
« Reply #5 on: January 16, 2003, 05:33:06 PM »
Where do I do that ? Can you do the code for it ? Im no php coder

Even on your first line of edits it says:

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

Surely that will be different ?

Thanks

Steve

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] User upload limits
« Reply #6 on: January 16, 2003, 11:56:58 PM »
Quote from: widgit1981
Where do I do that ? Can you do the code for it ? Im no php coder


I'm not a PHP coder either  :lol:

I'm just running 4images gallery for IRC network users. I've tested more than 15 different image gallery scriprs, and found 4images much better than others. But, there still some features are missing, that's why I'm modifying it according to my needs.

I'm not sure that I'm good enough in PHP programming to make MOD requested by you... sorry...

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
[Mod] User upload limits
« Reply #7 on: January 17, 2003, 04:19:15 PM »
If anyone could do this please do I will be extremely greatful.

Steve

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] User upload limits
« Reply #8 on: January 18, 2003, 08:01:41 PM »
hmm, ok, this is interesting, but what does this mod do.

Is this a limit for ever, or just a dailly limit. I need a dailly limit as people might upload as much as they want but no more the 3 per day, is there a way to do that with this mod?

Cheers,
Vraxor

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] User upload limits
« Reply #9 on: January 19, 2003, 01:06:19 AM »
Quote from: Vraxor
Is this a limit for ever, or just a dailly limit. I need a dailly limit as people might upload as much as they want but no more the 3 per day, is there a way to do that with this mod?


At least not now. The number of uploads information is not stored in the database, so there's no way now to check this value. New DB field have to be added and checked before uploads.

This MOD sets the absolute number of permited uploads for every user. The default value is taken from gallery config. This default value and individual limit for any user can be edited via admin control pannel.

When I have some more free time, I see what I can do to add the feature you wanted...

Offline x_789

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • http://www.dirtyrc.com
[Mod] User upload limits
« Reply #10 on: February 09, 2003, 11:15:00 PM »
Hello I downloaded and installed your upload limiter I ran the install php and it said succesful.  I have looked in my control panel and I do not see where I can make changer to the amount of uploads a user can have.  Also I have created a test user and I was able to upload 7 images with out an issue I stoped at that point.  It looks like it is not working for me. my site is www.dirtyrc.com/gallery I am using a diffrent templete but I dont think that will matter. I do have backups of my db if I you would like me to try something again i did recieve SUCCESS when installing ...Thanks in advance X

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
[Mod] User upload limits
« Reply #11 on: February 09, 2003, 11:32:40 PM »
but did u do all changes discribed in the instructions?
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 x_789

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • http://www.dirtyrc.com
[Mod] User upload limits
« Reply #12 on: February 09, 2003, 11:46:50 PM »
The way I read the instructions was that you had to options run install ...php or do manaual install.  Are you telling me I have to make other changes also ?  

This is from the read me
Quote
# Unpack install_user_limits.php to your 4images root directory and run it. If you see "Success!"
# message, than all required fields and records were added to your database. Close this file, do
# not try to run in twice!
#
# Alternatively, you can perform these two queries manualy:
X

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
[Mod] User upload limits
« Reply #13 on: February 10, 2003, 12:43:03 AM »
well, u missunderstud. its only about setting up database. the rest u'll need do manualy.
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 x_789

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • http://www.dirtyrc.com
[Mod] User upload limits
« Reply #14 on: February 16, 2003, 12:37:26 AM »
Ok I have installed the script it went fine said successful then I didn't have any options in my control panel so I came here and user above said to contine editing files. I have edited all the files and I know have all the options in my control panel.  I delted a test user and registered again got and error in members.php so I redid that file now error cleared I uploaed and it never stoped me let me upload 17 before i quit when i set limit to 10 ... So I thought maybe I miskeyed in another file also so I delted all files started with a fresh backup of all files and then I redid all the editing and uploaded them no errors all funtions are in control panel but it does not stop me from uploading.  Any Ideas whats going on?   the only thing I did not do was in the top of the read me right under the info about the auto installer this text I didn't understand but I didn't think if the auto installer was sucessful I would need to do it
Quote
# Alternatively, you can perform these two queries manualy:
#
#   ALTER TABLE `4images_users` ADD `user_limit` SMALLINT(3) DEFAULT '5' NOT NULL;
#   INSERT INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('default_upload_limit', '5');
#



here is my website  www.dirtyrc.com/gallery

Any help greatly appriciated thanks in advance...X