Topic: View Full Size "Resized" Image
How would you add something similar to punbb, or even simply the ability to click and go to the fullsized image?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → View Full Size "Resized" Image
How would you add something similar to punbb, or even simply the ability to click and go to the fullsized image?
Search PunRes for lightbox
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
Look at the post after?
Or how would I use http://www.dolem.com/lytebox/ with punbb?
None of those links actually work in that punres page.
Some of them do
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.
this is my lightbox gallery..
http://www.punres.org/viewtopic.php?pid=8387#p8387
Q
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
Hey quaker thanks for the post, but I don't need a gallery I just need lightbox within posts.
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;
}
That's what the standard non-working code is lol
This is a good description of the issue
http://punbb.org/forums/viewtopic.php?id=14513
I guess I'd need to convert
if (@fclose(@fopen($url, "r")))
into curl
Just wait a bit until pastebin.ca comes back up and you'll have access to the correct code.
//
// 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;
}
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
I edited it, it's now no longer missing a return statement
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.
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?
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.
Turn images into links and use the same bit of javascript that help links do to ensure they open in a new window.
How would I put that into the bbcode?
Without modification of the software, in Firefox, Right Click > View Image
Heh, I'm trying to make it automatically click open in the code.
PunBB Forums → PunBB 1.2 troubleshooting → View Full Size "Resized" Image
Powered by PunBB, supported by Informer Technologies, Inc.