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

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 01:26:12 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 45
  • Total: 45

[Block] Random Image Rotator [PHP]

Started by akulion, May 03, 2006, 02:09:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

akulion

yes its very simple.....

the tag



<img src="http://www.mysite.com/myfolder/rotate.php" alt="A Random Image" />



Simply add to it the width and height attributes like so and set according to ur needs



<img src="http://www.mysite.com/myfolder/rotate.php" alt="A Random Image" / height=120 width=100>


technodragon73

Quote from: akulion on May 03, 2006, 03:52:30 PM
yes its very simple.....

the tag



<img src="http://www.mysite.com/myfolder/rotate.php" alt="A Random Image" />



Simply add to it the width and height attributes like so and set according to ur needs



<img src="http://www.mysite.com/myfolder/rotate.php" alt="A Random Image" / height=120 width=100>



Cool, wasn't sure if that would work...now I am realtively new to html, is there a way to make those values relative rather than absolute?  Reason I ask is if i make it absolute and the image is sized landscape then the widht and height would distort it.

akulion

well u could try using percentages like width = 50% height =50%

but apart from that i dont know any other way

Uthn

#13
Quote from: Mitchâââ,¬Å¾Ã,¢ on May 03, 2006, 12:59:33 PM
Quote from: Uthn on May 03, 2006, 12:16:24 PM
Thanks a lot, this one works fine for me !  ;D

(was having a fight with the one from this topic : http://www.tinyportal.net/smf/index.php?topic=4220.0

I am sorry that you didnt find it to your needing.

Sorry Mitch, wasn't refering to your script but to sdl's one; which is in the same thread. Didn't meant to hurt ;)

technodragon73

the 50% trick does it...it works nicely!

rbh

i am using this script for avatars and it works except it resizes my avatars to 150x150 when they are only 95x95. anyone else try it for avatars and having this problem?

akulion

Quote from: akulion on May 03, 2006, 03:52:30 PM
yes its very simple.....

the tag



<img src="http://www.mysite.com/myfolder/rotate.php" alt="A Random Image" />



Simply add to it the width and height attributes like so and set according to ur needs



<img src="http://www.mysite.com/myfolder/rotate.php" alt="A Random Image" / height=120 width=100>



rbh try doing that...and furthermore if you have lots of images of varying sizes (dimensions) use width=100% height=100% and it should adjust accordingly :)

copter

Hi! I am using the random image thingy in a block, and I've put the rotate.php file in one of the avatar folders; and it works - but would there be any side affects or will it cause damage to the forum - you know code wise etc.

Techdomain

that will work fine - you can put that file in any folder with images. I dont know how it will go with folders that have files other than images though!

another way to make the size relative (instead of using 50% or whatever) - you dont have to put height and width. So for my forums, I just use width="190" so it fits in the side bar nicely.

akulion

Side effects?

Well in versions lower than TP 0.8.6 it has been known to cause a slight cough and wheesing in the forum

And in 0.8.6 only one reported case of a slight redness around the "home" button was reported

apart from that there are no other reported side effects  :2funny: