Pour passer de la 2.0.53 à la 2.0.54, appliquer cette suite de patch :
Next/Previous Fix
Code : Tout sélectionner
#
#-----[ OPEN ]------------------------------------------
#
album_page.php
#
#-----[ FIND ]------------------------------------------
#
// ------------------------------------
// PREVIOUS & NEXT
// ------------------------------------
if( isset($HTTP_GET_VARS['mode']) )
{
if( ($HTTP_GET_VARS['mode'] == 'next') or ($HTTP_GET_VARS['mode'] == 'previous') )
{
$sql = "SELECT pic_id, pic_cat_id, pic_user_id
FROM ". ALBUM_TABLE ."
WHERE pic_id = $pic_id";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if( empty($row) )
{
message_die(GENERAL_ERROR, 'Bad pic_id');
}
$sql = "SELECT new.pic_id, new.pic_time
FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
WHERE cur.pic_id = $pic_id
AND new.pic_id <> cur.pic_id
AND new.pic_cat_id = cur.pic_cat_id";
$sql .= ($HTTP_GET_VARS['mode'] == 'next') ? " AND new.pic_time >= cur.pic_time" : " AND new.pic_time <= cur.pic_time";
$sql .= ($row['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= ($HTTP_GET_VARS['mode'] == 'next') ? " ORDER BY pic_time ASC LIMIT 1" : " ORDER BY pic_time DESC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if( empty($row) )
{
message_die(GENERAL_ERROR, $lang['Pic_not_exist']);
}
$pic_id = $row['pic_id']; // NEW pic_id
}
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
// ------------------------------------
// PREVIOUS & NEXT
// ------------------------------------
if( isset($HTTP_GET_VARS['mode']) )
{
if( ($HTTP_GET_VARS['mode'] == 'next') or ($HTTP_GET_VARS['mode'] == 'previous') )
{
$sql = "SELECT pic_id, pic_cat_id, pic_user_id
FROM ". ALBUM_TABLE ."
WHERE pic_id = $pic_id";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$cur_pic_cat = $row['pic_cat_id'];
if( empty($row) )
{
message_die(GENERAL_ERROR, 'Bad pic_id');
}
$sql = "SELECT new.pic_id, new.pic_time
FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
WHERE cur.pic_id = $pic_id
AND new.pic_id <> cur.pic_id
AND new.pic_cat_id = cur.pic_cat_id";
$sql .= ($HTTP_GET_VARS['mode'] == 'next') ? " AND new.pic_time >= cur.pic_time" : " AND new.pic_time <= cur.pic_time";
$sql .= ($row['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= ($HTTP_GET_VARS['mode'] == 'next') ? " ORDER BY pic_time ASC LIMIT 1" : " ORDER BY pic_time DESC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$sql = "SELECT min(pic_id), max(pic_id)
FROM ". ALBUM_TABLE ."
WHERE pic_cat_id = $cur_pic_cat";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$next = $db->sql_fetchrow($result);
$first_pic = $next['min(pic_id)'];
$last_pic = $next['max(pic_id)'];
if( empty($row) AND ($HTTP_GET_VARS['mode'] == 'next'))
{
redirect(append_sid("album_page.$phpEx?pic_id=$first_pic"));
}
if( empty($row) AND ($HTTP_GET_VARS['mode'] == 'previous'))
{
redirect(append_sid("album_page.$phpEx?pic_id=$last_pic"));
}
$pic_id = $row['pic_id']; // NEW pic_id
}
}
#
#-----[ SAVE/CLOSE THE FILE ]------------------------------------------
#
# End
Moderator permissions fix
Code : Tout sélectionner
#
#-----[ OPEN ]-------------------------------------------------------
#
album_delete.php
#
#-----[ FIND ]----------------------------------------
#
if( (!$album_user_access['moderator']) or ($userdata['user_level'] != ADMIN) )
#
#-----[ Replace, with ]----------------------------------
#
if( (!$album_user_access['moderator']) and ($userdata['user_level'] != ADMIN) )
#
#-----[ OPEN ]-------------------------------------------------------
#
album_edit.php
#
#-----[ FIND ]----------------------------------------
#
if( (!$album_user_access['moderator']) or ($userdata['user_level'] != ADMIN) )
#
#-----[ Replace, with ]----------------------------------
#
if( (!$album_user_access['moderator']) and ($userdata['user_level'] != ADMIN) )
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
tradesk fix
Code : Tout sélectionner
Open
album_modcp.php
Find:
@unlink(ALBUM_UPLOAD_PATH . $filerow['pic_filename']);
and replace it with
@unlink(ALBUM_UPLOAD_PATH . $filerow[$i]['pic_filename']);
galixte fix
Code : Tout sélectionner
OPEN :
album_modcp.php
FIND :
if( !isset($HTTP_POST_VARS['confirm']) )
{
// we must check POST method now
$pic_id_array = array();
if ($pic_id != FALSE) // from GET
{
$pic_id_array[] = $pic_id;
}
else
{
// Check $pic_id[] on POST Method now
if( isset($HTTP_POST_VARS['pic_id']) )
{
$pic_id_array = $HTTP_POST_VARS['pic_id'];
if( !is_array($pic_id_array) )
{
message_die(GENERAL_ERROR, 'Invalid request');
}
}
else
{
message_die(GENERAL_ERROR, 'No pics specified');
}
}
REPLACE WITH :
if( !isset($HTTP_POST_VARS['confirm']) )
{
// we must check POST method now
$pic_id_array = array();
if ($pic_id != FALSE)
// from GET
{
$pic_id_array[] = $pic_id;
}
else
{
// Check $pic_id[] on POST Method now
if( isset($HTTP_POST_VARS['pic_id']) )
{
$pic_id_array = $HTTP_POST_VARS['pic_id'];
if( !is_array($pic_id_array) )
{
message_die(GENERAL_ERROR, 'Invalid request');
}
}
else
{
message_die(GENERAL_ERROR, 'No pics specified');
}
}
if ( isset($HTTP_POST_VARS['cancel']) )
{
$redirect = "album_modcp.$phpEx?cat_id=$cat_id";
redirect(append_sid($redirect, true));
}
Il y a ce fix que je ne comprend pas et je n'ai pas le temps de traiter celui ci ainsi que celui là :
http://smartor.is-root.com/viewtopic.php?t=13066
http://smartor.is-root.com/viewtopic.php?p=63096#63096
Je verrais plus tard pour améliorer ça et faire ce qu'il faut pour la 2.0.55