vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Attachments Per Forum... (https://vborg.vbsupport.ru/showthread.php?t=43241)

Chris M 09-05-2002 10:00 PM

Attachments Per Forum...
 
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 :

PHP Code:

    $filesize=filesize($attachment);
    if (
$maxattachsize!=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:

PHP Code:

[[($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.


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01127 seconds
  • Memory Usage 1,759KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete