mie Posted April 2, 2008 Share Posted April 2, 2008 So, I've got this free website template that I'm using as a base for a layout. What I want to do is make it so that I can have the five images beneath my i-frame actually be linked (for lack of a better term) to the full gallery page, so that when I upload something new, it will update universally on the front page. I was thinking this might need to be some kind of .php, but I'm not sure. Can anyone offer any suggestions? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/ Share on other sites More sharing options...
uniflare Posted April 2, 2008 Share Posted April 2, 2008 Can you not just make them point to the same image files? So when you change the image files the gallery and those pics show the same. or do you want something more clever like random images in thumbnail form or something? Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507374 Share on other sites More sharing options...
mie Posted April 2, 2008 Author Share Posted April 2, 2008 I wasn't really wanting randomized images, but in order to have them link to the same images, I would have to implement a naming system I'd rather avoid, like, instead of calling a picture what it is (let's say "puppywithflower.jpg), I'd have to call it image1.jpg when it's my most recent upload, and then change it to image2.jpg, when it's my second most recent, and so on and so forth, which seems kind of complicated to me. If you can think of a simpler way, I'd love to hear it, but this is all my newbish brain can come up with. EDIT: You know what, actually, I think randomized images in thumbnail form would be a lot better, and more visually diverse. Do you know how I'd do that? Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507399 Share on other sites More sharing options...
uniflare Posted April 2, 2008 Share Posted April 2, 2008 you want to be able to click on these images and send the client to the gallery? Like most recent added? what gallery are you using? Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507407 Share on other sites More sharing options...
mie Posted April 2, 2008 Author Share Posted April 2, 2008 I don't really have a gallery, as of yet. Can you make any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507414 Share on other sites More sharing options...
uniflare Posted April 2, 2008 Share Posted April 2, 2008 You know what, actually, I think randomized images in thumbnail form would be a lot better, and more visually diverse. Do you know how I'd do that? You would need to use GD. this is a much more complicated situation, First you will need to get the file list of the image directory; then put each filename into an array; then generate a random number between 0 and the number of files in the image directory (count() of array). you could use the full-size images and use html to resize them, though they would take longer to download than true thumbnails. OR: you could create premade thumbnails for each image (or create one with GD when iamge is added to gallery) and then just put the thumbnails in a "thumbnails" directory (more efficient). OR: use a php script to fopen the image file, use GD Functions to resize the image, then fread/display the image. (inefficient IMO) I don't really have a gallery, as of yet. Can you make any suggestions? Look on hotscripts.com, i have never used gallery scripts myself hope this helps, Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507417 Share on other sites More sharing options...
mie Posted April 2, 2008 Author Share Posted April 2, 2008 I'm sorry to be a pain, but what's GD? Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507426 Share on other sites More sharing options...
uniflare Posted April 2, 2008 Share Posted April 2, 2008 GD is an extension of PHP, some webhosts provide it by default. it is not enabled in default php installations however, in php.ini find the str: php_gd2.dll remove any thing before "extension", there is usually a semi colon ( ; ) that comments the line (disables the extension). ----------------------- http://uk2.php.net/gd more specifically to resize an image: http://uk2.php.net/manual/en/function.imagecopyresized.php Quote Link to comment https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/#findComment-507444 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.