vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Smush.it Attachment & Avatar (https://vborg.vbsupport.ru/showthread.php?t=275542)

EXIDE 12-22-2011 07:55 PM

Quote:

Originally Posted by klaus (Post 2279569)
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 (Post 2279661)
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.

final kaoss 12-22-2011 10:53 PM

It would be nice if it could smush all incoming avatars as well

OldSchoolDSL 12-23-2011 01:41 AM

Quote:

Originally Posted by extreme-gaming (Post 2280221)
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?

EXIDE 12-30-2011 06:31 PM

Quote:

Originally Posted by OldSchoolDSL (Post 2280262)
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.

billrini 03-23-2012 09:06 PM

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" :-)

EXIDE 03-24-2012 01:10 AM

Quote:

Originally Posted by billrini (Post 2312623)
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.

Big-K 05-11-2012 11:06 AM

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

EXIDE 05-11-2012 10:55 PM

Uploaded a new one, please download and verify the problem is gone.

TundraSoul 07-22-2012 12:11 AM

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.

EXIDE 07-22-2012 12:48 AM

Quote:

Originally Posted by TundraSoul (Post 2350287)
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.


All times are GMT. The time now is 03:30 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.01289 seconds
  • Memory Usage 1,750KB
  • 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
  • (3)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete