View Full Version : Attachments Per Forum...
Chris M
09-05-2002, 10:00 PM
The Instructions are in the .txt file attached:)
There are 3 screenshots...There is a more detailed explaination of the hack in the .txt file attached, but the concept is simple : It will allow you to set Attachments to be allowed or disallowed Per Forum:)
SQL Queries to Run : 1
Files to edit : 3 (admin/forum.php, root/newthread.php & root/newreply.php)
This hack has been tested @ My Forums (DarkBlazes.com)...
Satan
Chris M
09-06-2002, 04:25 PM
Admin Cp:)
Satan
Chris M
09-06-2002, 04:26 PM
New Post with the Attachments...
Satan
Chris M
09-06-2002, 04:26 PM
New Post without the Attachments...
Satan
Floris
09-06-2002, 04:42 PM
Hey, this is pretty handy :) I have a few boards where I don't like members to post new threads, nor reply with an attachment.
Chris M
09-06-2002, 04:45 PM
Glad it could help out:)
I use it in conjunction with 2 signature limit hacks, and vBulletin's own Attachment Size limiting software:) - Now my members can only upload attachments of their sigs or avatars, so I can upload them for them, then delete the attachments:)
Satan
Dean C
09-06-2002, 05:54 PM
quite nice :D
- Mist
Chris M
09-06-2002, 08:54 PM
I'll consider that a compliment;):p
Satan
Smoothie
09-08-2002, 01:54 AM
Nice hack bub. But, it's pretty useless if you have the quick reply box with attachment. A fix for this? (besides removing the attachment box)
squawell
09-08-2002, 03:23 AM
thankz man im looking this for long time.......
another question if also have can set different attch file bytes per
forum function will be better,how do u think??
Chris M
09-08-2002, 10:04 AM
@Smoothie - I never thought of that;) I think, if you replaced the code for the attachment box, with the variable "$atachmentoption", it would work...I shall have a look and get back to you:)
@squawell - Good idea:) Im not quite sure how that would be achieved, but I shall take a look;)
Satan
Chris M
09-08-2002, 10:23 AM
Smoothie - I know it has something to do with this line in admin/functions.php :
$filesize=filesize($attachment);
if ($maxattachsize!=0 and $filesize>$maxattachsize) {
// too big!
eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
unlink($attachment);
exit;
}
I have just got to figure out how to make it work:(
Satan
Smoothie
09-08-2002, 06:41 PM
Well, keep pluggin away buddy. It's a great hack, and will be even better when you can figure that qrb out. :)
Chris M
09-08-2002, 06:55 PM
Cool:)
I have an idea how to work it, and I will have a think over the week:)
I hope you can wait till next Friday or so;) (school work)
Satan
Smoothie
09-08-2002, 07:07 PM
no problem! take as long as you need. :)
Chris M
09-08-2002, 07:56 PM
Ok:)
I shall see you all next Friday!:)
Satan
Smoothie
09-14-2002, 09:07 AM
How's it going? Any updates?
Chris M
09-14-2002, 09:14 AM
Unfortunately not at this time:(
I am having trouble with identifying what code needs modifying...
I know that I have to change some code in admin/functions.php, and will need to in newthread.php and newreply.php, but I am not sure how I can make it recognise the "maxattachsize" if there is no "forumattachsize" set...
I will battle on;)
I shall post an update on the situation later on:)
Satan
Chris M
09-14-2002, 09:31 AM
Aha...Some progress:)
I have got no function errors;)
Satan
Bat-Man
12-09-2002, 12:19 AM
Also it would be cool if you could make it so you can set the file types allowed per forum, like .zip's in one and .jpg's in another thread.
Is this possible?
Smoothie
03-03-2003, 12:39 AM
hellsatan-
Bumping this thread because I wanted to ask if its possible to set the size of the attachment per forum.
Silenced Soul
03-03-2003, 02:59 AM
Nice hack, I have no real use for it, but, it's a good idea ;D
Boofo
03-03-2003, 03:02 AM
Smoothie, I found a fix for this for the Quick reply Box if you still need it. If you have Logician's Dynamic Templates hack installed, all you need to do is this:
[[($forum[forumallowattach]==1)]]
<tr>
<td bgcolor="{secondaltcolor}" valign="top"><normalfont><b>Attach file:</b></normalfont><br>
<smallfont>Maximum size: $maxattachsize bytes</smallfont></td>
<td bgcolor="{secondaltcolor}" valign="top"><smallfont><input type="hidden" name="MAX_FILE_SIZE" value="$maxattachsize_temp">
<input type="file" class="bginput" name="attachment" size="$textareacols"><br>
Valid file extensions: $attachextensions</smallfont></td>
</tr>
[[/($forum[forumallowattach]==1)]]
If you don't, let me know and I will supply the php work-a-round.
NOTE: The code for my attachments is a little different than yours. Just use the opening and closing [[($forum[forumallowattach]==1)]] tags on yours.
Keith
02-22-2005, 11:14 PM
Did anyone find a way to limit attachment sizes by Forum? I'd like to set a smaller global size for all forums, but increase max size for 2 private forums.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.