This is an old revision of the document!

Technical changes in Piwigo 2.5

Albums pagination for theme creators.

On index.tpl, add

{if !empty($cats_navbar)}
  {include file='navigation_bar.tpl'|@get_extent:'navbar' navbar=$cats_navbar}

right after {$CATEGORIES}

And modify existing photos navbar by

{if !empty($thumb_navbar)}
  {include file='navigation_bar.tpl'|@get_extent:'navbar' navbar=$thumb_navbar}

Add action buttons 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 :

$template->add_picture_button($content, $rank);
$template->add_index_button($content, $rank);

No changes for themes.

Info./Error messages moved

On index.tpl, {include file='infos_errors.tpl'} was moved away from the main #content block.

Jquery UI 1.9

Jquery ui effects filename has changed. For example change

footer|combine_script require='jquery.effects.blind'


footer|combine_script require='jquery.ui.effect-blind'

We'll have backward naming compatibility for 2.5 version only!

Password hash

Until version 2.4 we had a configuration parameter $conf['pass_convert'], which by default was:

$conf['pass_convert'] = create_function('$s', 'return md5($s);');

Now we have 2 configuration settings :

// 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/
$conf['password_verify'] = 'pwg_password_verify';

They are used this way:

if ($conf['password_verify']($clear_password, $row['password'], $row['id']))


    array($conf['user_fields']['password'] => $conf['password_hash']($_POST['use_new_pwd'])),
    array($conf['user_fields']['id'] => $user_id)

Website and email on comment form

On comment_list.tpl we display the website and the email of the author :

<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}

On picture.tpl we display website url and email inputs :

{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>
<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>

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:

{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">

were replaced by

{if !empty($category_search_results)} 
<div class="category_search_results">
{if !empty($tag_search_results)} 
<div class="tag_search_results">

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


The categories on PEM (plugins repository) are configurable :

$conf['pem_plugins_category'] = 12;
$conf['pem_themes_category'] = 10;
$conf['pem_languages_category'] = 8;


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 forum, [Piwigo 2.5+] use of mysql_* function is forbidden

Back to top
dev/changes_in_2.5.1361973563.txt.gz · Last modified: 2013/02/27 14:59 by plg
github twitter facebook google+ newsletter Donate © 2002-2019 · Contact