Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:changes_in_2.6 [2013/11/06 17:58]
mistic100 [New email system]
dev:changes_in_2.6 [2014/03/16 08:07] (current)
plg is_adviser() removed
Line 1: Line 1:
 ====== Technical changes in Piwigo 2.6 ====== ====== Technical changes in Piwigo 2.6 ======
 +
 +===== Jquery 1.9 =====
 +
 +Upgrade to jQuery version 1.9 breaks some jQuery functions. See http://jquery.com/upgrade-guide/1.9/ : check you don't use .live() or jQuery.browser()
  
 ===== Jquery UI 1.9 ===== ===== Jquery UI 1.9 =====
Line 42: Line 46:
  
 ===== Smarty 3 ===== ===== Smarty 3 =====
 +
 +[[http://smarty-php.googlecode.com/svn/trunk/distribution/SMARTY_2_BC_NOTES.txt|Changes between Smarty 2 and Smarty 3]]
  
 In template/menubar_categories.tpl, replace: In template/menubar_categories.tpl, replace:
Line 195: Line 201:
  
 === pwg_mail() === === pwg_mail() ===
-The main mailing function has been considerably enhanced, particularly with the support of content template files. See [ PLACEHOLDER this page ] for more details.+The main mailing function has been considerably enhanced, particularly with the support of content template files. See [[dev:send_emails_with_piwigo|]] for more details.
  
 Basic usage is unchanged. Basic usage is unchanged.
Line 213: Line 219:
  
 New parameters: New parameters:
-  * $conf['mail_sender_email'] = '';+  * $conf['mail_sender_email'] = "";
   * $conf['mail_allow_html'] = true;   * $conf['mail_allow_html'] = true;
-  * $conf['mail_theme'] = 'clear'; -- will be moved to GUI 
   * $conf['smtp_secure'] = null;   * $conf['smtp_secure'] = null;
  
Line 234: Line 239:
   * before_send_mail   * before_send_mail
   * before_parse_mail_template   * before_parse_mail_template
 +
 +===== get_cat_display_name() =====
 +We removed **replace_space()** function.\\
 +As a consequence some other functions changed :
 +<code php>
 +// old
 +get_cat_display_name($cat_informations, $url = '', $replace_space = false)
 +get_cat_display_name_from_id($cat_informations, $url = '', $replace_space = false)
 +get_cat_display_name_cache($uppercats, $url = '', $replace_space = false, $single_link = false, $link_class = null)
 +
 +// new
 +get_cat_display_name($cat_informations, $url = '')
 +get_cat_display_name_from_id($cat_informations, $url = '')
 +get_cat_display_name_cache($uppercats, $url = '', $single_link = false, $link_class = null)
 +</code>
 +
 +===== Triggers functions =====
 +Piwigo has two type of triggers: one to notify of an event and one to allow modification of a particular variable. The triggers functions was named **trigger_event()** and **trigger_action()** witch is not a natural naming...
 +
 +In 2.6 we added **trigger_change()** (alias of trigger_event) and **trigger_notify()** (alias of trigger_action).
 +
 +In 2.7 the old functions will be removed.
 +
 +===== GPS metadata =====
 +Piwigo 2.6 adds two fields in **piwigo_images** table : **latitude** and **longitude**. These fields are automatically filled with EXIF metadata if available and if $conf['use_exif'] is true.
 +
 +They are not currently used in the core but they are available for read an write by any plugin.
 +
 +When updating from 2.5, a migration task tries to get values from **lat** and **lon** fields used by Map & Earth and Open Street Maps plugins (the task also drops these two old fields).
 +
 +===== CSS & JS as Smarty templates =====
 +Starting from Piwigo 2.6 you can add Smarty (templating) code in your CSS and JS files included with **combine_css** and **combine_script**.
 +
 +=== Usage ===
 +Add //template=true// in the file declaration.
 +<code>
 +{combine_script id='myscript' path='path/to/dynamic.js' template=true}
 +{combine_css id='mystyle' path='path/to/dynamic.css' template=true}
 +</code>
 +
 +The template engine will first parse the file as a common template file then send it to the file combiner which merges all CSS and JS files in two single files.
 +
 +=== Limitation ===
 +The CSS and JS template files are only parsed when the file combiner needs to regenerate the combined files. This means you can not use real dynamic values in those files.\\
 +This feature must only be used for CSS and JS files depending on a configuration param, chaging very rarely.\\
 +When the said configuration changes you must notify the template engine. There are two ways to do that:
 +  * clear all combined files by calling
 +<code>FileCombiner::clear_combined_files();</code>
 +  * use the //version// parameter of **combine_css** and **combine_script**. For example, EasyCaptcha plugin saves the timestamp of last change in his configuration and uses it as CSS version.
 +<code>{combine_css id='mystyle' path='path/to/dynamic.css' template=true version=$lastmod}</code>
 +===== query2array =====
 +Piwigo 2.6 introducs a new helper. **query2array** builds an array from a SQL query, it actually combines the possibilities of **hash_from_query**, **simple_hash_from_query**, **array_from_query**.
 +
 +The purpose it to provide a single comprehensive function for data retrieval.
 +
 +It takes three parameters : SQL query, key name (optional), value name (optional).
 +
 +Here are the possible return values :
 +<code>
 +  Depending on $key_name and $value_name it can return :
 + 
 +     - an array of arrays of all fields (key=null, value=null)
 +         array(
 +           array('id'=>1, 'name'=>'DSC8956', ...),
 +           array('id'=>2, 'name'=>'DSC8957', ...),
 +           ...
 +           )
 + 
 +     - an array of a single field (key=null, value='...')
 +         array('DSC8956', 'DSC8957', ...)
 + 
 +     - an associative array of array of all fields (key='...', value=null)
 +         array(
 +           'DSC8956' => array('id'=>1, 'name'=>'DSC8956', ...),
 +           'DSC8957' => array('id'=>2, 'name'=>'DSC8957', ...),
 +           ...
 +           )
 + 
 +     - an associative array of a single field (key='...', value='...')
 +         array(
 +           'DSC8956' => 1,
 +           'DSC8957' => 2,
 +           ...
 +           )
 +</code>
 +
 +===== is_adviser() removed =====
 +
 +Function is_adviser() has been deprecated for several releases. Now it has been removed. If you keep it your code, Piwigo will crash.
 
Back to top
dev/changes_in_2.6.1383760693.txt.gz · Last modified: 2013/11/06 17:58 by mistic100
 
 
github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact