Thread: PHP in temlate
View Single Post
  #5  
Old 09-22-2010, 05:05 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: PHP in temlate

That being said, what's the best way to make this work?
Code:
<?php // Build an array from the list of YouTube videos // Replace YourVideoList.txt with the path to your text file // This will likely be something like /home/accountname/public_html/foldername/etc $video_array = file('/home/minfinge/public_html/littlepuppiesonline.com/skin1/customer/main/YourVideoList.txt'); // Randomly pick one video from the array $video = $video_array[rand(0, count($video_array) - 1)]; $video = trim($video); ?> <object width="200" height="137"><param name="movie" value="http://www.youtube.com/v/<?php echo $video;?>"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/<?php echo $video;?>" type="application/x-shockwave-flash" wmode="transparent" width="200" height="137"></embed></object>

I'm trying to get it to display Videos Randomly based on this site.
http://www.jakeludington.com/youtube/20070615_how_to_randomize_youtube_videos_with_php. html
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote