Custom Thumbnail problem |
[eluser]Ray G[/eluser]
I have a file called imageresize.php which generates thumbnail images Code: header('Content-type: image/jpeg'); I have a function which queries mysql and returns image info then creates the html to show the thumbnail (shortened) Code: $images[] = ' Above code is not displaying correctly but it will produce something like this Code: <a href="/images/gallery/Test_Image.jpg" rel="lightbox[Forms]" border="1"> Now if I go to my page all I get is the alt tag instead of the thumbnail image. If I go to my browser and just put in http://mysite.com/imageresize.php?maxsiz..._image.jpg It works fine. I tried the url/querystring fix but not working either thanks in advance for the help Ray
[eluser]pickupman[/eluser]
You need a leading slash. Code: <img src="/imageresize.php?rest_of_url_here" alt=""/> It may work from your homepage, but any other uri with a CI like structure, your link will be a relative path to that folder. The browser resolves CI urls like folders. So http://yoursite.com = http://yoursite.com/imageresize.php http://yoursite.com/controller = http://yoursite.com/controller/imageresize.php http://yoursite.com/controller/method = http://yoursite/controller/method/imageresize.php The leading slash in front of the path means always from the root folder of your site. Get firebug or the like for your browser, and you will see these links loading in the net[work] tab.
[eluser]Ray G[/eluser]
I tried that yesterday and it didn't work. But today it does. I can't explain it but not going to ask questions. I think I was too busy messing with both the source and the imageresize locations and just missed the right combination. Thank for the help. Also if anyone needs a thumbnail generator they are more than welcome to copy this code. I am sure others may have done something like this, but always willing to help if I can. If a moderator want to put this somewhere for others to use they are more than welcome to do so, or if you want me to do it I will be happy to do so. Ray |
Welcome Guest, Not a member yet? Register Sign In |