Changeset 26470 for extensions/gvideo/main.inc.php
- Timestamp:
- Jan 6, 2014, 4:41:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/main.inc.php
r20804 r26470 4 4 Version: auto 5 5 Description: Add videos from Dailymotion, Youtube, Vimeo, Wideo and Wat. 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=1367 Author: Mistic & P@t6 Plugin URI: auto 7 Author: Mistic 8 8 Author URI: http://www.strangeplanet.fr 9 9 */ 10 10 11 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 13 global $prefixeTable; 14 14 15 define d('GVIDEO_ID') or define('GVIDEO_ID',basename(dirname(__FILE__)));15 define('GVIDEO_ID', basename(dirname(__FILE__))); 16 16 define('GVIDEO_PATH', PHPWG_PLUGINS_PATH . GVIDEO_ID . '/'); 17 17 define('GVIDEO_ADMIN', get_root_url() . 'admin.php?page=plugin-' . GVIDEO_ID); … … 22 22 add_event_handler('init', 'gvideo_init'); 23 23 add_event_handler('picture_pictures_data', 'gvideo_prepare_picture'); 24 add_event_handler('render_element_content', 'gvideo_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL-10, 2);25 24 26 25 if (defined('IN_ADMIN')) 27 26 { 28 add_event_handler('delete_elements', 'gvideo_delete_elements');29 27 add_event_handler('get_admin_plugin_menu_links', 'gvideo_admin_menu'); 30 28 add_event_handler('tabsheet_before_select','gvideo_tab', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); 31 29 } 32 30 33 include_once(GVIDEO_PATH . 'include/gvideo.inc.php'); 31 add_event_handler('delete_elements', 'gvideo_delete_elements'); 32 33 include_once(GVIDEO_PATH . 'include/events.inc.php'); 34 34 35 35 36 36 /** 37 * update & load language37 * init 38 38 */ 39 39 function gvideo_init() 40 40 { 41 global $ pwg_loaded_plugins;41 global $conf; 42 42 43 if ( 44 GVIDEO_VERSION == 'auto' or 45 $pwg_loaded_plugins[GVIDEO_ID]['version'] == 'auto' or 46 version_compare($pwg_loaded_plugins[GVIDEO_ID]['version'], GVIDEO_VERSION, '<') 47 ) 48 { 49 include_once(GVIDEO_PATH . 'include/install.inc.php'); 50 gvideo_install(); 51 52 if ( $pwg_loaded_plugins[GVIDEO_ID]['version'] != 'auto' and GVIDEO_VERSION !='auto' ) 53 { 54 $query = ' 55 UPDATE '. PLUGINS_TABLE .' 56 SET version = "'. GVIDEO_VERSION .'" 57 WHERE id = "'. GVIDEO_ID .'"'; 58 pwg_query($query); 59 60 $pwg_loaded_plugins[GVIDEO_ID]['version'] = GVIDEO_VERSION; 61 62 if (defined('IN_ADMIN')) 63 { 64 $_SESSION['page_infos'][] = 'Embedded Videos updated to version '. GVIDEO_VERSION; 65 } 66 } 67 } 43 include_once(GVIDEO_PATH . 'maintain.inc.php'); 44 $maintain = new gvideo_maintain(GVIDEO_ID); 45 $maintain->autoUpdate(GVIDEO_VERSION, 'install'); 68 46 69 47 load_language('plugin.lang', GVIDEO_PATH); 48 49 $conf['gvideo'] = unserialize($conf['gvideo']); 70 50 } 71 51 … … 75 55 function gvideo_admin_menu($menu) 76 56 { 77 array_push($menu,array(57 $menu[] = array( 78 58 'NAME' => 'Embedded Videos', 79 59 'URL' => GVIDEO_ADMIN, 80 ));60 ); 81 61 return $menu; 82 62 } … … 109 89 return $sheets; 110 90 } 111 112 ?>
Note: See TracChangeset
for help on using the changeset viewer.