PDA

View Full Version : Dynamic Information Pages



michael_s
10-17-2010, 02:00 PM
Replace this section:
case 'delete_page_confirm':
if ( ($HTTP_POST_VARS['pages_id']) ) {
$page_id = tep_db_prepare_input($HTTP_POST_VARS['pages_id']);

for ($i = 0, $n = sizeof($page_id); $i < $n; $i++) {
tep_db_query("delete from " . TABLE_PAGES . " where pages_id = '" . tep_db_input($page_id) . "' ");
tep_db_query("delete from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . tep_db_input($page_id) . "' ");
}

$page_id_query = tep_db_query("select count(*) as total from " . TABLE_PAGES . " where pages_id = '" . tep_db_input($page_id) . "'");
$page_id = tep_db_fetch_array($page_id_query);

if ($page_id['total'] == '0') {
tep_remove_page($page_id);
}
}

if (USE_CACHE == 'true') {
tep_reset_cache_block('pages');
}

tep_redirect(tep_href_link(FILENAME_INFORMATION));
break;



With :

case 'delete_page_confirm':

$page_id = tep_db_prepare_input($HTTP_POST_VARS['pages_id']);
tep_db_query("delete from " . TABLE_PAGES . " where pages_id = '" . (int)$page_id . "'");
tep_db_query("delete from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "'");

$messageStack->add_session(SUCCESS_PAGE_REMOVED, 'success');

tep_redirect(tep_href_link(FILENAME_INFORMATION));

break;

More... (http://addons.oscommerce.com/info/1686)