Jump to content

Recommended Posts

So, I've got this free website template that I'm using as a base for a layout.

 

preview.jpg

 

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!

Link to comment
https://forums.phpfreaks.com/topic/99174-what-is-the-best-way-to/
Share on other sites

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?

 

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,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.