Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Limit Attachments Per Time Details »»
Limit Attachments Per Time
Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-11-2002 Last Update: Never Installs: 11
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 06-09-2002, 07:34 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, it tells you to find this, right?
Code:
    // sort attachement
    if ($permissions[canpostattachment] and trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
Disregard the first line (the // comment), and just look for the second line.
Reply With Quote
  #23  
Old 06-09-2002, 07:42 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Originally posted by FireFly
Ok, it tells you to find this, right?
Code:
    // sort attachement
    if ($permissions[canpostattachment] and trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
Disregard the first line (the // comment), and just look for the second line.
Reply With Quote
  #24  
Old 06-09-2002, 07:52 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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':
				if ($permissions['canpostattachment'] and trim($attachment) != 'none' and trim($attachment) != '' and trim($attachment_name) != '') {
					$attachmentid = acceptupload(1);
					$DB_site->query("
	DELETE FROM attachment
	WHERE attachmentid = $oldattachid
					");
					$postinfo = $DB_site->query_first("
	SELECT attachmentid, filename FROM attachment
	WHERE attachmentid = $attachmentid
					");
				}
				break;
			default:
				$attachmentid = $oldattachid;
		}
	} elseif ($permissions['canpostattachment'] and trim($attachment) != 'none' and trim($attachment) != '' and trim($attachment_name) != '') {
		$attachmentid = acceptupload(1);
		$oldattachid = true;
		$postinfo = $DB_site->query_first('
			SELECT attachmentid, filename FROM attachment
			WHERE attachmentid = '.intval($attachmentid).' AND visible = 0
		');
Reply With Quote
  #25  
Old 06-09-2002, 07:53 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh, you installed another hack that changes that part (my Save Attachments on Preview). Sorry.
Reply With Quote
  #26  
Old 06-09-2002, 07:57 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Originally posted by FireFly
Ahh, you installed another hack that changes that part (my Save Attachments on Preview). Sorry.
Reply With Quote
  #27  
Old 06-09-2002, 08:02 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you only need to update the 'new' case, but I'm not sure.
Reply With Quote
  #28  
Old 06-09-2002, 08:13 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Originally posted by FireFly
I think you only need to update the 'new' case, but I'm not sure.
Reply With Quote
  #29  
Old 12-22-2003, 02:08 AM
blazin blazin is offline
 
Join Date: Jan 2002
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #30  
Old 04-10-2004, 04:06 AM
blazin blazin is offline
 
Join Date: Jan 2002
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any ideas on the above? anyone?
Reply With Quote
  #31  
Old 02-08-2007, 03:00 PM
pimpfelix pimpfelix is offline
 
Join Date: Apr 2005
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this hack available for 3.6?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05811 seconds
  • Memory Usage 2,308KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete