![]() |
Limit Attachments Per Time
Allows you to limit the number of attachments one can post in X (defined) hours.
There is also an option to exclude mods and admins from this limit. To install this hack download the attached file (lapt.hack.php), upload to your /admin folder and use vbHacker. A demo (screen shot of the new settings in the Admin CP) can be found here: https://vborg.vbsupport.ru/attachmen...&postid=232927 |
lapt_queries.php doesn't work!
|
Not working for me niether.
|
Try again...
|
can you give this queries, i can run it in phpmyadmin manually!
|
DOES work!!!
And no, I won't give you the queries. Since you have so much time to spend to yell at me, I'm sure you can find them yourself. |
Seems to be working now, thanks.
|
Quote:
|
Quote:
|
Great hack Chen, thanks :D
Is there a way to use the same thing to limt the the number of the posts & threads a moderator can edit or delete per day! I am very concern someone might get one of my moderators Password and delete the hall forum! If that hapend, I will be :angry: :hurt: :surprised: :cry: :knockedout: and :dead: |
great hack firefly! my friend run it on his board....works great!
but i can't run it on my ftp, don't know why! can't run queries in phpmyadmin, because it gives me error! can you give(SORRY AGAIN) queries for manual installation?? thx in advance |
Just look at the lapt_queries.php file, there are 3 quereis you need to run (all start with "INERT INTO setting").
|
SQL-query:
$DB_site->query("INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,27,'Maximum Attachments','limitattachnum','0','Set this to the number of attachments one can post in a given time range (which is set in the setting below). Set this to 0 to disable this feature.','','7')") Answer MySQL: You have an error in your SQL syntax near '$DB_site->query("INSERT INTO setting (settingid,settinggroupid,title,varname,val' at line 1 back |
Code:
INSERT INTO setting (settingid,settinggroupid,title,varname,value,description,optioncode,displayorder) VALUES (NULL,27,'Maximum Attachments','limitattachnum','0','Set this to the number of attachments one can post in a given time range (which is set in the setting below). Set this to 0 to disable this feature.','','7') |
works perfectly! thx!
|
Demo...
|
Hi Chen,
thanks for that wonderful, mega-extreme cool hack. It works perfectly on 2.2.5 and is very handy on my board. I added my Board Staff member group to the excluded people (array(5,6,7,8)) and allow 2 attachments every 8 hours, size = 2Megs. Thanks, -Tom |
I couldn't find the code for either file in the files themselves. The queries ran just fine but I can't finish the hack until I can find the code to replace. :) Anyone have any ideas on this, please? :)
|
What version are you running?
|
I'm running version 2.2.5 :)
Quote:
|
Ok, it tells you to find this, right?
Code:
// sort attachement |
This is why I couldn't find it. I had to narrow the search down to just canpostattachment. :) Usually any code you say to look for is right on target for me. I must have installed some hack somewhere that changed something. :)
Sorry I bothered you with it. I feel kindof stupid now. :) Code:
if ($permissions['canpostattachment'] and trim($attachment) != 'none' and trim($attachment) != '' and trim($attachment_name) != '') { Quote:
|
Here's the code I found it in in newreply. There are actually 2 places here that have that code. I should replace the first one?
Code:
case 'new': |
Ahh, you installed another hack that changes that part (my Save Attachments on Preview). Sorry.
|
Guess I should have installed this one first huh? :) Was I right, only the first part under case new gets changed? Thanks for helping me figure it out though. I was starting to think I was losing the ability to install hacks. :)
Quote:
|
I think you only need to update the 'new' case, but I'm not sure.
|
Well, the board didn't blow up or lock me out, so I think we did it. :) The options are there in the Admin settings so I guess that means it is working? Thanks, Chen, for all of your help on this one. :)
BTW: PM on the way. Quote:
|
i have had this hack installed for quite some time, but ecently it has taken the forum very long to post a new thread or submit a reply.
I found out the slowness was due to this hack, particulary this line of code: $attachcount = $DB_site->query_first('SELECT COUNT(*) AS total FROM attachment WHERE userid='.$bbuserinfo['userid'].' AND dateline>('.time().'-3600*'.$limitattachtime.')'); My attachment table is about 370MB with 7,700 records. When I make a simple query to this table in phpmyadmin, its very slow to respond also. The rest of the site is extremely fast, any suggestions? |
any ideas on the above? anyone?
|
Is this hack available for 3.6?
|
Quote:
|
All times are GMT. The time now is 02:45 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|