TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 561
  • Total: 562
  • @rjen

A Random Picture/Banner Script

Started by Mitchâ„¢, April 11, 2006, 11:34:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RoarinRow

Quote from: copter on May 02, 2006, 03:13:49 AM
Thanks Mitch! the code was very easy to use :)

Very cool, code works good.   8)

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

sdl

Quote from: TechnoDragon on May 02, 2006, 02:15:36 PM
Quote from: sdl on April 18, 2006, 08:06:13 AM
There is another way. Very easy, very cool. I use it for random images for each time a page is loaded. Good for avatars, banners, anything at all.  Look at the following pic. Each time you refresh this page should see a different image.



I found that with a small code modification, it works equally well with flash files.
I learned how to do it here.
(be sure to read all the comments that follow the post in this link)

Enjoy!

Works fine, but is there a way to add a hyperlink to it?

Only if you use it for random flash files instead of images, since each flash file contains active code, and could have its own link associated with it. 

Quote from: UthnThanks for the code, works fine on my local version of TP BUT i can't get it to work on my public site (it just displays an empty block, no image)

I think it's related to read rights (i can't change them via chmod on my hosting), any hint ?

thanks

Did you include the modified .htaccess file on the remote host directory? Without that, the images won't serve up at all (and this only works on Apache servers, btw).  Also, make sure that nothing else is in the folder besides the .htaccess file, the main .jpg or .swf file that contains the code, and files you intend to serve up at random. Nothing else. 

technodragon73

QuoteOnly if you use it for random flash files instead of images, since each flash file contains active code, and could have its own link associated with it. 

Darnit...this was almost the perfect script!

Uthn

Quote from: sdlDid you include the modified .htaccess file on the remote host directory? Without that, the images won't serve up at all (and this only works on Apache servers, btw).  Also, make sure that nothing else is in the folder besides the .htaccess file, the main .jpg or .swf file that contains the code, and files you intend to serve up at random. Nothing else.

Thanks for your reply sdl, yes i uploaded the .htaccess file to the remote host, there's nothing else in the remote dir except the '.jpg', script and .htaccess

Also checked but the host runs on Apache, so no worry with that.

i'm linking a few screenshots in case i missed something ;)

(last shot is what i get with a right click -> show image on the web version of the banner)

sdl

Has to be the read permissions.  You should be able to see the images at least, but you can't. 

http://exdalaran.free.fr/Themes/TP_oxygen11rc2/images/banner/1.jpg

That shows up blank as well. 

When you look at the directory:

http://exdalaran.free.fr/Themes/TP_oxygen11rc2/images/banner

...none of the files are listed.  Resolve that problem, and it will probably work.

RoarinRow

Quote from: RoarinRow on May 02, 2006, 06:25:01 PM
Quote from: copter on May 02, 2006, 03:13:49 AM
Thanks Mitch! the code was very easy to use :)

Very cool, code works good.   8)

Mitch or any one who can answer, how do you make it so it opens a new browser window?

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Uthn

#36
Quote from: sdl on May 02, 2006, 07:50:14 PM
Has to be the read permissions.  You should be able to see the images at least, but you can't. 

http://exdalaran.free.fr/Themes/TP_oxygen11rc2/images/banner/1.jpg

That shows up blank as well. 

When you look at the directory:

http://exdalaran.free.fr/Themes/TP_oxygen11rc2/images/banner

...none of the files are listed.  Resolve that problem, and it will probably work.

Strange works fine for me, proof by the picture ;)

getting weird  ???

EDIT

Fixed, used another script in this thread : http://www.tinyportal.net/smf/index.php?topic=4873.0

Works fine for me, thanks for the help sdl :)

Mitchâ„¢

Quote from: RoarinRow on May 02, 2006, 07:58:50 PM
Quote from: RoarinRow on May 02, 2006, 06:25:01 PM
Quote from: copter on May 02, 2006, 03:13:49 AM
Thanks Mitch! the code was very easy to use :)

Very cool, code works good.   8)

Mitch or any one who can answer, how do you make it so it opens a new browser window?

Where it says this:
<A HREF='http://www.yoursite.com/'>

Try to replace it with:
<A HREF='http://www.yoursite.com/' target="new">

Havent tested it but it should work.

RoarinRow

Quote from: Mitchâââ,¬Å¾Ã,¢ on May 02, 2006, 10:29:13 PM
Quote from: RoarinRow on May 02, 2006, 07:58:50 PM
Quote from: RoarinRow on May 02, 2006, 06:25:01 PM
Quote from: copter on May 02, 2006, 03:13:49 AM
Thanks Mitch! the code was very easy to use :)

Very cool, code works good.   8)

Mitch or any one who can answer, how do you make it so it opens a new browser window?

Where it says this:
<A HREF='http://www.yoursite.com/'>

Try to replace it with:
<A HREF='http://www.yoursite.com/' target="new">

Havent tested it but it should work.

Nope didn't work.   ???

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

IchBin


This website is proudly hosted on Crocweb Cloud Website Hosting.