Help converting code to cURL

apps

#1

I am using PunBB, I installed Lightbox2 for PunBB, but for some reason, it wont work right… wont show images… i am sure is because it uses fopen and fclose… Could someone please convert this code with cURL lines? I dont know anything about php or cUrl :frowning:

here is the full code:

else if (!$is_signature && $pun_user[‘show_img’] != ‘0’)
{
if (@fclose(@fopen($url, “r”)))
{
$imagehw = GetImageSize($url);
$width = $imagehw[0];
$height = $imagehw[1];
$img_tag = ‘'.htmlspecialchars($url).'’;
if ($width > 550)
{
$img_tag = ‘’.$img_tag.’’;
}
}
else
{
$img_tag = ‘error: image ’ . $url . ’ cannot be loaded.’;
}


#2

I’ve never used Lightbox, but fopen() works fine as long as it isn’t trying to access an actual URL (which means an address with a protocol, instead of an internal path of some kind). Either you are trying to use Lightbox with files on an external server, or Lightbox is using URLs when it should be using relative or absolute paths.


si-blog | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#3

well what the mod does, any images posted on the punbb forum using tags use lightbox. so its using whatever url they put between that tag

See, ive used lightbox before on another page on dreamhost. This is just a code for the parser.php in PunBB, which allows [img] tags to use lightbox. even when i use the html tag for lightbox, it just shows the link and not resize the image automatically like lightbox suppose to do

Image #1