aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/plugins.php2
-rw-r--r--include/category_cats.inc.php13
-rw-r--r--include/functions.inc.php14
-rw-r--r--include/section_init.inc.php3
-rw-r--r--include/ws_functions.inc.php6
5 files changed, 29 insertions, 9 deletions
diff --git a/admin/plugins.php b/admin/plugins.php
index da16841de..b10cc718e 100644
--- a/admin/plugins.php
+++ b/admin/plugins.php
@@ -89,10 +89,12 @@ INSERT INTO '.PLUGINS_TABLE.' (id,version) VALUES ("'
if ( !isset($crt_db_plugin) )
{
array_push($errors, 'CANNOT '. $_GET['action'] .' - NOT INSTALLED');
+ break;
}
if ($crt_db_plugin['state']!='inactive')
{
array_push($errors, 'invalid current state '.$crt_db_plugin['state']);
+ break;
}
if ( file_exists($file_to_include) )
{
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php
index 6e6304b94..8e967bdc9 100644
--- a/include/category_cats.inc.php
+++ b/include/category_cats.inc.php
@@ -177,7 +177,7 @@ if (count($categories) > 0)
{
update_cats_with_filtered_data($categories);
}
- trigger_action('loc_begin_index_categories');
+ trigger_action('loc_begin_index_category_thumbnails', $categories);
if ($conf['subcatify'])
{
$template->set_filename('mainpage_categories', 'mainpage_categories.tpl');
@@ -221,6 +221,10 @@ if (count($categories) > 0)
'NAME' => $name,
)
);
+
+ //plugins need to add/modify sth in this loop ?
+ trigger_action('loc_index_category_thumbnail',
+ $category, 'categories.category' );
}
$template->assign_var_from_handle('CATEGORIES', 'mainpage_categories');
@@ -252,7 +256,7 @@ if (count($categories) > 0)
$category['count_images'],
$category['count_categories'],
true,
- '<BR>'
+ '; '
),
'U_IMG_LINK' => make_index_url(
@@ -284,6 +288,10 @@ if (count($categories) > 0)
)
);
+ //plugins need to add/modify sth in this loop ?
+ trigger_action('loc_index_category_thumbnail',
+ $category, 'thumbnails.line.thumbnail' );
+
// create a new line ?
if (++$row_number == $user['nb_image_line'])
{
@@ -300,5 +308,6 @@ if (count($categories) > 0)
$template->assign_var_from_handle('CATEGORIES', 'thumbnails');
unset( $template->_tpldata['thumbnails.'] );//maybe write a func for that
}
+ trigger_action('loc_end_index_category_thumbnails', $categories);
}
?>
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 5990b1f68..5540c87c8 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -413,18 +413,24 @@ function pwg_log($image_id = null, $image_type = null)
{
global $conf, $user, $page;
+ $do_log = true;
if (!$conf['log'])
{
- return false;
+ $do_log = false;
}
-
if (is_admin() and !$conf['history_admin'])
{
- return false;
+ $do_log = false;
}
-
if ($user['is_the_guest'] and !$conf['history_guest'])
{
+ $do_log = false;
+ }
+
+ $do_log = trigger_event('pwg_log_allowed', $do_log, $image_id, $image_type);
+
+ if (!$do_log)
+ {
return false;
}
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index 672af0d5c..00c8c9137 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -298,6 +298,9 @@ else
}
break;
}
+ default:
+ trigger_error('script_basename "'.script_basename().'" unknown',
+ E_USER_WARNING);
}
}
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index f6653a457..43a50b093 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -375,7 +375,7 @@ LIMIT '.$params['per_page']*$params['page'].','.$params['per_page'];
$image[$k] = (int)$row[$k];
}
}
- foreach ( array('name', 'file') as $k )
+ foreach ( array('file', 'name', 'comment') as $k )
{
$image[$k] = $row[$k];
}
@@ -829,7 +829,7 @@ SELECT * FROM '.IMAGES_TABLE.'
$image[$k] = (int)$row[$k];
}
}
- foreach ( array('name', 'file') as $k )
+ foreach ( array('file', 'name', 'comment') as $k )
{
$image[$k] = $row[$k];
}
@@ -1035,7 +1035,7 @@ LIMIT '.$params['per_page']*$params['page'].','.$params['per_page'];
$image[$k] = (int)$row[$k];
}
}
- foreach ( array('name', 'file') as $k )
+ foreach ( array('file', 'name', 'comment') as $k )
{
$image[$k] = $row[$k];
}