vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Auto Resize Your Images 3.52 compliant (https://vborg.vbsupport.ru/showthread.php?t=103915)

Puntoboy 01-23-2006 01:45 PM

ok mine is exactly like that, so i need to change both to 600 or just the 640 ? 480?

S@NL - BlackBik 01-23-2006 01:48 PM

Both is OK.
Than it will resize if the picture is bigger than 600 and will resize it to 600.

But now I realize that the original hack by ggiegsdorf will always put a link on a picture.
My version in post #52 doesn't do that, but it's performance is less quick in threads with a lot of pics.

Puntoboy 01-23-2006 02:53 PM

so if i use your code i won't have a problem?

Code:

        /* Start hack Image RESIZE */ 

                // Check to see if image exists
                $link = str_replace(" " , "%20", $link);
                $link = str_replace("&" , "%26", $link);

                // Get host url name for fsockopen to see if server is reachable
                $img_host=str_replace('http://','',$link);
                $img_host=substr($img_host,0,strpos($img_host,'/'));

                // Check is server is reachable and timeout in 5 seconds if not
                if (@fclose(@fsockopen($img_host, 80, $fsockerr1, $fsockerr2, 5))) {
                        // Check if image is on server
                        if (@fclose(@fopen("$link", "rb"))) {
                                // Check image size and if oversize, change bbtag
                                $img_width = getimagesize($link);
                                if ($img_width[0] > 600) {
                                        $navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; 
                                        if (stristr($navigator_user_agent, "msie")) { 
                                            return '<a href="' .  $link . '" target="_blank"><img src="' .  $link . '" border="0" alt="' . $vbphrase['click_for_larger_image'] . '" style="width: expression(this.width > 600 ? 600 : true);" /></a>'; 
                                        } else { 
                                            return '<a href="' .  $link . '" target="_blank"><img src="' .  $link . '" border="0" alt="' . $vbphrase['click_for_larger_image'] . '" style="max-width: 600px;" /></a>'; 
                                        }
                                } else {
                                        return '<img src="' .  $link . '" border="0" alt="" />';
                                }
                        } else {
                                // Image not found
                                return '<table border="1" cellpadding="2" id="image_found"><tr><td><FONT color="#FF0000">' . $vbphrase['image_link_broken'] . '</font></td></tr></table>';
                        }
                } else {
                        // Server is down
                        return '<table border="1" cellpadding="2" id="image_found"><tr><td><FONT color="#FF0000">' . $vbphrase['image_server_down'] . '</font></td></tr></table>';
                }
               
        /* End hack Image RESIZE */


vietfancy 01-23-2006 06:04 PM

Thanks, installed

S@NL - BlackBik 01-23-2006 08:13 PM

@Puntoboy, yes technicaly it works. It may slow down some pages with many pictures on it, but it doesn't touch images smaller than the width variable you use in the code.
Try it, and if you don't like it, than just get rid of it :)

Zia 01-24-2006 05:20 AM

Quote:

Originally Posted by HR3rdGen
Heres the problem with this, it turns every [img] tag into a resize and link.

so now signature images are clickable. BOO

helo...me too get the same probs (error)
after that I pm to the main coder...


i got a reply that,,hes bizi with another hack....

i gez..he should have informed about this,,,taht lots of us are facing this problem..


we want it will re-size (thumbnail) every image hosted on imageshack or photobucket ...but it should ignore sigs image..

i think u can imform him abut ur probs....

Thankx Friendz

S@NL - BlackBik 01-24-2006 03:19 PM

Well, this isn't or ever was supported.
It's just a piece of code he has shared with us ;)
I guess that if you don't like it, you just uninstall.

The code in post #52 doesn't touch the sigs, but it has a performance problem. Because I don't know how to fix that I won't release it as a hack either ;)

Just take the original code or my version if you like it. If not, don't use it.
Maybe someone will come along that can sort the problems out and will release it as a working hack that doesn't get replies like "BOO".

ggiersdorf 01-26-2006 12:47 PM

I have been reading this thread and working on a few things myself here. I have finally gotten the code to work 99.9% of the time in IE and Firefox I dont have nor want Opera so I have not tested this new code on it. The image are clickable but I'm working on one last thing which should make everyone here pretty happy.

(anyone who know the exact location of where signatures are displayed in the code of vbulletin please PM me I have a hack for hopefully fixing this issue also)

Hopefully once I work out this issue it will be ready to upload to you.. Code and Hack required.

Zia 01-26-2006 05:02 PM

Quote:

Originally Posted by ggiersdorf
I have been reading this thread and working on a few things myself here. I have finally gotten the code to work 99.9% of the time in IE and Firefox I dont have nor want Opera so I have not tested this new code on it. The image are clickable but I'm working on one last thing which should make everyone here pretty happy.

(anyone who know the exact location of where signatures are displayed in the code of vbulletin please PM me I have a hack for hopefully fixing this issue also)

Hopefully once I work out this issue it will be ready to upload to you.. Code and Hack required.

ouch...i cant say it.......
any one know it ?

really a lots people will be benifited with this..

Stangsta 01-26-2006 05:48 PM

Quote:

Originally Posted by ggiersdorf
I have been reading this thread and working on a few things myself here. I have finally gotten the code to work 99.9% of the time in IE and Firefox I dont have nor want Opera so I have not tested this new code on it. The image are clickable but I'm working on one last thing which should make everyone here pretty happy.

(anyone who know the exact location of where signatures are displayed in the code of vbulletin please PM me I have a hack for hopefully fixing this issue also)

Hopefully once I work out this issue it will be ready to upload to you.. Code and Hack required.

Postbit and postbit legacy template.


PHP Code:

<!-- sig -->
            <
div>
                
__________________<br />
                
$post[signature]
            </
div>
        <!-- / 
sig --> 



All times are GMT. The time now is 10:07 AM.

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.03142 seconds
  • Memory Usage 1,762KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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