Author Topic: Megavideo  (Read 4331 times)

0 Members and 1 Guest are viewing this topic.

Offline thefrenchboy

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Megavideo
« on: November 08, 2009, 05:19:43 PM »
Hello,
Forgave I if my spelling is not good, I am French. I would like to have how a person could add a video megavideo on the script.

I have to try to make him I even but it does not have to walk(work). Do you can help me?

Thank you  ;)


In french:


Bonjour,

Pardonnais moi si mon orthographe n'est pas trés bon, je suis français. Je voudrais s'avoir comment une personne pourrais ajouter une video megavideo sur le script.

J'ai essayer de le faire moi même mais cela n'a pas marcher. Pouvez-vous m'aidez ?

Merci

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: Megavideo
« Reply #1 on: November 08, 2009, 06:25:38 PM »
Someone would have to create a processing script for it....

Im not sure how tho. sorry

Offline thefrenchboy

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Megavideo
« Reply #2 on: November 09, 2009, 01:09:29 PM »
Thank you, but I would have another question.

What is that it is possible that a user is the choice enters to put the link of the video or to put directly an embed code how his(her,its) most file process? If yes can you help me  :)?

In french:

Merci, mais j'aurais une autre question.

Est ce qu'il est possible qu'un utilisateur est le choix entre mettre le lien de la video ou mettre  directement un code embed comme sa plus de fichier process ? Si oui pouvez vous m'aidez ?

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Megavideo
« Reply #3 on: November 09, 2009, 08:33:47 PM »
Nice to see another French Person on the forum!

Well the processing script does what you are asking, its just that you need it to process into a MySql Database so that you can manage the videos in the admin panel.

We use the MegaVideo API(aka processing script) so that it auto fills the forms for processing and that it also auto gets the url & embed code.
Now am sure you could add a field that lets you input the video url manually so that it fills in the MySql DB when you hit submit, but it would be more work if we did this then to spend the time to develope a MegaVideo processing script.

Plus don't count how many errors you would get.  ;)

Hope that helps,
-FireDart


---In French Using Google Translate---
Nice à voir une autre personne en français sur le forum!

Eh bien, le script de traitement fait ce que vous demandez, c'est simplement que vous avez besoin pour transformer en une base de données MySQL afin que vous puissiez gérer les vidéos dans le panneau admin.

Nous utilisons l'API Megavideo (aka script de traitement) afin qu'il soit auto remplit les formulaires pour le traitement et qu'elle a également auto obtient le code url et incorporer.
Maintenant je suis sûr que vous pourriez ajouter un champ qui vous permet d'entrer les URL de la vidéo manuellement afin qu'il occupe dans le PB, MySql lorsque vous cliquez sur Envoyer, mais il serait plus de travail si nous n'avons pas ce alors à passer le temps de développer un script de traitement MegaVideo .

De plus, ne compte pas combien d'erreurs vous obtiendrez. ;)

Hope that helps,
-FireDart
« Last Edit: November 09, 2009, 08:36:39 PM by FireDart »

Offline thefrenchboy

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Megavideo
« Reply #4 on: November 09, 2009, 09:26:26 PM »
I succeeded has to make one process_megavideo.inc:

1. To create a file process_megavideo.inc and put inside:
Quote
<?php
/**
 * Gets youtube link from eg http://www.megavideo.com/?v=xxxxxxxxxxx
 * By thefrenchboy, http://phpdirector.co.uk/forum
 * @param http://www.megavideo.com/?v=xxxxxxxxxxx
 * @return Youtube id
 */
function getytid($url){

//checks if valid youtube link

$checkyt = explode(".", $url);

if ($checkyt[1] == "megavideo" ){

   //gets vid id
$yt_start = explode("v=",$url,2);
$yt_end = explode("&",$yt_start[1],2);
$gotid = $yt_end[0];
return $gotid;
}
}
/**
 * Gets Author from megavideo id
 *
 * @param megavideo Id
 * @return $yt_author
 */
