Differences

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

Link to this comparison view

dev:changes_in_2.5 [2012/10/28 21:14]
mistic100 created
dev:changes_in_2.5 [2013/05/13 14:32] (current)
plg [Jquery UI 1.9] jquery.ui.button must be declared to use jquery.ui.dialog
Line 2: Line 2:
  
 ===== Albums pagination ===== ===== Albums pagination =====
-For template creators.+http://piwigo.org/bugs/view.php?id=2614 
 +for theme creators. 
 On //index.tpl//, add On //index.tpl//, add
-<file>+<code>
 {if !empty($cats_navbar)} {if !empty($cats_navbar)}
-  {assign var=navbar value=$cats_navbar} +  {include file='navigation_bar.tpl'|@get_extent:'navbar' navbar=$cats_navbar}
-  {include file='navigation_bar.tpl'|@get_extent:'navbar'}+
 {/if} {/if}
-</file>+</code>
 right after **{$CATEGORIES}** right after **{$CATEGORIES}**
  
 And modify existing photos navbar by And modify existing photos navbar by
-<file>+<code>
 {if !empty($thumb_navbar)} {if !empty($thumb_navbar)}
-  {assign var=navbar value=$thumb_navbar} +  {include file='navigation_bar.tpl'|@get_extent:'navbar' navbar=$thumb_navbar}
-  {include file='navigation_bar.tpl'|@get_extent:'navbar'}+
 {/if} {/if}
