Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Google video player PHP include
Old 05-19-2009, 06:26 PM Google video player PHP include
Experienced Talker

Posts: 46
Name: Jack
Trades: 0
Hello everyone,

I will have 300+ Google videos on my website soon and would like to know if i can some how be able to edit the main google video code from just like file that will change everyone of my videos.

I understand the scr will be different for each video. I would love to some how make it so i can include the google code.

Is there anyway i can do this? The only way i have come up with would be to have 1 include called googlecode.php

Code:
<embed id="VideoPlayback" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" style="width: 500px; height: 350px;"
Thats what i would put in the include since its the same for every video, this would also give me the ability to change the size of the videos with minimal effort.

Then i will have the scr after it:

Would this work at all? so i could do this on each video page:

Code:
<?php include("includes/googlecode.php"); ?>src="http://video.google.com/googleplayer.swf?docId=-7993839789357636455&hl=en&fs=true&autoplay=1"/>
Is there a better way of doing this? sorry for my lack of knowledge im pretty new at PHP.

Jack
__________________

Please login or register to view this content. Registration is FREE


The best skateboarding video's, trick tip's and archives.
conceptskate is offline
Reply With Quote
View Public Profile Visit conceptskate's homepage!
 
 
Register now for full access!
Old 05-20-2009, 09:17 AM Re: Google video player PHP include
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
That is one way, but a better method is to include a function, for example

PHP Code:
function google_video($id){ // this returns the google player video code.
return '<embed id="VideoPlayback" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" style="width: 500px; height: 350px;" 
src="http://video.google.com/googleplayer.swf?docId='
.$id.'&hl=en&fs=true&autoplay=1" />';
}
echo 
google_video('-7993839789357636455'); 
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 05-20-2009 at 09:19 AM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 05-20-2009, 02:32 PM Re: Google video player PHP include
Experienced Talker

Posts: 46
Name: Jack
Trades: 0
Thanks for your reply, im really new to PHP and wouldn't know where to start with adding it to my pages. Looks like i need to learn more PHP
__________________

Please login or register to view this content. Registration is FREE


The best skateboarding video's, trick tip's and archives.
conceptskate is offline
Reply With Quote
View Public Profile Visit conceptskate's homepage!
 
Reply     « Reply to Google video player PHP include
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12291 seconds with 12 queries