function getauthor($videoid){
$yt_xml_author_string = @file_get_contents("http://www.megavideo.com/?v=".$videoid);
$yt_xml_author_start = explode("<author>",$yt_xml_author_string,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 megavideo id
 *
 * @param megavideo Id
 * @return $yt_title_noslash
 */
function gettitle($videoid){
$yt_xml_title_string = @file_get_contents("http://www.megavideo.com/?v=".$videoid);
$yt_xml_title_start = explode("<title>",$yt_xml_title_string,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 megavideo id
 *
 * @param Youtube Id
 * @return $yt_description
 */
function getdescription($videoid){
$yt_xml_description_string = @file_get_contents("http://www.megavideo.com/?v=".$videoid);
$yt_xml_description_start = explode("<description>",$yt_xml_description_string,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 Viewcount from megavideo id
 *
 * @param Youtube Id
 * @return $yt_view_count
 *//*
function getviewcount($videoid){
$yt_xml_view_count_string = @file_get_contents("http://www.megavideo.com/?v=".$videoid);
$yt_xml_view_count_start = explode("<view_count>",$yt_xml_view_count_string,2);
$yt_xml_view_count_end = explode("</view_count>",$yt_xml_view_count_start[1],2);
$yt_view_count = $yt_xml_view_count_end[0];
return $yt_view_count;
}
*/
//check if its allready there

//$videourl is the input link eg http://www.megavideo.com/?v=VflOBMTZiQw
//$videoid is the id that gets sorted in mysql for link above it is VflOBMTZiQw
$videoid_untrim = getytid($videourl);

$videoid = trim($videoid_untrim);  //removes whitespaces at the end

      if($videoid !== null){
      $title  = safe_sql_insert(gettitle($videoid)); //Function to make the sql safe
      $smarty->assign('title', $title);
      
      $author = safe_sql_insert(getauthor($videoid));
      $smarty->assign('author', $author);
      
      $des    = getdescription($videoid);
      $smarty->assign('description', $des);
      //Vous pouvez mettre une image pour dire que la vidéo est megavideo en mettant les bonne balise, thefrenchboy
      
      
      $smarty->assign('image', $thumb);
      $smarty->assign('vidtype', 'megavideo');
      $smarty->assign('videoid', $videoid);

            }//check for blank end
 ?>

2. We add in / template / phptube / players.tpl
Quote
{elseif $vidtype eq "megavideo"}

<object width="640" height="468"><param name="movie" value="http://www.megavideo.com/v/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="333"></embed></object>

3. We add in / submit.php
Quote
}elseif ($source == "megavideo"){ //megavideo
            include("processes/process_megavideo.inc.php");

Normally it walks(works)  ;D
« Last Edit: November 09, 2009, 10:01:19 PM by thefrenchboy »

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: Megavideo
« Reply #5 on: November 10, 2009, 02:15:41 AM »
SWEET GOOD JOB MAN!!!! good to see someone that knows how to make one lol

Offline naxtra

  • Full phpd Member
  • ***
  • Posts: 74
  • Karma: 1
    • View Profile
Re: Megavideo
« Reply #6 on: November 10, 2009, 05:45:23 AM »
Well job done frenchboy!

But the only problem with megavideo is that it is NOT free....they let you watch videos for only I think 55 or 72 minutes...and then you gotta be premium member to watch after those minutes....

but once again......good job! What next, Zshare  ???  ;D

Offline thefrenchboy

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Megavideo
« Reply #7 on: November 10, 2009, 02:29:13 PM »
If I have the time(weather), I would try to make a script for the images because this process does not post(show) the images!!

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Megavideo
« Reply #8 on: November 10, 2009, 08:01:58 PM »
But the only problem with megavideo is that it is NOT free....they let you watch videos for only I think 55 or 72 minutes...and then you gotta be premium member to watch after those minutes....


Hey, for The MegaVideo time restriction. You can do this:
1) Open the video up
2) Let the video buffer all the way
3) Put the video in "Ofline Mode"
4) Now you can watch a video that is longer then 55 &or 72 min. with out it stopping!

-FireDart

Offline naxtra

  • Full phpd Member
  • ***
  • Posts: 74
  • Karma: 1
    • View Profile
Re: Megavideo
« Reply #9 on: November 11, 2009, 12:03:42 AM »
Right FD...but how are we going to inform the visitors about it :)


Offline thefrenchboy

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Megavideo
« Reply #10 on: November 11, 2009, 04:08:07 PM »
In news  ;D

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Megavideo
« Reply #11 on: November 20, 2009, 09:11:45 PM »
Hey,

It seems the script does not grab the Screenshots, Name, Author, and Description.

Can you fix this?

-FireDart

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: Megavideo
« Reply #12 on: November 21, 2009, 12:46:12 AM »
Ill look into it.... just got back from work (32 kids today and I'm running on 3 hrs of sleep and for some odd reason I took 3 night time Tylenol things ( GO ME!!!) llol


Offline thefrenchboy

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Megavideo
« Reply #13 on: November 21, 2009, 03:38:00 PM »
Hello,

 I have a piece of news, I am about to make the " version 1 by Frenchboy "! And to answer has FireDart in this version the users can even they add an image for their videos. I would speak of about new versions in the another topic.

In French ( google translation ):

Bonjour , j'ai une nouvelle, je suis sur le point de faire la " version 1 by Frenchboy" ! Et pour répondre a FireDart dans cette version les utilisateurs pourront eux même rajouter une image pour leurs vidéos. Je parlerais de la nouvelles versions dans un autre topic .