Project

General

Profile

« Previous | Next » 

Revision 1950

Added by darkviper almost 11 years ago

class AccessFile implemented in modules/news

View differences:

delete_post.php
39 39
}
40 40

  
41 41
// Unlink post access file
42
if(is_writable(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION)) {
43
	unlink(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION);
42
try {
43
    $sFilename = WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION;
44
    $oAF = new AccessFile($sFilename, $page_id);
45
    $oAF->delete();
46
    unset($oAF);
47
}catch(AccessFileException $e) {
48
    $admin->print_error($e,ADMIN_URL.'/pages/modify.php?page_id='.$page_id );
44 49
}
45 50

  
46 51
// Delete post
......
50 55
// Clean up ordering
51 56
require(WB_PATH.'/framework/class.order.php');
52 57
$order = new order(TABLE_PREFIX.'mod_news_posts', 'position', 'post_id', 'section_id');
53
$order->clean($section_id); 
58
$order->clean($section_id);
54 59

  
55 60
// Check if there is a db error, otherwise say successful
56 61
if($database->is_error()) {
......
60 65
}
61 66

  
62 67
// Print admin footer
63
$admin->print_footer();
68
$admin->print_footer();

Also available in: Unified diff