@Brajesh
I figured this was a great place to ask this question as you are already very familiar with this function from our prior work on getting the video to show up in the activity stream.
In a nutshell, the function looks for a custom-field 'embed' from a post which is being displayed, it then parses the video code and changes out the height and width to a fixed value set via calling the function like:
<?php $video = video_embed('width=200&height=150'); ?>
<?php
if (!empty($video)){ ?>
<div class="video <?php echo $GLOBALS['single_align']; ?>">
<?php echo $video; ?>
</div>
<?php } ?>
What I am trying to do:
basically instead of having the video as a custom field in a post, I want to define the video source itself in the function.
example:
$data['setting-custom_video']
That variable stores the actual embed code for the video itself.
what I want is to be able to call the function like:
<?php $video = shawn_embed('video=$data['setting-custom_video']width=200&height=150'); ?>
Long story short, is that I am trying to recycle this function into one that I can use in my theme admin panel. I am already having the user save the embed code which is stored under the 'setting-custom_video'.
If you are able to find the time, could you look at helping me modify the video_embed function to work like I have described above?
source of video_embed:
http://pastebin.com/fJADFbMM
side note:
What is wrong with this code? (still trying to figure out basic code syntax but learning fast)
if(is_file(TEMPLATEPATH . '/includes/cslider/'.$data['mydatastring'].'.php')){
require_once(TEMPLATEPATH . '/includes/cslider/'.$data['mydatastring'].'.php');
}
thanks for any help provided. I can say once the last few pieces are finished, this is going to turn into one killer plugin for everyone.