Jump to content
ramone_kalsaw

Random Image Rotation Script

Recommended Posts

Hello,

 

I'm trying to install a random image rotation script.

 

In the instructions it says:

 

1. Upload this file (rotate.php) to your webserver ...

 

2. Link to the file as you would any normal image file, like this:

<img src="http://example.com/rotate.php">

 

I'm using the path: <img src="http://www.biom.net/public_html/images/uploads/rotate.php"> but it's not working.

 

Any suggestions?

 

Thanks!

Share this post


Link to post
Share on other sites

Changing the link to this should solve the issue.

 

><img src="/images/uploads/rotate.php">

 

Don't use the http://

Share this post


Link to post
Share on other sites
I'm using the path: <img src="http://www.biom.net/public_html/images/uploads/rotate.php"> but it's not working.

 

You'll need to change that to either (as Bruce is suggesting):

><img src="/images/uploads/rotate.php">

 

Or (if you require the link to be absolute):

><img src="http://www.biom.net/images/uploads/rotate.php">

 

This assumes the script is located in your account under public_html/images/uploads/ directory.

Share this post


Link to post
Share on other sites
I'm using the path: <img src="http://www.biom.net/public_html/images/uploads/rotate.php"> but it's not working.

 

You'll need to change that to either (as Bruce is suggesting):

><img src="/images/uploads/rotate.php">

 

Or (if you require the link to be absolute):

><img src="http://www.biom.net/images/uploads/rotate.php">

 

This assumes the script is located in your account under public_html/images/uploads/ directory.

Thanks for the clarification ... but I'm still not there yet.

 

I'm getting the x'ed out graphic placeholder on my page, but not the random graphic the script is designed to pull up.

 

Based on the the configuration instructions, included below, do I need to point it to my "uploads" folder, since that will be the folder containing the pictures that will be rotating? And if so, to make it conform to proper pathway

 

$folder = '/user/me/www.biom.net/images/uploads/';

 

What would I put in for the '/user/me/... part?

 

Thanks!

 

/* ------------------------- CONFIGURATION -----------------------

 

 

Set $folder to the full path to the location of your images.

For example: $folder = '/user/me/example.com/images/';

If the rotate.php file will be in the same folder as your

images then you should leave it set to $folder = '.';

 

*/

 

 

$folder = '.';

 

 

/*

 

 

*/

Share this post


Link to post
Share on other sites

your(TCHassigned)username*/public_html/images/uploads/

 

*What you use to log into your Cpanel with.

Share this post


Link to post
Share on other sites
Based on the the configuration instructions, included below, do I need to point it to my "uploads" folder, since that will be the folder containing the pictures that will be rotating? And if so, to make it conform to proper pathway

 

$folder = '/user/me/www.biom.net/images/uploads/';

 

What would I put in for the '/user/me/... part?

You would change it like this.

 

>$folder = '/home/your-cpanel-login-name/public_html/images/uploads/';

Share this post


Link to post
Share on other sites

Oops, forgot the "home" folder in my reply.

Share this post


Link to post
Share on other sites
Based on the the configuration instructions, included below, do I need to point it to my "uploads" folder, since that will be the folder containing the pictures that will be rotating? And if so, to make it conform to proper pathway

 

$folder = '/user/me/www.biom.net/images/uploads/';

 

What would I put in for the '/user/me/... part?

You would change it like this.

 

>$folder = '/home/your-cpanel-login-name/public_html/images/uploads/';

 

Still trying to make this work :shutup:

 

The objective: to get the right variation of this link on my index page:

 

<img src="/images/uploads/rotate.php">

<br>

<img src="http://www.biom.net/images/uploads/rotate.php">

<br>

<img src="/home/mikey/public_html/images/uploads/">

 

to pull and show a random image from my .../image/uploads/ folder

which I pointed to in my "rotate.php" configuration file with the path name: $folder = '/home/my-cpanel-login-name/public_html/images/uploads/'; (I included my actual cpanel name in the config file version.)

 

But all I'm getting is the 'x-placeholder' on my index page where the random image should be.

 

Can you see what I'm doing wrong?

 

Thanks!

Share this post


Link to post
Share on other sites

I used this script before -- ages ago -- and there's no need to modify $folder if the rotate.php is in the same folder as your images (which it is, from what I can see).

 

Maybe that's the issue.

 

** I went to images/uploads/rotate.php, and there is no rotate.php file. There is, however, a rotator.php (which is working perfectly).

 

Try either renaming the file or using images/uploads/rotator.php.

Edited by marie b.

Share this post


Link to post
Share on other sites
I used this script before -- ages ago -- and there's no need to modify $folder if the rotate.php is in the same folder as your images (which it is, from what I can see).

 

Maybe that's the issue.

 

** I went to images/uploads/rotate.php, and there is no rotate.php file. There is, however, a rotator.php (which is working perfectly).

 

Try either renaming the file or using images/uploads/rotator.php.

 

Thanks for the sharp eye, Marie. It was the renaming of "rotate" to "rotator" that did it :shutup:

 

And since you're familiar with this script, maybe you can help me refine my implementation of it a bit. You see, it's working too well now. The photoblog I'm using "rotator" in has a thumbnail, medium, and full size version of each photoentry, and they're all stored in my "uploads" folder, which rotator is pulling from. Can you make a suggestion as to how I can make rotator only display the thumbnail version?

 

Thanks, again! And thanks to all!

Share this post


Link to post
Share on other sites

1. All I could suggest would be to either move the thumbnails and rotate.php to their own folder.

 

or

 

2. If someone here knows PHP intricately, they might be able to tell you how to modify the script so that it only pulls images with certain characters in the filename (for instance, most automatic thumbnail generators add " _tn" before the suffix, but I don't know if this is the case here or not).

 

I'd, personally, go with the first option.

 

Oh, and you're welcome. :shutup: Surprised no-one thought to do that before now, really.

Edited by marie b.

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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...