User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » php q: image with linked text rotation Page [1]  
quagmire02
All American
44225 Posts
user info
edit post

i want to be able to have a rotating image on the front page...but in addition to that, i have flash text that is tied to each image that i want to display as well...i realize i could just combine the two, but i would rather have the ease of simply throwing in additional images than having to create new objects each time...example:

image1.jpg
image2.jpg
image3.jpg

flashtext1.swf
flashtext2.swf

i want image1.jpg and image4.jpg to be linked to flashtext1.swf so that whenever images 1 or 4 come up in the rotation, flashtext1 is also shown...image2.jpg should be linked with flashtext2.swf so that when it comes up, does does flashtext2

i know how to do this in javascript, but i'd really really REALLY like to get away from javascripting...i can find any number of php rotating scripts, but i haven't found any that would allow me to link the two files so that they show up at the same time

suggestions? links?

10/19/2007 4:04:59 PM

TGD
All American
8912 Posts
user info
edit post

I could be totally misunderstanding your problem, but you could you not just modify one of the PHP rotate scripts you have to include a small set of conditional statements?

if ([img#] % 3 == 1) { // <---- or tweak however
displayThisFlashText = "flasttext1.swf";
? > [HTML code here using displayThisFlashText]
< ?
} else if ... 

10/19/2007 4:30:00 PM

BigMan157
no u
103352 Posts
user info
edit post

<?PHP

$a = array();
$a[1]=array('image1.jpg', 'flashtext1.swf');
$a[2]=array('image2.jpg', 'flashtext2.swf');
$a[3]=array('image3.jpg', 'flashtext3.swf');
$a[4]=array('image4.jpg', 'flashtext1.swf');
//and so on and so forth

$num = rand(4);

echo "<img src='{$a[$num][0]}' />\n";
echo "<embed src='{$a[$num][1]}' />\n";

?>

or something like that, i'm not entirely sure what your aim is

[Edited on October 19, 2007 at 5:12 PM. Reason : copy/paste]

10/19/2007 5:12:31 PM

quagmire02
All American
44225 Posts
user info
edit post

^^ that might work

^ i'm thinking that's my aim

i'll give it a shot later, but i think that's what i'm looking for

thanks, y'all

10/19/2007 5:45:28 PM

 Message Boards » Tech Talk » php q: image with linked text rotation Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.