SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: dabeer on February 23, 2009, 02:16:46 PM
-
I am using Auto Embed Video/Audio Clips mod in my forum and I'd like to suggest exploring this feature in a Video Block, which would display a random video from a predefined "playlist".
The playlist would consist of links to videos in youtube or any other services supported by AEVAC and chosen by administrator.
The block would simply choose a random line from the playlist and display a video, which would give us a "video of the moment" effect in the block.
Is it doable?
-
I would also like to know if this is possible.
-
I would like to suggest a youtube block in this portal.
-
Random Youtube video embeding is easy to do with a PHP block, just go to the youtube video and copy the 'URL' for embeding, then put a list into the array within the code below:
Use this code in a custom PHP block.
$urls = array(
'',
'',
'',
);
$rand = rand(0, count($urls) - 1);
echo '<object width="560" height="340"><param name="movie" value="', $urls[$rand], '"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="', $urls[$rand], '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';
The list will look like:
$urls = array(
'url1',
'url2',
'url3',
'url4',
);
-
You forgot to change the movie parameter. ;)
-
True. Thanks sinan. :)
Updated the code in the post above.
-
I have added this code in PHP block but its showing nothing means just a blank screen
$urls = array(
'http://www.youtube.com/watch?v=xxYkK9o6UEo',
'http://www.youtube.com/watch?v=hNzHTCa998w',
'http://www.youtube.com/watch?v=w0Oh9uKB-fU',
'http://www.youtube.com/watch?v=3BQ4DiobIQk&feature=channel_page',
);
$rand = rand(0, count($urls) - 1);
echo '<object width="560" height="340">
<param name="movie" value="', $urls[$rand], '"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="', $urls[$rand], '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';
-
If you look at the portal on the forum in the signature then you will see a youtube video.
This was done by using a bbcode block.