I finally managed to get the PHP script below to work...but then I found that I actually can't call vimeo video links because they do not have a file extension eg: http://vimeo.com/12345678
The script I'm using loads a slideshow if the file extension is an image file, if it's a flash file it loads the swf, and my idea was to have a vimeo iframe load if the file extension was for example .mov. All of the filenames are in the work.txt file.
I am so confused about what to do! Does anyone have any ideas of what I could add so that this script can load vimeo videos?
<?php
$photos=file("work.txt");
$img = array('jpg', 'png', 'gif');
$vid = array('mp4', 'mov', 'mpg', 'flv');
$flash = array('swf');
foreach($photos as $image){
$item=explode("|",$image);
if($item[0]==$fields[0]){
$photo=trim($item[1]);
$ext = explode(".", $photo);
if(in_array($ext[1], $img))
{ echo "<div id='slider-wrapper'><div id='slider' class='nivoSlider'><img src='images/work/$photo' alt='' /></div></div>"; }
elseif(in_array($ext[1], $vid))
{ echo "<iframe src='http://player.vimeo.com/video/$photo' width='900' height='500' frameborder='0' webkitAllowFullScreen allowFullScreen></iframe>"; }
elseif(in_array($ext[1], $flash))
{ echo "<object id='myId' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='900' height='500'><param name='movie' value='$photo' />
<!--[if !IE]>-->
<object type='application/x-shockwave-flash' data='$photo' width='900' height='500'>
<!--<![endif]-->
<div>
<h1>Alternative content</h1>
<p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>"; }
}
}
?>