Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 ... 16 17 18 19 [20] 21 22   Go Down

Author Topic: Displaying videos from Youtube in Coppermine.  (Read 432404 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Displaying videos from Youtube in Coppermine.
« Reply #380 on: September 15, 2009, 09:08:27 am »

will this be built into 1.5?
No. But there will be a similar plugin.
Logged

cpmbr

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Displaying videos from Youtube in Coppermine.
« Reply #381 on: October 19, 2009, 03:06:00 am »

According to Youtube
http://www.youtube.com/dev

The older API is officially deprecated.
And it is not possible to create API ID. Because it is unnecessary.
I do not have my ID

Does anyone know how to update this modification of coppermine for the new API?
Logged

Nibbler

  • Guest
Re: Displaying videos from Youtube in Coppermine.
« Reply #382 on: October 19, 2009, 10:04:51 am »

Yes. Read the thread.
Logged

cpmbr

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Displaying videos from Youtube in Coppermine.
« Reply #383 on: October 20, 2009, 01:51:32 am »

I did all the procedure on page 15
but an error message. (sent attached)

Already remade this step several times.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Displaying videos from Youtube in Coppermine.
« Reply #384 on: October 20, 2009, 09:01:15 am »

Stop misbehaving! You have been told what you need to do previously, e.g. in http://forum.coppermine-gallery.net/index.php/topic,62115.msg308211.html#msg308211
Next misbehaviour will result in a ban.
Logged

JTPickering

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Displaying videos from Youtube in Coppermine.
« Reply #385 on: October 31, 2009, 07:05:24 am »

I am also getting the error:

URI                                                                      Error message
1. http://www.youtube.com/watch?v=o7hDh4gr4qU      Failed to find video

I am sure that this is a valid video URL - I have tried several. What am I doing wrong? Thanks.
Logged

ShiversOfHorror

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 60
Re: Displaying videos from Youtube in Coppermine.
« Reply #386 on: November 06, 2009, 12:14:53 am »

This worked great on first attempt!


I am also getting the error:

URI                                                                      Error message
1. http://www.youtube.com/watch?v=o7hDh4gr4qU      Failed to find video

I am sure that this is a valid video URL - I have tried several. What am I doing wrong? Thanks.

Make the edits in the first post. THEN apply the edits in this post: http://forum.coppermine-gallery.net/index.php/topic,37962.msg264919.html#msg264919

If you scroll down a post or two there are codes to change the colors and make it so it can go full screen.
Logged

timbuktu

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Displaying videos from Youtube in Coppermine.
« Reply #387 on: November 06, 2009, 08:41:25 pm »

Hello,
    could you tell me if i use the different theme , and the code you told not available there, then we should i do , what if use
different theme?? i can' find any code in my theme except in sample's template, and i don't want to use that for my site,
Kindly let me know if i can do it in same way with my different template .

Thanks with Regards,
Timbuktu
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

timbuktu

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Displaying videos from Youtube in Coppermine.
« Reply #389 on: November 14, 2009, 02:02:00 am »

i think everything was done but the problem is that i'm getting following error

''Error Report
The following uploads encountered errors:
YT errors:
URI   Error message
1. http://www.youtube.com/watch?v=tbZDjnWtK1A''

now what should i do ???
the box appears in upload and i give it uri/URL , but that error occurred .
 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Displaying videos from Youtube in Coppermine.
« Reply #390 on: November 14, 2009, 10:13:42 am »

now what should i do ???
In the first place you should decide if you want to use this or that mod!
Logged

sixgill

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Displaying videos from Youtube in Coppermine.
« Reply #391 on: December 18, 2009, 07:57:12 pm »

Can someone post how to do this in 1.5.2 please?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Displaying videos from Youtube in Coppermine.
« Reply #392 on: December 18, 2009, 08:28:58 pm »

Can someone post how to do this in 1.5.2 please?
http://forum.coppermine-gallery.net/index.php/topic,62704.0.html (I'm not sure if you can access that board. If not, you can checkout the Flash Media Player plugin from the svn.)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Displaying videos from Youtube in Coppermine.
« Reply #393 on: December 20, 2009, 09:27:28 pm »

Can someone post how to do this in 1.5.2 please?
cpg1.5.x goes unsupported as in "no support at all". Your question is a support question related to cpg1.5.x and therefor not allowed. Anyway, even if cpg1.5.x was supported already, you're not allowed to post that question - see Don't ask for other versions
Logged

MjrGaelic

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Displaying videos from Youtube in Coppermine.
« Reply #394 on: January 31, 2010, 07:35:50 am »

Just wanted to say thank-you for this mod.  I have it working great on my site at www.starbase39.com/media (still working on the site/template as of this posting).

Regards,
Logged

computethisnow

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Displaying videos from Youtube in Coppermine.
« Reply #395 on: February 09, 2010, 03:08:34 pm »

This mod allows you to embed Youtube videos in your Coppermine gallery. A new section appears on the upload page where you enter the URL of the video. Coppermine will use the video thumbnail and title/caption/keywords from Youtube when adding the video.


Demo: http://gelipo.com/members/Nibbler/pictures/61993

To use this mod you will need some extra things:


Files to be changed: upload.php, theme.php

upload.php, add this code near the top of the file after the comments (you can skip this step if you have PHP5)

Code: [Select]
if (!function_exists('file_put_contents')) {
function file_put_contents($n,$d) {
$f=@fopen($n,"w");
if (!$f) {
return false;
} else {
fwrite($f,$d);
fclose($f);
return true;
}
}
}

Then find

Code: [Select]
            // Add the control device.
            $form_array[] = array('control', 'phase_1', 4);
           

before it, add
           
Code: [Select]
           // Youtube
           if (USER_ID) {
            $form_array[] = 'Youtube uploads';
              $form_array[] = array('', 'YT_array[]', 0, 256, 3);
              $form_array[] = 'Note: YouTube videos must be added in the form http://www.youtube.com/watch?v=xxxxxxxxxxx';
}
         
         
Find         

Code: [Select]
//Now we must prepare the inital form for adding the pictures to the database, and we must move them to their final location.         
before it, add
         
Code: [Select]
    // youtube
   
   $YT_array = count($_POST['YT_array']);

if ($YT_array) {
$YT_failure_array = array();

for ($counter = 0; $counter < $YT_array; $counter++) {

// Create the failure ordinal for ordering the report of failed uploads.

$failure_cardinal = $counter + 1;

$failure_ordinal = ''.$failure_cardinal.'. ';
           
$YT_URI = $_POST['YT_array'][$counter];

if (!$YT_URI) continue;


if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){

$vid = $matches[1];
                     
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
                     
$xdata = file_get_contents($xurl);

file_put_contents($CONFIG['fullpath'] . "edit/yt_$vid.xml", $xdata);

// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){

$thumbnail = $xmatches[1];

$rh = fopen($thumbnail, 'rb');
$wh = fopen($CONFIG['fullpath'] . "edit/yt_$vid.jpg", 'wb');


        while (!feof($rh)) fwrite($wh, fread($rh, 1024));

fclose($rh);
fclose($wh);
     
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");

} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
}
             
             } else {
                 $YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> 'Failed to find video');
             }
         }
     }



In the block of code above, you must replace xxxxxxxxxxx with your youtube developer id.
     
Find

Code: [Select]
     
     $zip_error_count = count($zip_failure_array);

After, add

Code: [Select]
     
      $YT_error_count = count($YT_failure_array);
     
Find

Code: [Select]
   
        // Create error report if we have errors.
    if (($file_error_count + $URI_error_count + $zip_error_count) > 0) {
   
Change to

Code: [Select]
   
        // Create error report if we have errors.
    if (($file_error_count + $URI_error_count + $zip_error_count + $YT_error_count) > 0) {
     
Find

Code: [Select]
     
             // Close the error report table.
        endtable()

before it, add
       
Code: [Select]
     
                // Look for YT upload errors.
        if ($YT_error_count > 0) {

            // There are URI upload errors. Generate the section label.
            form_label("YT errors:");
            echo "<tr><td>URI</td><td>Error message</td></tr>";

            // Cycle through the file upload errors.
            for ($i=0; $i < $YT_error_count; $i++) {

                // Print the error ordinal, file name, and error code.
                echo "<tr><td>{$YT_failure_array[$i]['failure_ordinal']} {$YT_failure_array[$i]['URI_name']}</td><td>{$YT_failure_array[$i]['error_code']}</td></tr>";

            }

        }
       
Find

Code: [Select]
       
                $form_array = array(
        sprintf($lang_upload_php['max_fsize'], $CONFIG['max_upl_size']),
        array($lang_upload_php['album'], 'album', 2),
        array('MAX_FILE_SIZE', $max_file_size, 4),
        array($lang_upload_php['picture'], 'userpicture', 1, 1),
        array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
        array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
        array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
        array('event', 'picture', 4)
        );

Change to
       
Code: [Select]
       
        if (preg_match('/^youtube_(.*)\.jpg$/', $file_set[0], $ytmatches)){

         $vid = $ytmatches[1];

$xdata = file_get_contents($CONFIG['fullpath'] . "edit/yt_$vid.xml");


// todo: parse the xml properly
preg_match('/<description>(.*)<\/description>/', $xdata, $xmatches);
$description = substr($xmatches[1], 0, $CONFIG['max_img_desc_length']);

// todo: parse the xml properly
preg_match('/<tags>(.*)<\/tags>/', $xdata, $xmatches);
$keywords = $xmatches[1];

// todo: parse the xml properly
preg_match('/<title>(.*)<\/title>/', $xdata, $xmatches);
$title = substr($xmatches[1], 0, 255);


                $form_array = array(
        array($lang_upload_php['album'], 'album', 2),
        array($lang_upload_php['pic_title'], 'title', 0, 255, 1, $title),
        array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length'], $description),
        array($lang_upload_php['keywords'], 'keywords', 0, 255, 1, $keywords),
    array('control', 'phase_2', 4),
    array('unique_ID', $_POST['unique_ID'], 4),
        );
       
   
    } else {

                $form_array = array(
        sprintf($lang_upload_php['max_fsize'], $CONFIG['max_upl_size']),
        array($lang_upload_php['album'], 'album', 2),
        array('MAX_FILE_SIZE', $max_file_size, 4),
        array($lang_upload_php['picture'], 'userpicture', 1, 1),
        array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
        array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
        array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
        array('event', 'picture', 4)
        );

}

theme.php (if you can't find this code, copy theme_html_picture() over from sample theme and then apply the change)

Find

Code: [Select]
if (isset($image_size['reduced'])) {

Change to

Code: [Select]

      if (preg_match('/^youtube_(.*)\.jpg$/', $CURRENT_PIC_DATA['filename'], $ytmatches)){
   
    $vid = $ytmatches[1];
      $pic_html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'. $vid . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $vid . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><br />';
   
    } elseif (isset($image_size['reduced'])) {


If you get this message when you upload:

then your dev_id is probably wrong.

I have gone over and over these steps and when I try to upload youtube link i keep getting error message just stating YT errors:
URI   Error message
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Displaying videos from Youtube in Coppermine.
« Reply #396 on: February 11, 2010, 07:35:29 am »

Instead of quoting the instructions (we already know them, so there's no need to clutter this thread with that quote) you should have done as suggested per board rules for a start: posting a link to your gallery is mandatory.
Logged

ygl

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Displaying videos from Youtube in Coppermine.
« Reply #397 on: February 22, 2010, 01:33:49 pm »

I have exactly the same problem here! Plz help me to fix this problem.

Hi,

I have exactly the same problem in my gallery: youtube videos work correctly, but I can't upload files.

I've read the whole thread but I don't find the solutions. Anybody knows how to solve this?

Thank you very much in advance.
Logged

ygl

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Displaying videos from Youtube in Coppermine.
« Reply #398 on: February 22, 2010, 01:35:13 pm »

Problems "browse upload"...
YouTube upload working very fine, but "normal browse uploads" not working...

i select "Upload" and browse my computer picture, and click "Continue"...

(http://img166.imageshack.us/img166/6245/gallery1bd3.gif)

Now come problems.... look image...

(http://img250.imageshack.us/img250/1271/gallery2hi0.gif)

And now i click "Continue" so image no uploads my gallerys...
Upload return back first towards...

(http://img176.imageshack.us/img176/4689/gallery3df0.gif)

Thank you very much!  ;)

Supplement is my upload.php file....

Hi, sorry, here is the right quote, with all the information.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Displaying videos from Youtube in Coppermine.
« Reply #399 on: February 23, 2010, 07:28:02 am »

jape's posting is invalid. Yours therefore is invalid as well. I suggest you read up board rules first, especially
If you have an issue with regular uploads, do as suggested in the docs, section "asking for support on upload issues" in a thread of your own on the upload support board. If you have an issue with the mod that is being discussed in this very thread, don't bother to refer to someone else's posting that contains hotlinked images that display screenshots of the regular upload process, but do as I suggested above and post a link to your gallery and write what your actual question or issue is (in your own words, not quoting someone else's invalid posting).
Logged
Pages: 1 ... 16 17 18 19 [20] 21 22   Go Up
 

Page created in 0.039 seconds with 20 queries.