Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
Prevent APNG for users that are not allowed to have GIF images Details »»
Prevent APNG for users that are not allowed to have GIF images
Version: 1.00, by BartS BartS is offline
Developer Last Online: Feb 2010 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.0 Rating:
Released: 01-09-2009 Last Update: Never Installs: 5
Uses Plugins
 
No support by the author.

This is a very small plugin.

We don't allow users to have GIF images. But users, clever as they are, started using APNG images instead (Animated Portable Network Graphics) which vBulletin sees as regular PNG images. Even though it only works on a couple of browsers (unsupported browsers only see the first frame), we found it created allot of confusion (other users wondering why they couldn't upload animated avatars, while other had them).

This is a small plugin that will prevent users from uploading APNG images. It's so small it isn't even worth to be made into a product. It only rejects the image if the user is not allowed to upload animated images.

I only tested it on vBulletin 3.8, but I'm pretty sure this works on most versions.

Please note: this will only prevent new APNG avatars from being uploaded.

I got the detection part from: http://foone.org/apng/.

I hope a few of you can use this .

Installation
Go to your Administration Panel then:

1. Go to the 'Plugins & Products' menu
2. 'Add New plugin'
3. Values:

Product: vBulletin
Hook location: upload_accept
Title: Prevent APNG for users that are not allowed to have GIF images
Execution Order: 5 (doesn't really matter)
Plugin PHP Code:

PHP Code:
if(isset($this->allowanimation) AND $this->allowanimation === false)
{
    
$img_bytes = @file_get_contents($this->upload['location']);

    if(
$img_bytes
    {
        if(
strpos(substr($img_bytes0strpos($img_bytes'IDAT')), 'acTL') !== false)
        {
            
$this->set_error('upload_invalid_animatedgif');
            eval(
standard_error($this->fetch_error()));
        }
    }

Plugin is Active: yes

4. Click 'Save'

Show Your Support

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

Comments
  #2  
Old 10-02-2009, 11:38 PM
pappocapo's Avatar
pappocapo pappocapo is offline
 
Join Date: Mar 2008
Location: Argentina
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod, thanks
Reply With Quote
Reply

Thread Tools

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 06:41 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.03287 seconds
  • Memory Usage 2,215KB
  • Queries Executed 18 (?)
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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete