vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Changing Attachment Size Dynamically (https://vborg.vbsupport.ru/showthread.php?t=97766)

ShannonA 10-06-2005 10:59 PM

Changing Attachment Size Dynamically
 
I've got my boards set up to allow some users access to bigger attachments than others. I used to do this through some mods to the files, but I'm trying to do it through the hooks now, but to no success. Here's what I've got right now, where "isMember" is my own function:

Quote:

if ($isMember) {

foreach($vbulletin->attachmentcache AS $extension)
{
if (is_array($extension))
{
$extension['size'] = 1024 * 100;
}

}

}
I've got this in global_start, but I've also tried it in newattachment_start, and nothing seems to quite do it.

Any ideas?

Shannon

Andreas 10-06-2005 11:20 PM

What was your 3.0 Code?


PHP Code:

if ($isMember)
{
    foreach (
$vbulletin->attachmentcache AS $key => $extension)
    {
        if (
is_array($extension))
        {
            
$vbulletin->attachmentcache["$key"]['size'] = 1024 100;
        }

    }



ShannonA 10-07-2005 04:27 PM

In 3.0 I was doing in a somewhat backward way, changing the size right after it was returned:

functions_file.php:
Code:

        $maxattachsize = $attachtypes["$extension"]['size'];

        global $isMember;

        if ($isMember)
                $maxattachsize = 100 * 1024;

I figured actually resetting the extension variables was more versatile, and did it that way in the 3.5 hook, but clearly wasn't accessing the variable correctly. Thanks for the help.

Shannon


All times are GMT. The time now is 03:39 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.00969 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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