-</file>+</code> 
 + 
 +===== Add action buttons ===== 
 +http://piwigo.org/bugs/view.php?id=2781 
 +for plugin creators. 
 + 
 +Introduction of two template methods to add buttons to index and picture toolbars, allowing you to place buttons relative to each other : 
 +<code php> 
 +$template->add_picture_button($content, $rank); 
 +$template->add_index_button($content, $rank); 
 +</code> 
 + 
 +No changes for themes. 
 + 
 +===== Info./Error messages moved ===== 
 +On //index.tpl//, **{include file='infos_errors.tpl'}** was moved away from the main **#content** block.\\ 
 +See http://piwigo.org/dev/changeset/18712 
 + 
 +===== Jquery UI 1.9 ===== 
 +Jquery ui effects filename has changed. For example change 
 +<file>footer|combine_script require='jquery.effects.blind'</file> 
 +to 
 +<file>footer|combine_script require='jquery.ui.effect-blind'</file> 
 +We'll have backward naming compatibility for 2.5 version only! 
 + 
 +If you use jquery.ui.dialog, you will have to explicitely require jquery.ui.button too. 
 +===== Password hash ===== 
 + 
 +Until version 2.4 we had a configuration parameter $conf['pass_convert'], which by default was: 
 + 
 +<code php>$conf['pass_convert'] = create_function('$s', 'return md5($s);');</code> 
 + 
 +Now we have 2 configuration settings : 
 + 
 +<code php>// password_hash: function hash the clear user password to store it in the 
 +// database. The function takes only one parameter: the clear password. 
 +$conf['password_hash'] = 'pwg_password_hash'; 
 + 
 +// password_verify: function that checks the password against its hash. The 
 +// function takes 2 mandatory parameter : clear password, hashed password + 
 +// an optional parameter user_id. The user_id is used to update the password 
 +// with the new hash introduced in Piwigo 2.5. See function 
 +// pwg_password_verify in include/functions_user.inc.php 
 +$conf['password_verify'] = 'pwg_password_verify';</code> 
 + 
 +They are used this way: 
 + 
 +<code php>if ($conf['password_verify']($clear_password, $row['password'], $row['id']))</code> 
 + 
 +and 
 + 
 +<code php>  single_update( 
 +    USERS_TABLE, 
 +    array($conf['user_fields']['password'] => $conf['password_hash']($_POST['use_new_pwd'])), 
 +    array($conf['user_fields']['id'] => $user_id) 
 +    );</code> 
 +     
 +===== Website and email on comment form ===== 
 +http://piwigo.org/dev/changeset/17351#file6\\ 
 +http://piwigo.org/dev/changeset/18164#file12 
 + 
 +On //comment_list.tpl// we display the website and the email of the author : 
 +<code html> 
 +<span class="commentAuthor">{if $comment.WEBSITE_URL}<a href="{$comment.WEBSITE_URL}" class="external" target="_blank">{$comment.AUTHOR}</a>{else}{$comment.AUTHOR}{/if}</span> 
 +{if $comment.EMAIL}- <a href="mailto:{$comment.EMAIL}">{$comment.EMAIL}</a>{/if} 
 +</code> 
 + 
 +On //picture.tpl// we display website url and email inputs : 
 +<code html> 
 +{if $comment_add.SHOW_EMAIL} 
 +    <p><label for="email">{'Email'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p> 
 +    <p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p> 
 +{/if} 
 +<p><label for="website_url">{'Website'|@translate} :</label></p> 
 +<p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p> 
 +</code> 
 + 
 +===== index.tpl, Quick search results albums/tags list ===== 
 + 
 +In index.tpl, inline CSS was replaced with CSS classes .tag_search_results and .category_search_results and CSS rules were moved to themes/default/theme.css: 
 + 
 +<code html>{if !empty($category_search_results)}  
 +<div style="font-size:16px;margin:10px 16px"> 
 + 
 +[...] 
 + 
 +{if !empty($tag_search_results)}  
 +<div style="font-size:16px;margin:10px 16px"></code> 
 + 
 +were replaced by 
 + 
 +<code html>{if !empty($category_search_results)}  
 +<div class="category_search_results"> 
 + 
 +[...] 
 + 
 +{if !empty($tag_search_results)}  
 +<div class="tag_search_results"></code> 
 + 
 +Change the code accordingly in your specific index.tpl if any. 
 + 
 +===== New config var ===== 
 + 
 +The number of maximum Ajax requests at once, for thumbnails on-the-fly generation 
 +<code> 
 +$conf['maxRequests']=3; 
 +</code> 
 + 
 +The categories on PEM (plugins repository) are configurable : 
 +<code> 
 +$conf['pem_plugins_category'] = 12; 
 +$conf['pem_themes_category'] = 10; 
 +$conf['pem_languages_category'] = 8; 
 +</code> 
 + 
 +Protection of originals images: 
 +<code> 
 +// one of '', 'images', 'all' 
 +//TODO: Put this in admin and also manage .htaccess in #sites and upload folders 
 +$conf['original_url_protection'] = ''; 
 +</code> 
 +the value 'all' is not recommended if you have videos 
 + 
 +===== MySQLi ===== 
 +We introduce MySQLi support in Piwigo 2.5, replacing MySQL (still available as a fallback). 
 + 
 +  * ''pwg_db_connect()'' doesn't return the ''link_identifier'' anymore. (it was not useable with other SQL methods anyway) 
 +  * **mysql_* functions are broken** 
 +  * mysql_fetch_array must be replaced by pwg_db_fetch_row or pwg_db_fetch_assoc 
 + 
 +See details on [[http://piwigo.org/forum/viewtopic.php?id=21514|forum,     [Piwigo 2.5+] use of mysql_* function is forbidden]] 
 + 
 + 
 +===== Ajax loading enhancement [themes] ===== 
 + 
 +New theme variable 
 +  'img_dir'      => 'themes/default/images',  
 +to separate icons and images 
 + 
 +New icons 
 +  * for thumbnails.tpl, mainpage_categories.tpl and comment_list.tpl: {$themeconf.icon_dir}/img_small.png displays a "neutral picture" to notify the visitor something should be there during the Ajax loading of the thumbnails 
 +  * for thumbnails.tpl, mainpage_categories.tpl, picture_content.tpl and comment_list.tpl: {$themeconf.icon_dir}/errors_small.png displays an error picture if the Ajax loading failed 
 +  * for thumbnails.tpl, mainpage_categories.tpl, picture_content.tpl and comment_list.tpl: {$themeconf.img_dir}/ajax_loader.gif display a animated gif to show that at least one picture is loading 
 + 
 +New div 
 +  * for thumbnails.tpl, mainpage_categories.tpl and comment_list.tpl: <div class="loader"><img src="{$ROOT_URL}{$themeconf.img_dir}/ajax_loader.gif"></div> is the customizable div which display the gif: by default the position is absolute at the top right corner 
 + 
 +Check the diff of those tpl files for further info 
 + 
 +If your theme has $themeconf['load_parent_css'] = false (like Simple), then add in your theme.css: 
 +<code css>/* Loader gif new in 2.5 */ 
 +.loader { 
 +  display: none; 
 +  position: fixed; 
 +  right: 0; 
 +  bottom: 0; 
 +}</code> 
 + 
 +To summarize, 3 new icons customizable and 4 tpl files changed. **These are just enhancements, so your old 2.4 code will still work**
 
Back to top
dev/changes_in_2.5.1351455268.txt.gz · Last modified: 2012/10/28 21:14 by mistic100
 
 
github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact