forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upgrading => Topic started by: skmdd on April 14, 2011, 08:06:06 pm

Title: Youtube Videos mod upgrade from 1.4.x to 1.5
Post by: skmdd on April 14, 2011, 08:06:06 pm
Hi All,
I was trying to upgrade my Coppermine installation, but not sure if the youtube videos I have on the site would still work in 1.5. I used the following mod to upload youtube videos.
http://forum.coppermine-gallery.net/index.php/topic,37962.0.html (http://forum.coppermine-gallery.net/index.php/topic,37962.0.html)

Can you suggest a seamless way to upgrade to 1.5 without breaking the existing youtube videos.

Thanks
Title: Re: Youtube Videos mod upgrade from 1.4.x to 1.5
Post by: Αndré on April 15, 2011, 02:03:04 pm
You have to re-apply the mod after the upgrade. Then you have to replace the superglobals as described here (http://documentation.coppermine-gallery.net/en/dev_superglobals.htm). I suggest to test it with a clone of your gallery, so if something wents wrong you'll have time to fix it.
Title: Re: Youtube Videos mod upgrade from 1.4.x to 1.5
Post by: skmdd on October 09, 2011, 07:36:55 pm
Managed to get the existing youtube videos in my gallery after upgrading from 1.4 to 1.5. The following mod would only make existing youtube videos work. I did not modify the upload new videos.

Update function theme_html_picture() function in theme.php (if the function is not found, copy it from sample.php:

Instead of :
Code: [Select]
      if ($CONFIG['transparent_overlay'] == 1) {

Insert:
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 ($CONFIG['transparent_overlay'] == 1) {