Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Smush.it Attachment & Avatar Details »»
Smush.it Attachment & Avatar
Version: 1.1, by EXIDE EXIDE is offline
Developer Last Online: Apr 2016 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.1.11 Rating:
Released: 12-14-2011 Last Update: 05-11-2012 Installs: 29
DB Changes Uses Plugins
Is in Beta Stage  
No support by the author.

This sends your image attachments and avatars to smush.it for compression, if the image can be compressed it will download the newly compressed one and replace the attachment or avatar with it.

If you would like features added to it or you find any bugs or problems please let me know.

ACP->Settings->Options->Smush.it Attachment & Avatar Options

[Requirements]
You need to be using PHP 5.2.0 or greater.
You must be storing attachments and avatars in the filesystem.


3.8.x Version: https://vborg.vbsupport.ru/showthread.php?t=275577

http://www.smushit.com/ysmush.it/

[Updates]
16/12/11:
Fixed settings options not being added.

30/12/11:
Added option to smush user uploaded avatars.
Smarter way of fetching avatars and attachments.

24/3/12:
Added TABLE_PREFIX to install and uninstall code.
Fixed typo in uninstall code.

Remember to select "Allow Overwrite" when importing the product.

Download Now

File Type: xml product-3546713.xml (9.3 KB, 85 views)

Screenshots

File Type: png settings.png (44.8 KB, 0 views)

Show Your Support

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

Comments
  #12  
Old 12-22-2011, 07:55 PM
EXIDE EXIDE is offline
 
Join Date: Feb 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by klaus View Post
How do I know if it is working and/or what percentage the image got compressed.

I have a similar plugin in Wordpress and love it.

A future addition would be the ability to re-smush attachments already in the forum. Attachments that got uploaded prior to this plugin.
At the moment you can check the image size by admincp or checking the attachment file directly, I'm also planning to add some stats data to the attachments displaybits.

Currently working on giving people the option to re-smush attachments at the moment, I expect to update this mod in the next 2-3 days.

Quote:
Originally Posted by Disasterpiece View Post
This messes up my error_reporting setting... Could you change it to this?

PHP Code:
            $err_old error_reporting(0);
            
            if (
file_exists($sattachment['attachment_folder_id']))
            {
...
            }
            
            
error_reporting($err_old); 
Did this by myself but maybe you might want to include this in the next update, since it's more generic and respects the administrator's own settings.

@see http://de3.php.net/manual/en/functio...-reporting.php
I don't plan too make this modifcation compatible with other mods at the moment, but your free to make that change for yourself. Although the next version will not require to disable error_reporting.

Also if you want to get the current error_reporting level for the script just remove the "0" from the function. As your way disables error_reporting for the rest of the script.
Reply With Quote
  #13  
Old 12-22-2011, 10:53 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be nice if it could smush all incoming avatars as well
Reply With Quote
Благодарность от:
OldSchoolDSL
  #14  
Old 12-23-2011, 01:41 AM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by extreme-gaming View Post
It would be nice if it could smush all incoming avatars as well
I like this opinion. But it would have to have the option to turn that feature on or off. Some communities allow or have people who use animated GIF files and sadly, Yahoo's Smush It can and sometimes does remove that animation in its optimization process.

edit: Would it be possible for this to have the option to skip over GIF files?
Reply With Quote
Благодарность от:
Alfa1
  #15  
Old 12-30-2011, 06:31 PM
EXIDE EXIDE is offline
 
Join Date: Feb 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by OldSchoolDSL View Post
I like this opinion. But it would have to have the option to turn that feature on or off. Some communities allow or have people who use animated GIF files and sadly, Yahoo's Smush It can and sometimes does remove that animation in its optimization process.

edit: Would it be possible for this to have the option to skip over GIF files?
Both features added, 3.8.x version updated aswell, next update will include the ability to smush already uploaded avatars and attachments.
Reply With Quote
Благодарность от:
OldSchoolDSL
  #16  
Old 03-23-2012, 09:06 PM
billrini billrini is offline
 
Join Date: Aug 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It looks like the script does not use the table prefix. My tables are vb_* I get the error:

ALTER TABLE `filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no';

Any chance you could update this to use the table prefix? I can do it myself but I would imagine others are going to run into this same issue and it seems like it would reduce a lot of posts from people saying, "It won't install" :-)
Reply With Quote
  #17  
Old 03-24-2012, 01:10 AM
EXIDE EXIDE is offline
 
Join Date: Feb 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by billrini View Post
It looks like the script does not use the table prefix. My tables are vb_* I get the error:

ALTER TABLE `filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no';

Any chance you could update this to use the table prefix? I can do it myself but I would imagine others are going to run into this same issue and it seems like it would reduce a lot of posts from people saying, "It won't install" :-)
Thanks for pointing that out, completely looked over those sections.

Theres also a typo in the uninstall code, you will need to change the first line from:
PHP Code:
$db->query_read("ALTER TABLE " TABLE_PREFIX "filedata DROP smushed;"
To this:
PHP Code:
$db->query_read("ALTER TABLE " TABLE_PREFIX "filedata DROP smushed"); 
Everyone else can do those edits manually or upload version 1.1 and allow it to overwrite.
Reply With Quote
  #18  
Old 05-11-2012, 11:06 AM
Big-K Big-K is offline
 
Join Date: Feb 2005
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i got this error
Quote:
Database error in vBulletin 4.1.12:

Invalid SQL:
ALTER TABLE vb4_`filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no';

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no'' at line 1
Error Number : 1064
Request Date : Friday, May 11th 2012 @ 07:59:27 AM
Error Date : Friday, May 11th 2012 @ 07:59:30 AM
Script : http://www.xxxx.com/forum/admincp/ad...=productimport
Referrer : http://www.xxxx.com/forum/admincp/pl...?do=productadd
IP Address : 99.72.92.220
Username : admin
Classname : vB_Database_MySQLi
MySQL Version : 5.1.62-cll
Reply With Quote
  #19  
Old 05-11-2012, 10:55 PM
EXIDE EXIDE is offline
 
Join Date: Feb 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uploaded a new one, please download and verify the problem is gone.
Reply With Quote
Благодарность от:
CaneInsider
  #20  
Old 07-22-2012, 12:11 AM
TundraSoul TundraSoul is offline
 
Join Date: Mar 2002
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to smush attachments that are already in the file system? One at a time is fine from the attachment menu in the control panel would be fine.
Reply With Quote
  #21  
Old 07-22-2012, 12:48 AM
EXIDE EXIDE is offline
 
Join Date: Feb 2009
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TundraSoul View Post
Is there anyway to smush attachments that are already in the file system? One at a time is fine from the attachment menu in the control panel would be fine.
Currently no you can't, but I will start again on this mod tomorrow and give you the following options to smush existing images.
  • New page in admin panel listing non-smushed images.
  • Cronjob to smush 1 image every x minutes.
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 03:15 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.04956 seconds
  • Memory Usage 2,358KB
  • Queries Executed 28 (?)
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
  • (3)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete