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)

Blown Beauty 03-08-2006 01:51 AM

Quote:

Originally Posted by Puntoboy
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 */


Worked perfectly! Thanks! :)

Zia 03-11-2006 02:20 PM

hello....
:) when we can accept an updated that wont touch sigs ?

and re-size works with IE,opera,firefox

MotMann 03-14-2006 04:38 PM

Quote:

Originally Posted by S@NL - BlackBik
OK guys,

Here is the last revision of my code. Finaly got it working:
Code:

        /* Start hack Image RESIZE */ 

                // Check to see if image exists
                $link = str_replace(" " , "%20", $link);
                $link = str_replace("&amp;" , "%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 */
//        /* Original code:                return '<img src="' .  $link . '" border="0" alt="" />'; */

If you are gonna use this, be sure to add the three phrases.

What you mean? witch phrases?

And i have the problem, that the screens not in the same width and height... not in proportion. there are to high.

What shel i do?

drewclark 03-26-2006 08:11 PM

Quote:

Originally Posted by kildjean
I modified the info with the text you suggested and I got this error now:


Parse error: parse error, unexpected T_IF, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/zonaxbox/public_html/foros/includes/class_bbcode.php on line 1978

I'm getting the same error...

chanthuyen 05-13-2006 02:00 PM

Quote:

Originally Posted by 3dsoft
The image resizes correctly but the layout is still broken in Opera 8.51

What are the template changes?

Try this : https://vborg.vbsupport.ru/showthread.php?t=115277

( Down load imageresize mod.zip)

SiMateoAko 05-18-2006 04:47 PM

Lots of info here. If you're like me and don't want to add 30 lines of code to your img tags, do what I did.

replace this:

Code:

return '<img src="' .  $link . '" border="0" alt="" />';
with this:

Code:

return '<img style="max-width:800px; width: expression(this.width > 800 ? 800: true);" src="' .  $link . '" border="0" alt="" />';
The code you want to replace is found in the function handle_bbcode_img_match() in class_bbcode.php. For me it was on line 1831.

This is fast and will work with either firefox or IE. It may even work with Opera, but I don't know.

encryption 05-19-2006 03:13 PM

I installed the mod and the resizing works perfectly, however I cant parse images as links anymore.

Smiry Kin's 05-22-2006 01:17 AM

works perfect in 3.5.4

Nathan2006 05-23-2006 07:21 AM

Thank you ggiersdorf

Just what I have been looking for :D

Install;)

encryption 05-23-2006 11:52 AM

so none of you are having the issue with parsing images as links ?


All times are GMT. The time now is 11:53 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.01449 seconds
  • Memory Usage 1,761KB
  • 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
  • (4)bbcode_code_printable
  • (4)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