roldahayes Posted January 8, 2010 Share Posted January 8, 2010 Hi, the code below displays a members images on a page. When the image is clicked, it opens it in a new page. I am trying to implement a light box to it instead. I need to add rel="facebox" to the url somehow....? This is the normal example of how it works in a static page: <a href="images/small-pic1.jpg" rel="facebox"><img src="images/big-pic2.jpg" alt="" width="32" height="32" /></a> <?PHP $img_size = getimagesize("http://".$_SERVER['SERVER_NAME'] . str_replace($file, '', $_SERVER['PHP_SELF']) . "view_image.php?image_id=". $$n ); $images .= '<p><a href="./view_image.php?image_id='. $$n . '" ><img class="members_image" src="view_image.php?image_id='. $$n . '"' . imageResize($img_size[0],$img_size[1], 400) .'></a></p>'; } } ?> Link to comment https://forums.phpfreaks.com/topic/187720-trouble-adding-a-rel-to-this-code/ Share on other sites More sharing options...
JAY6390 Posted January 8, 2010 Share Posted January 8, 2010 $img_size = getimagesize("http://".$_SERVER['SERVER_NAME'] . str_replace($file, '', $_SERVER['PHP_SELF']) . "view_image.php?image_id=". $$n ); $images .= '<p><a rel="facebox" href="./view_image.php?image_id='. $$n . '" ><img class="members_image" src="view_image.php?image_id='. $$n . '"' . imageResize($img_size[0],$img_size[1], 400) .'></a></p>'; } } Link to comment https://forums.phpfreaks.com/topic/187720-trouble-adding-a-rel-to-this-code/#findComment-991042 Share on other sites More sharing options...
roldahayes Posted January 8, 2010 Author Share Posted January 8, 2010 Thanks, still a problem though. In IE the popup does nothing - in FF it worls but opens a window with scrambled symbols! Link to comment https://forums.phpfreaks.com/topic/187720-trouble-adding-a-rel-to-this-code/#findComment-991056 Share on other sites More sharing options...
JAY6390 Posted January 8, 2010 Share Posted January 8, 2010 No idea. The question you asked is solved. It's had the rel="facebox" added to it. by the sounds of it your view image php script isn't working and isn't putting out the correct headers, so you're viewing the image file characters instead of the image Link to comment https://forums.phpfreaks.com/topic/187720-trouble-adding-a-rel-to-this-code/#findComment-991059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.