vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Big Picture messing up your design? Install this (https://vborg.vbsupport.ru/showthread.php?t=63458)

Taco John 07-17-2004 08:32 AM

Clicking uninstall... This thing works to a degree, but too many bugs and it really slows down the thread loading for some reason.

Thanks anyway.

Raptor 07-17-2004 06:22 PM

works great for me thanks

however the drop down box seem to appear over the image after its been expanded - weird ?

DB8 MissingLink 07-23-2004 01:08 PM

Yeah, bit too buggy. I'm clicking uninstall. But it's a great idea...

Hotte@gun 08-08-2004 11:15 AM

Another way to check if the file linked exists ins another function (i think you can use it in other linking, too)

Code:

//this function checks a link at 404 error
function is_404($url) {
        $a = parse_url($url);
        $sock = fsockopen($a['host'], empty($a['port']) ? 80 : $a['port']);
        if(!$sock) {
                return true;
        } else {
            preg_match("'\w+://[^/]+(.*)'", $url, $matches);
            fputs($sock, 'HEAD ' . $matches[1] . " HTTP/1.0\r\nHost: " . $a['host'] . "\r\n\r\n");
            preg_match("'(\w+)/([^ ]+) (\d+) (.*)'", $data = fread($sock, 4096), $matches);
            fclose($sock);
        if($matches[3] == '404') {
            return true;
        } else {
                return false;
        }
    }
}

Then i modified the handle_bbcode_img_match

Code:

// this is only called by handle_bbcode_img
function handle_bbcode_img_match($link)
{
        // IMPORTANT - REPLACE THE FOLLOWING 2 VARIALBS WITH YOUR INFORMATION
        $img_replacement = "images/misc/button_imagebig.gif"; // This is the button/image that will be displayed instead of the big image.
        $img_max_width = 600; //  This is the maximum width that an image is allowed to be viewed safely.

        $link = strip_smilies(str_replace('\\"', '"', $link));

        // remove double spaces -- fixes issues with wordwrap
        $link = str_replace('  ', '', $link);

        if('!is_404') {
            $img_width = @getimagesize($link);
                if ($img_width[0] > $img_max_width) {
                        srand((double)microtime()*1000000);
                        $number = rand(10,100);

                        $inp_string = "<a href=\"javascript:toggle_imgview('bigimg".$number."')\"><img src=\"".$img_replacement."\" alt=\"\" border=\"0\" /></a><br />\n";
                        $inp_string .= "<div style=\"position:absolute;display:none;z-index:1;\" id=\"bigimg".$number."\"><img src=\"".$link."\" border=\"0\" alt=\"\" /></div>";

                        return $inp_string;

                } else {
                        return '<img src="' .  $link . '" border="0" alt="" />';
                }
        } else {
                return '<img src="/cg/images/misc/404.gif" width="150" height="50" border="0" alt="Bitte editieren Sie diesen Link" />';
        }
}

So i am able to send a special Image as notification that the Links isnt correct.

I will attach the GERMAN images at this post. Just put the to you /forum/images/misc/ folder (or whatever place you specified)

Gutspiller 08-05-2005 06:41 PM

Kinda a lame hack IMO. It should check the users resolution before deciding to shrink the image or not. Basically this hack doesnt make sense for anybody that has a liquid layout and the width of your forum depends solely on the users resolution. :(

sunny001 03-16-2006 10:04 AM

Hi,

I just installed it, but vB 3.5.4 looks a little bit different.
I had to change the code in includes/class_bbcode.php.
The exact code that has to be replaced it there, but when trying to add a new thread I'm forwarded to an empty page.

Any idea about it'll work with vB 3.5.4?

Sven

sv1cec 08-05-2006 04:39 PM

Dimitrix, I am using this hack and even though it works as it should (I have modified it to suite my needs), I am still occasionally running in the need for a delay. It happens only when there are too many missing pictures in a post.

Could you please let me know on how you implemented the delay you mentioned here:

https://vborg.vbsupport.ru/showpost....1&postcount=27

snake-boy 08-30-2006 09:39 AM

A friend of mine sent me this code that invision users can use to resize images inline (images hosted elsewhere obviously).

Is there ANY way we can get this to work as a custom bb code for vbulletin?

I don't understand the code, but I'm sure someone with more coding skills can figure it out.

Here's the code:

Code:

<!--=== *** START RESIZED IMG *** ===-->

<script>
tds=document.getElementsByTagName("td");
for (p=0; p<tds.length; p++) {
if (tds[p].className.match(/post[0-4]/i)!=null) {
tds[p].innerHTML=tds[p].innerHTML.replace(/\[img=([0-9]+?(?x|%)?),([0-9]+?(?x|%)?)\](.*?)\[\/img\]/ig,"<img src='$3' width='$1' height='$2' style='display:inline'>");
}
}
</script>

<!--=== *** END RESIZED IMG *** ===-->

-snake

sv1cec 11-22-2006 08:12 PM

I am running vB 3.0.14, so I know this works in that version, I am not sure how 3.5 or 3.6 differ from the older versions, but here is a simpler method to handle this issue.

In your functions_bbcodeparse.php file, find this:

Code:

function handle_bbcode_img_match($link)
Replace the contents of that function with this:

Code:

function handle_bbcode_img_match($link)
{
        $img_max_width = 800; // <-- This is the maximum width that an image is allowed to be viewed safely.
        $img_max_height = 600; // <-- This is the maximum height that an image is allowed to be viewed safely.

                $link = strip_smilies(str_replace('\\"', '"', $link));
       
                // remove double spaces -- fixes issues with wordwrap
                $link = str_replace('  ', '', $link);
               
               
                if ($imginfo=@getimagesize($link))
                {
                        if (($imginfo[0] > $imginfo[1] and ($imginfo[0] > $img_max_width or $imginfo[1] > $img_max_height)) or ($imginfo[0] < $imginfo[1] and ($imginfo[1] > $img_max_width or $imginfo[0] > $img_max_height)) or ($imginfo[0] == $imginfo[1] and ($imginfo[0] * $imginfo[1] > $img_max_width * $img_max_height)))
                        {
                                $inp_string="<a href=\"$link\" target=\"_blank\"><img src=\"images/misc/toobigimage.gif\" border=\"0\" alt=\"\"></A>";
                                return $inp_string;
                        }
                        else
                        {
                                return '<img src="' .  $link . '" border="0" alt="" />';
                        }
                }
                else
                {
                        if (!$allowimgsizefailure)
                        {
                                $inp_string="<img src='images/misc/notexistimage.gif'>";
                                return $inp_string;
                        }
                }
}

You may alter the $img_max_width and $img_max_height, to suit your needs. The script will take care of images which are greater than the specified limit, either in portrait or landscape mode. In other words and for the example shown in the code, it will replace images which are larger than 800x600 or 600x800, depending on which dimension is larger (width or height).

You need to create two small images, as shown here:

https://vborg.vbsupport.ru/external/2006/11/2.gif

and

https://vborg.vbsupport.ru/external/2006/11/3.gif

Put these images in your images/misc directory and you are done.

sv1cec 03-22-2007 08:49 AM

Well after we run the above for a while, the delay it imposes on a page full of images make it undesirable.

I came up with a hack to check the images size during the posting of a message. If one image is larger than the specified file, then the message is not posted and an error is shown. If someone is interested, I can post it as a new hack, but since this is for vB 3.0.xx I am not sure if there is any interest.


All times are GMT. The time now is 07:56 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.01095 seconds
  • Memory Usage 1,760KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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