Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Php embed code help

  • 31-10-2011 10:06pm
    #1
    Registered Users Posts: 18


    So i need a help if anyone can.i just put up a nice piece of code that shuffles music videos i picked from youtube for my friend's blog.they work ok but i am trying figure out how to do it with online games. were gonna pick our favorite games from arcadecabin.com

    the previous code for the youtube is this
    <?php

    $videos = array(
    'pLGcj62fdKo',
    '-QKj62RKBrM',
    'D78AQSAKQLQWI9',
    '_YVY3JYgWHs',
    '60GKTp0pf1A',
    'pEPmp5Wv9uo',
    '2AdaZoWW6uc',
    'l7Hk0KXEf94',
    'SDTZ7iX4vTQ&ob',
    'XC5vmnnj8l4',
    'qQYpF2pCkLI&ob=av3e',
    '7iODSZL7XkQ',
    'YoZHE9UE5as',
    'aHU3s1pdacY',

    // Add more ids there list this:
    // 'id',
    );


    $video = $videos[rand(0, count($videos) - 1)];

    echo '<center><object width="480" height="385">
    <param name="movie" value="http://www.youtube.com/v/',
    $video, '&hl=en_US&fs=1&"></param><param name="allowFullScreen"
    value="true"></param><param name="allowscriptaccess" value="always">
    </param><embed src="http://www.youtube.com/v/', $video,
    '&hl=en_US&fs=1&" type="application/x-shockwave-flash"
    allowscriptaccess="always" allowfullscreen="true" width="480"
    height="385"></embed></object></center>';

    ?>

    any help would be great, may look into shuffling games from various sites


Comments

  • Moderators, Technology & Internet Moderators Posts: 11,017 Mod ✭✭✭✭yoyo


    
    the previous code for the youtube is this
    <?php
    
    $games = array(
        'game1_swf_url',
    'game2_swf_url',
    'game3_swf_url',
    'etc',
    );
    
    
    $game_shuffle = $games[rand(0, count($games) - 1)];
    
    echo '<center><object width="480" height="385">
    <param name="allowFullScreen"
     value="true"></param><param name="allowscriptaccess" value="always">
     </param><embed src="$game_shuffle" 
     allowscriptaccess="always" allowfullscreen="true" width="480" 
    height="385"></embed></object></center>';
    
    ?>
    
    Something like that should work? Basicly link to the SWF URL, it may not work but can't see why it wouldn't, there a Development forum on boards which may be better to post such questions in btw!

    Nick


  • Registered Users Posts: 18 testerdesign


    Hey nick,

    Thanks for the reply, yah i'm new at the all webdesign so it didn't work for me but i think i could have done it wrong. i will repost on that development site.


  • Moderators, Technology & Internet Moderators Posts: 11,017 Mod ✭✭✭✭yoyo


    Hey nick,

    Thanks for the reply, yah i'm new at the all webdesign so it didn't work for me but i think i could have done it wrong. i will repost on that development site.

    Some websites may not allow Flash content be embedded, something to note. Flash games use up allot of bandwidth, and the sites usually rely on advertising to go on, so they won't like you embedding as they get nothing back in return :)

    Nick


Advertisement