| Apache Linux webd001.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 uid=2234(oyaide) gid=100(users) groups=100(users) server ip : 213.186.33.18 | your ip : 216.73.216.109 safemode OFF > / home / oyaide / www / moycompany.com / piwigo2 / plugins / imgpreview / |
| Filename | /home/oyaide/www/moycompany.com/piwigo2/plugins/imgpreview/maintain.inc.php |
| Size | 961 |
| Permission | rw----r-- |
| Owner | oyaide : users |
| Create time | 30-Mar-2016 16:36 |
| Last modified | 12-Mar-2016 21:12 |
| Last accessed | 12-Mar-2016 21:12 |
| Actions | edit | rename | delete | download (gzip) |
| View | text | code | image |
<?php
function plugin_install()
{
global $prefixeTable;
$q = '
INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
VALUES
("imgpreview" , "400#600#true#true#false" , "max-width#max-height#title#opacity#preloadImages");';
pwg_query($q);
}
function plugin_activate()
{
global $prefixeTable, $conf;
//////////// Check Config
$query = '
SELECT COUNT(*) AS result FROM '.CONFIG_TABLE.'
WHERE param IN (\'imgpreview\')
;';
$data_table = pwg_db_fetch_assoc(pwg_query($query));
$exist = $data_table['result'];
if ( $exist == 0 )
{
plugin_install();
}
else {
load_conf_from_db();
if (count(explode("#" , $conf['imgpreview']))!=5)
{
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
pwg_query($q);
plugin_install();
}
}
}//fin active
function plugin_uninstall()
{
global $prefixeTable;
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
}//fin uninstall
?>
function plugin_install()
{
global $prefixeTable;
$q = '
INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
VALUES
("imgpreview" , "400#600#true#true#false" , "max-width#max-height#title#opacity#preloadImages");';
pwg_query($q);
}
function plugin_activate()
{
global $prefixeTable, $conf;
//////////// Check Config
$query = '
SELECT COUNT(*) AS result FROM '.CONFIG_TABLE.'
WHERE param IN (\'imgpreview\')
;';
$data_table = pwg_db_fetch_assoc(pwg_query($query));
$exist = $data_table['result'];
if ( $exist == 0 )
{
plugin_install();
}
else {
load_conf_from_db();
if (count(explode("#" , $conf['imgpreview']))!=5)
{
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
pwg_query($q);
plugin_install();
}
}
}//fin active
function plugin_uninstall()
{
global $prefixeTable;
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
}//fin uninstall
?>