Author Topic: movielab.tv video mod  (Read 3463 times)

0 Members and 1 Guest are viewing this topic.

Offline don

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
  • Live FREE....
    • View Profile
movielab.tv video mod
« on: April 22, 2009, 12:00:05 AM »
1. create a file called "process_movielab.inc.php" in the "processes" folder.


2. add this line of code to "process_movielab.inc.php"
Code: [Select]
<?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"
Code: [Select]
}elseif ($source == "movielab"){ //movielab
include("processes/process_movielab.inc.php");


5. add this line of code to "players.tpl".
Code: [Select]
{elseif $vidtype eq "movielab"}

<script type="text/javascript" src="http://movielab.tv/embed/?id={$video[video].file}&height=335&width=425&auto=true"></script>


Offline videonl

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
    • videonl
Re: movielab.tv video mod
« Reply #1 on: April 23, 2009, 08:41:45 PM »
thanxx,,i will add this.anymore sites to add:-)

Offline kirula

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
    • View Profile
Re: movielab.tv video mod
« Reply #2 on: September 08, 2009, 02:57:07 PM »
Not working Pl help

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: movielab.tv video mod
« Reply #3 on: September 10, 2009, 12:08:16 AM »
I see what i can do when i have some free time..... but they might have messed with their API which sucks because its much harder to fix

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: movielab.tv video mod
« Reply #4 on: September 10, 2009, 08:28:35 PM »
Whats not working... is it the whole thing or just parts?

Offline kirula

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
    • View Profile
Re: movielab.tv video mod
« Reply #5 on: September 11, 2009, 06:27:52 AM »
Invalid Link, Try http://www...

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: movielab.tv video mod
« Reply #6 on: September 11, 2009, 02:02:33 PM »
that means the way their videos are stored has changed (along with the API)

thats out of my realm... sorry