Changeset 29253


Ignore:
Timestamp:
08/23/14 13:03:08 (5 years ago)
Author:
mistic100
Message:

update for 2.7

Location:
extensions/Back2Front
Files:
1 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Back2Front/admin.php

    r23177 r29253  
    11<?php 
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    33 
    44global $conf, $template; 
     
    1818    ); 
    1919   
    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'); 
    2222} 
    2323 
     
    4848$template->set_filename('back2front_conf', realpath(B2F_PATH.'template/admin.tpl')); 
    4949$template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf'); 
    50  
    51 ?> 
  • extensions/Back2Front/include/Back2Front.php

    r28073 r29253  
    11<?php  
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    33 
    44include_once(B2F_PATH.'include/functions.inc.php'); 
     
    363363  return $tpl_thumbnails_var; 
    364364} 
    365  
    366 ?> 
  • extensions/Back2Front/include/functions.inc.php

    r23177 r29253  
    11<?php 
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    33 
    44/* 
     
    8585     
    8686  $conf['back2front']['versos_cat'] = $versos_cat['id']; 
    87   conf_update_param('back2front', serialize($conf['back2front'])); 
     87  conf_update_param('back2front', $conf['back2front']); 
    8888} 
    8989 
     
    106106  } 
    107107} 
    108  
    109 ?> 
  • extensions/Back2Front/main.inc.php

    r23177 r29253  
    44Version: auto 
    55Description: 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=533 
     6Plugin URI: auto 
    77Author: Mistic 
    88Author URI: http://www.strangeplanet.fr 
    99*/ 
    1010 
    11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
     12 
    1213global $prefixeTable; 
    1314 
    14 defined('B2F_ID') or define('B2F_ID', basename(dirname(__FILE__))); 
    15 define('B2F_PATH', PHPWG_PLUGINS_PATH . B2F_ID . '/'); 
     15define('B2F_ID',    basename(dirname(__FILE__))); 
     16define('B2F_PATH',  PHPWG_PLUGINS_PATH . B2F_ID . '/'); 
    1617define('B2F_TABLE', $prefixeTable . 'image_verso'); 
    17 define('B2F_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . B2F_ID); 
    18 define('B2F_VERSION', 'auto'); 
     18define('B2F_ADMIN', get_root_url() . 'admin.php?page=plugin-' . B2F_ID); 
    1919 
    2020include_once(B2F_PATH . 'include/Back2Front.php'); 
    2121 
     22 
    2223add_event_handler('init', 'back2front_init'); 
     24 
    2325 
    2426function back2front_init() 
    2527{ 
    26   global $conf, $pwg_loaded_plugins; 
     28  global $conf; 
    2729   
    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 
    5532  load_language('plugin.lang', B2F_PATH); 
    5633} 
     34 
    5735 
    5836if (script_basename() == 'picture') 
     
    8058  } 
    8159} 
    82  
    83 ?> 
Note: See TracChangeset for help on using the changeset viewer.