[Cinemaru-svn] cinemaru-svn [189] YouTubeの画像を自動登録するパッチを追加した

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 24日 (火) 01:59:03 JST


Revision: 189
          http://svn.sourceforge.jp/view?root=cinemaru&view=rev&rev=189
Author:   tokita
Date:     2009-03-24 01:59:03 +0900 (Tue, 24 Mar 2009)

Log Message:
-----------
YouTubeの画像を自動登録するパッチを追加した

Modified Paths:
--------------
    trunk/cinemaru/include/db.php

Modified: trunk/cinemaru/include/db.php
===================================================================
--- trunk/cinemaru/include/db.php	2009-03-23 16:42:57 UTC (rev 188)
+++ trunk/cinemaru/include/db.php	2009-03-23 16:59:03 UTC (rev 189)
@@ -52,6 +52,16 @@
     }
     if ($image_file_url != '') {
 	$sql .= ", `image_file_url` = '" . mysql_real_escape_string($image_file_url) . "' ";
+    } else {
+      $constpref = strtoupper( $mydirname ) ;
+      if($file_type == constant($constpref.'_FORM_FILE_TYPE_YOUTUBE_URL')){
+	$parts = explode(" ", $file_url);
+	$vid = explode('=', $parts[0], 2);
+	$vid = explode('&', $vid[1], 2);
+	$vid = $vid[0];
+	$image_file_url = "http://img.youtube.com/vi/".$vid."/default.jpg";
+	$sql .= ", `image_file_url` = '" . mysql_real_escape_string($image_file_url) . "'";
+      }
     }
     if (0 < $file_type) {
 	$sql .= ", `file_type` = " . intval($file_type);




Cinemaru-svn メーリングリストの案内
Back to archive index