1. create a file called "process_movielab.inc.php" in the "processes" folder.
2. add this line of code to "process_movielab.inc.php"
<?php
/**
* Gets movielab link from eg http://www.movielab.tv/name,id.html
*
* @param http://www.movielab.tv/name,id.html
* @return movielab id
*/
function getytid($url){
//checks if valid movielab link
$checkyt = explode(".", $url);
if ($checkyt[1] == "movielab" ){
//gets vid id
$yt_start = explode(",",$url,2);
$yt_end = explode(".",$yt_start[1],2);
$gotid = $yt_end[0];
return $gotid;
}
}
/**
* Gets Author from movielab id
*
* @param movielab Id
* @return $yt_author
*/
function getauthor($xml){
$yt_xml_author_start = explode("<author>",$xml,2);
$yt_xml_author_end = explode("</author>",$yt_xml_author_start[1],2);
$yt_author = addslashes($yt_xml_author_end[0]);
return $yt_author;
}
/**
* Gets Title from movielab id
*
* @param movielab Id
* @return $yt_title_noslash
*/
function gettitle($xml){
$yt_xml_title_start = explode("<title>",$xml,2);
$yt_xml_title_end = explode("</title>",$yt_xml_title_start[1],2);
$yt_title = addslashes($yt_xml_title_end[0]);
$yt_title_noslash = $yt_xml_title_end[0];
return $yt_title_noslash;
}
/**
* Gets description from movielab id
*
* @param movielab Id
* @return $yt_description
*/
function getdescription($xml){
$yt_xml_description_start = explode("<description>",$xml,2);
$yt_xml_description_end = explode("</description>",$yt_xml_description_start[1],2);
$yt_description = addslashes($yt_xml_description_end[0]);
return $yt_description;
}
/**
* Gets image from movielab id
*
* @param movielab Id
* @return $yt_image;
*/
function getimage($xml){
$yt_xml_image_start = explode("<image>",$xml,2);
$yt_xml_image_end = explode("</image>",$yt_xml_image_start[1],2);
$yt_image = $yt_xml_image_end[0];
return $yt_image;
}
//check if its allready there
$videoid_untrim = getytid($videourl);
$videoid = trim($videoid_untrim); //removes whitespaces at the end
// why bother keep going into the same link why not just hold on to the info.
$xml = @file_get_contents("http://www.movielab.tv/api/GET_video_info.php?id=".$videoid);
if($videoid !== null){
$title = safe_sql_insert(gettitle($xml)); //Function to make the sql safe
$smarty->assign('title', $title);
$author = safe_sql_insert(getauthor($xml));
$smarty->assign('author', $author);
$des = getdescription($xml);
$smarty->assign('description', $des);
$thumb[0] = getimage($xml);
$smarty->assign('image', $thumb);
$smarty->assign('vidtype', 'movielab');
$smarty->assign('videoid', $videoid);
}//check for blank end
?>
3. add this line of code to "submit.php"
}elseif ($source == "movielab"){ //movielab
include("processes/process_movielab.inc.php");
5. add this line of code to "players.tpl".
{elseif $vidtype eq "movielab"}
<script type="text/javascript" src="http://movielab.tv/embed/?id={$video[video].file}&height=335&width=425&auto=true"></script>