aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/c13y_internal.class.php2
-rw-r--r--admin/include/check_integrity.class.php2
-rw-r--r--admin/include/functions.php35
-rw-r--r--admin/include/functions_notification_by_mail.inc.php14
-rw-r--r--admin/include/functions_upgrade.php7
-rw-r--r--admin/include/languages.class.php4
-rw-r--r--admin/include/mysqldump.php4
-rw-r--r--admin/include/pclzip.lib.php2
-rw-r--r--admin/include/plugins.class.php4
-rw-r--r--admin/include/tabsheet.class.php2
-rw-r--r--admin/include/themes.class.php4
-rw-r--r--admin/include/updates.class.php22
12 files changed, 76 insertions, 26 deletions
diff --git a/admin/include/c13y_internal.class.php b/admin/include/c13y_internal.class.php
index 10375095a..e0911f7e6 100644
--- a/admin/include/c13y_internal.class.php
+++ b/admin/include/c13y_internal.class.php
@@ -23,7 +23,7 @@
class c13y_internal
{
- function c13y_internal()
+ function __construct()
{
add_event_handler('list_check_integrity', array(&$this, 'c13y_version'));
add_event_handler('list_check_integrity', array(&$this, 'c13y_exif'));
diff --git a/admin/include/check_integrity.class.php b/admin/include/check_integrity.class.php
index 66ff1db8f..58893a284 100644
--- a/admin/include/check_integrity.class.php
+++ b/admin/include/check_integrity.class.php
@@ -27,7 +27,7 @@ class check_integrity
var $retrieve_list;
var $build_ignore_list;
- function check_integrity()
+ function __construct()
{
$this->ignore_list = array();
$this->retrieve_list = array();
diff --git a/admin/include/functions.php b/admin/include/functions.php
index fbbcd8c55..5ad436b71 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -180,6 +180,25 @@ function delete_element_files($ids)
}
$new_ids = array();
+ $formats_of = array();
+
+ $query = '
+SELECT
+ image_id,
+ ext
+ FROM '.IMAGE_FORMAT_TABLE.'
+ WHERE image_id IN ('.implode(',', $ids).')
+;';
+ $result = pwg_query($query);
+ while ($row = pwg_db_fetch_assoc($result))
+ {
+ if (!isset($formats_of[ $row['image_id'] ]))
+ {
+ $formats_of[ $row['image_id'] ] = array();
+ }
+
+ $formats_of[ $row['image_id'] ][] = $row['ext'];
+ }
$query = '
SELECT
@@ -205,6 +224,14 @@ SELECT
$files[] = original_to_representative( $files[0], $row['representative_ext']);
}
+ if (isset($formats_of[ $row['id'] ]))
+ {
+ foreach ($formats_of[ $row['id'] ] as $format_ext)
+ {
+ $files[] = original_to_format($files[0], $format_ext);
+ }
+ }
+
$ok = true;
if (!isset($conf['never_delete_originals']))
{
@@ -277,6 +304,13 @@ DELETE FROM '.IMAGE_CATEGORY_TABLE.'
;';
pwg_query($query);
+ // destruction of the formats
+ $query = '
+DELETE FROM '.IMAGE_FORMAT_TABLE.'
+ WHERE image_id IN ('. $ids_str .')
+;';
+ pwg_query($query);
+
// destruction of the links between images and tags
$query = '
DELETE FROM '.IMAGE_TAG_TABLE.'
@@ -540,6 +574,7 @@ function get_fs_directories($path, $recursive = true)
'.', '..', '.svn',
'thumbnail', 'pwg_high',
'pwg_representative',
+ 'pwg_format',
)
);
$exclude_folders = array_flip($exclude_folders);
diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php
index 8d0fe2621..7dc113b0f 100644
--- a/admin/include/functions_notification_by_mail.inc.php
+++ b/admin/include/functions_notification_by_mail.inc.php
@@ -125,12 +125,12 @@ select
U.'.$conf['user_fields']['username'].' as username,
U.'.$conf['user_fields']['email'].' as mail_address,
N.enabled,
- N.last_send
-from
- '.USER_MAIL_NOTIFICATION_TABLE.' as N,
- '.USERS_TABLE.' as U
-where
- N.user_id = U.'.$conf['user_fields']['id'];
+ N.last_send,
+ UI.status
+from '.USER_MAIL_NOTIFICATION_TABLE.' as N
+ JOIN '.USERS_TABLE.' as U on N.user_id = U.'.$conf['user_fields']['id'].'
+ JOIN '.USER_INFOS_TABLE.' as UI on UI.user_id = N.user_id
+where 1=1';
if ($action == 'send')
{
@@ -159,7 +159,7 @@ order by';
else
{
$query .= '
- username;';
+ username';
}
$query .= ';';
diff --git a/admin/include/functions_upgrade.php b/admin/include/functions_upgrade.php
index b7a8763c5..eb0832879 100644
--- a/admin/include/functions_upgrade.php
+++ b/admin/include/functions_upgrade.php
@@ -174,10 +174,7 @@ UPDATE '.PREFIX_TABLE.'user_infos
// Deactivate all templates
function deactivate_templates()
{
- $query = '
- UPDATE '.PREFIX_TABLE.'config
- SET value = \''. array() .'\'
- WHERE param = \'extents_for_templates\';';
+ conf_update_param('extents_for_templates', array());
}
// Check access rights
@@ -322,4 +319,4 @@ function upgrade_db_connect()
my_error(l10n($e->getMessage()), true);
}
}
-?> \ No newline at end of file
+?>
diff --git a/admin/include/languages.class.php b/admin/include/languages.class.php
index 351e36d53..0f3e98eec 100644
--- a/admin/include/languages.class.php
+++ b/admin/include/languages.class.php
@@ -30,7 +30,7 @@ class languages
/**
* Initialize $fs_languages and $db_languages
*/
- function languages($target_charset = null)
+ function __construct($target_charset = null)
{
$this->get_fs_languages($target_charset);
}
@@ -408,4 +408,4 @@ UPDATE '.USER_INFOS_TABLE.'
return strcmp(strtolower($a['extension_name']), strtolower($b['extension_name']));
}
}
-?> \ No newline at end of file
+?>
diff --git a/admin/include/mysqldump.php b/admin/include/mysqldump.php
index 515d86ae9..1432675c8 100644
--- a/admin/include/mysqldump.php
+++ b/admin/include/mysqldump.php
@@ -59,7 +59,7 @@ class MySQLDump {
* @param boolean $compress It defines if the output file is compress (gzip) or not
* @param boolean $hexValue It defines if the outup values are base-16 or not
*/
- function MYSQLDump($db = null, $filepath = 'dump.sql', $compress = false, $hexValue = false){
+ function __construct($db = null, $filepath = 'dump.sql', $compress = false, $hexValue = false){
$this->compress = $compress;
if ( !$this->setOutputFile($filepath) )
return false;
@@ -418,4 +418,4 @@ class MySQLDump {
@fclose($file);
}
}
-?> \ No newline at end of file
+?>
diff --git a/admin/include/pclzip.lib.php b/admin/include/pclzip.lib.php
index e7facc1ea..c2d09a50c 100644
--- a/admin/include/pclzip.lib.php
+++ b/admin/include/pclzip.lib.php
@@ -212,7 +212,7 @@
// Note that no real action is taken, if the archive does not exist it is not
// created. Use create() for that.
// --------------------------------------------------------------------------------
- function PclZip($p_zipname)
+ function __construct($p_zipname)
{
// ----- Tests the zlib
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php
index 71093a6c1..5f258f836 100644
--- a/admin/include/plugins.class.php
+++ b/admin/include/plugins.class.php
@@ -69,7 +69,7 @@ class plugins
/**
* Initialize $fs_plugins and $db_plugins_by_id
*/
- function plugins()
+ function __construct()
{
$this->get_fs_plugins();
@@ -716,4 +716,4 @@ DELETE FROM '. PLUGINS_TABLE .'
$this->fs_plugins = $active_plugins + $inactive_plugins + $not_installed;
}
}
-?> \ No newline at end of file
+?>
diff --git a/admin/include/tabsheet.class.php b/admin/include/tabsheet.class.php
index c7681b611..959444a21 100644
--- a/admin/include/tabsheet.class.php
+++ b/admin/include/tabsheet.class.php
@@ -33,7 +33,7 @@ class tabsheet
$name is the tabsheet's name inside the template .tpl file
$titlename in the template is affected by $titlename value
*/
- function tabsheet($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE')
+ function __construct($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE')
{
$this->sheets = array();
$this->uniqid = null;
diff --git a/admin/include/themes.class.php b/admin/include/themes.class.php
index df0e29e66..dd6b6b1b0 100644
--- a/admin/include/themes.class.php
+++ b/admin/include/themes.class.php
@@ -60,7 +60,7 @@ class themes
/**
* Initialize $fs_themes and $db_themes_by_id
*/
- function themes()
+ function __construct()
{
$this->get_fs_themes();
@@ -736,4 +736,4 @@ SELECT
}
}
-?> \ No newline at end of file
+?>
diff --git a/admin/include/updates.class.php b/admin/include/updates.class.php
index 17a3b2578..29cefdfdb 100644
--- a/admin/include/updates.class.php
+++ b/admin/include/updates.class.php
@@ -135,15 +135,33 @@ class updates
{
return false;
}
+
+ $servers = array();
+
foreach ($pem_exts as $ext)
{
if (isset($ext_to_check[$ext['extension_id']]))
{
- $server = 'server_'.$ext_to_check[$ext['extension_id']];
- $this->$ext_to_check[$ext['extension_id']]->$server += array($ext['extension_id'] => $ext);
+ $type = $ext_to_check[$ext['extension_id']];
+
+ if (!isset($servers[$type]))
+ {
+ $servers[$type] = array();
+ }
+
+ $servers[$type][ $ext['extension_id'] ] = $ext;
+
unset($ext_to_check[$ext['extension_id']]);
}
}
+
+ foreach ($servers as $server_type => $extension_list)
+ {
+ $server_string = 'server_'.$server_type;
+
+ $this->$server_type->$server_string = $extension_list;
+ }
+
$this->check_missing_extensions($ext_to_check);
return true;
}