aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/configuration.php9
-rw-r--r--admin/update.php4
2 files changed, 10 insertions, 3 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index b1516bfbb..1714a78bc 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -68,7 +68,14 @@ if ( isset( $_POST['submit'] ) )
while ( $row = mysql_fetch_array( $result ) )
{
$site = 'delete_site_'.$row['id'];
- if ( $_POST[$site] == 1 ) delete_site( $row['id'] );
+ if ( $_POST[$site] == 1 )
+ {
+ delete_site( $row['id'] );
+ // if any picture of this site were linked to another categories, we
+ // have to update the informations of those categories. To make it
+ // simple, we just update all the categories
+ update_category( 'all' );
+ }
}
// thumbnail prefix must not contain accentuated characters
$old_prefix = $_POST['prefix_thumbnail'];
diff --git a/admin/update.php b/admin/update.php
index a808af9a2..ae5e32a66 100644
--- a/admin/update.php
+++ b/admin/update.php
@@ -44,7 +44,6 @@ function insert_local_category( $cat_id )
if ( isset( $page['cat'] ) or $_GET['update'] == 'all' )
{
$output.= insert_local_image( $cat_directory, $cat_id );
- update_category( $cat_id );
}
}
@@ -403,7 +402,6 @@ function insert_remote_category( $xml_dir, $site_id, $id_uppercat, $level )
$category_id = $row['id'];
}
$output.= insert_remote_image( $list_dirs[$i], $category_id );
- update_category( $category_id );
$output.= insert_remote_category( $list_dirs[$i], $site_id,
$category_id, $level+1 );
$output.= '</div>';
@@ -598,6 +596,8 @@ if ( @is_file( './listing.xml' ) )
$vtp->closeSession( $sub, 'remote_update' );
}
+//---------------------------------------- update informations about categories
+update_category( 'all' );
//----------------------------------------------------------- sending html code
$vtp->Parse( $handle , 'sub', $sub );
?> \ No newline at end of file