Changeset 29253 for extensions/Back2Front
- Timestamp:
- Aug 23, 2014, 1:03:08 PM (10 years ago)
- Location:
- extensions/Back2Front
- Files:
-
- 1 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Back2Front/admin.php
r23177 r29253 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 4 global $conf, $template; … … 18 18 ); 19 19 20 conf_update_param('back2front', serialize($conf['back2front']));21 array_push($page['infos'], l10n('Information data registered in database'));20 conf_update_param('back2front', $conf['back2front']); 21 $page['infos'][] = l10n('Information data registered in database'); 22 22 } 23 23 … … 48 48 $template->set_filename('back2front_conf', realpath(B2F_PATH.'template/admin.tpl')); 49 49 $template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf'); 50 51 ?> -
extensions/Back2Front/include/Back2Front.php
r28073 r29253 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 4 include_once(B2F_PATH.'include/functions.inc.php'); … … 363 363 return $tpl_thumbnails_var; 364 364 } 365 366 ?> -
extensions/Back2Front/include/functions.inc.php
r23177 r29253 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 4 /* … … 85 85 86 86 $conf['back2front']['versos_cat'] = $versos_cat['id']; 87 conf_update_param('back2front', serialize($conf['back2front']));87 conf_update_param('back2front', $conf['back2front']); 88 88 } 89 89 … … 106 106 } 107 107 } 108 109 ?> -
extensions/Back2Front/main.inc.php
r23177 r29253 4 4 Version: auto 5 5 Description: Add a link on picture's page to show a alternative version of the pic (for postcards for example) 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=5336 Plugin URI: auto 7 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 global $prefixeTable; 13 14 14 define d('B2F_ID') or define('B2F_ID',basename(dirname(__FILE__)));15 define('B2F_PATH', PHPWG_PLUGINS_PATH . B2F_ID . '/');15 define('B2F_ID', basename(dirname(__FILE__))); 16 define('B2F_PATH', PHPWG_PLUGINS_PATH . B2F_ID . '/'); 16 17 define('B2F_TABLE', $prefixeTable . 'image_verso'); 17 define('B2F_ADMIN', get_root_url() . 'admin.php?page=plugin-' . B2F_ID); 18 define('B2F_VERSION', 'auto'); 18 define('B2F_ADMIN', get_root_url() . 'admin.php?page=plugin-' . B2F_ID); 19 19 20 20 include_once(B2F_PATH . 'include/Back2Front.php'); 21 21 22 22 23 add_event_handler('init', 'back2front_init'); 24 23 25 24 26 function back2front_init() 25 27 { 26 global $conf , $pwg_loaded_plugins;28 global $conf; 27 29 28 if ( 29 B2F_VERSION == 'auto' or 30 $pwg_loaded_plugins[B2F_ID]['version'] == 'auto' or 31 version_compare($pwg_loaded_plugins[B2F_ID]['version'], B2F_VERSION, '<') 32 ) 33 { 34 include_once(B2F_PATH . 'include/install.inc.php'); 35 back2front_install(); 36 37 if ( $pwg_loaded_plugins[B2F_ID]['version'] != 'auto' and B2F_VERSION != 'auto' ) 38 { 39 $query = ' 40 UPDATE '. PLUGINS_TABLE .' 41 SET version = "'. B2F_VERSION .'" 42 WHERE id = "'. B2F_ID .'"'; 43 pwg_query($query); 44 45 $pwg_loaded_plugins[B2F_ID]['version'] = B2F_VERSION; 46 47 if (defined('IN_ADMIN')) 48 { 49 $_SESSION['page_infos'][] = 'Back2Front updated to version '. B2F_VERSION; 50 } 51 } 52 } 53 54 $conf['back2front'] = unserialize($conf['back2front']); 30 $conf['back2front'] = safe_unserialize($conf['back2front']); 31 55 32 load_language('plugin.lang', B2F_PATH); 56 33 } 34 57 35 58 36 if (script_basename() == 'picture') … … 80 58 } 81 59 } 82 83 ?>
Note: See TracChangeset
for help on using the changeset viewer.