1

Topic: View Full Size "Resized" Image

http://imageupload.com/out.php/i60472_untitled.JPG

How would you add something similar to punbb, or even simply the ability to click and go to the fullsized image?

Re: View Full Size "Resized" Image

Search PunRes for lightbox

3

Re: View Full Size "Resized" Image

Lightbox won't work with that on dreamhost. Any ideas on how I'd go about doing this http://www.punres.org/viewtopic.php?pid=14944#p14944

Re: View Full Size "Resized" Image

Look at the post after?

5

Re: View Full Size "Resized" Image

Or how would I use http://www.dolem.com/lytebox/ with punbb?

6

Re: View Full Size "Resized" Image

None of those links actually work in that punres page.

Re: View Full Size "Resized" Image

Some of them do wink
And it looks like pastebin.ca is having some trouble right now, so that's probably why the rest don't. Try again in an hour or so.

Re: View Full Size "Resized" Image

this is my lightbox gallery..


http://www.punres.org/viewtopic.php?pid=8387#p8387

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

9

Re: View Full Size "Resized" Image

It wouldn't matter anyway because he did something he didn't code down "I added curl to create temp image and get dimensions, but it was showing the thumbnails at 100% width.. so i created a new class for .limg and made it 150px wide.. so its fixed"

No idea

10

Re: View Full Size "Resized" Image

Hey quaker thanks for the post, but I don't need a gallery I just need lightbox within posts.

Re: View Full Size "Resized" Image

xsdmx wrote:

It wouldn't matter anyway because he did something he didn't code down "I added curl to create temp image and get dimensions, but it was showing the thumbnails at 100% width.. so i created a new class for .limg and made it 150px wide.. so its fixed"

No idea

I don't think he used Bekko's code. Here it is, in case the link doesn't work for you:

//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
    {
        $imagehw = @getimagesize($url);
        if ($imagehw)
        {
            $width = $imagehw[0];
            $height = $imagehw[1];
            $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
            if ($width > 550)
            {
                $img_tag = '<a href="'.$url.'" rel="lightbox">'  .  $img_tag  .  '</a>';
            }
        }
        else
        {
            $img_tag = '<strong>error: image ' . $url . ' cannot be loaded.</strong>';
        }
    }


    return $img_tag;
}

12

Re: View Full Size "Resized" Image

That's what the standard non-working code is lol

13

Re: View Full Size "Resized" Image

This is a good description of the issue
http://punbb.org/forums/viewtopic.php?id=14513

14

Re: View Full Size "Resized" Image

I guess I'd need to convert
if (@fclose(@fopen($url, "r")))

into curl

Re: View Full Size "Resized" Image

Just wait a bit until pastebin.ca comes back up and you'll have access to the correct code.

Re: View Full Size "Resized" Image

//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
    {
        
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);

$new_image = ImageCreateFromString($file_contents);
imagejpeg($new_image, "temp.jpg",100);

// Get new dimensions
$myfilesize = getimagesize("temp.jpg");
$width_orig = $myfilesize[0];
$height_orig = $myfilesize[1];

        if ($myfilesize)
        {
            $width = $myfilesize[0];
            $height = $myfilesize[1];
            $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
            if ($width > 550)
            {
                $img_tag = '<a href="'.$url.'" rel="lightbox">' . $img_tag . '</a>';
            }
        }
        else
        {
            $img_tag = '<strong>error: image ' . $url . ' cannot be loaded.</strong>';
        }
    }
    return $img_tag;
}

17

Re: View Full Size "Resized" Image

Now I get error "unexpected $end on the last line", then when I add an extra "}" into the above code no images display and the website takes 5x longer to load. Bizzare

Re: View Full Size "Resized" Image

I edited it, it's now no longer missing a return statement

19

Re: View Full Size "Resized" Image

Warning: imagecreatefromstring() [function.imagecreatefromstring]: Data is not in a recognized format in /home/.shandy/rvsadmin/reviewstash.com/include/parser.php on line 358

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/.shandy/rvsadmin/reviewstash.com/include/parser.php on line 359

And it messed up all the formating in all of my posts lol.

20

Re: View Full Size "Resized" Image

It did however work for like four images in a topic. So, closer I guess. It undid all post formatting and everything else glitched up though so I took it off temporarily. I emailed that one guy who figured it out and hopefully he can shed some light. Since I can't do lightbox currently, is there any other way to get a fullsize "onclick" automatically on resized images?

21

Re: View Full Size "Resized" Image

Is there anyway to do this without litebox, or any of those ridiculous JS / Flash scripts? I'm just looking for a way for "resized / compressed" images to be clickable and shown in fullsize in a new window.

22

Re: View Full Size "Resized" Image

Turn images into links and use the same bit of javascript that help links do to ensure they open in a new window.

23

Re: View Full Size "Resized" Image

How would I put that into the bbcode?

24 (edited by yemgi 2008-03-09 11:17)

Re: View Full Size "Resized" Image

Without modification of the software, in Firefox, Right Click > View Image

25

Re: View Full Size "Resized" Image

Heh, I'm trying to make it automatically click open in the code.