示例#1
0
                    vam_db_perform(TABLE_AUTHORS_INFO, $sql_data_array, 'update', "authors_id = '" . (int) $authors_id . "' and languages_id = '" . (int) $language_id . "'");
                }
            }
            if (USE_CACHE == 'true') {
                vam_reset_cache_block('authors');
            }
            vam_redirect(vam_href_link(FILENAME_AUTHORS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'auID=' . $authors_id));
            break;
        case 'deleteconfirm':
            $authors_id = vam_db_prepare_input($_GET['auID']);
            vam_db_query("delete from " . TABLE_AUTHORS . " where authors_id = '" . (int) $authors_id . "'");
            vam_db_query("delete from " . TABLE_AUTHORS_INFO . " where authors_id = '" . (int) $authors_id . "'");
            if (isset($_POST['delete_articles']) && $_POST['delete_articles'] == 'on') {
                $articles_query = vam_db_query("select articles_id from " . TABLE_ARTICLES . " where authors_id = '" . (int) $authors_id . "'");
                while ($articles = vam_db_fetch_array($articles_query)) {
                    vam_remove_article($articles['articles_id']);
                }
            } else {
                vam_db_query("update " . TABLE_ARTICLES . " set authors_id = '' where authors_id = '" . (int) $authors_id . "'");
            }
            if (USE_CACHE == 'true') {
                vam_reset_cache_block('authors');
            }
            vam_redirect(vam_href_link(FILENAME_AUTHORS, 'page=' . $_GET['page']));
            break;
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html <?php 
echo HTML_PARAMS;
示例#2
0
     if (USE_CACHE == 'true') {
         vam_reset_cache_block('topics');
     }
     vam_redirect(vam_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath));
     break;
 case 'delete_article_confirm':
     if (isset($_POST['articles_id']) && isset($_POST['article_topics']) && is_array($_POST['article_topics'])) {
         $article_id = vam_db_prepare_input($_POST['articles_id']);
         $article_topics = $_POST['article_topics'];
         for ($i = 0, $n = sizeof($article_topics); $i < $n; $i++) {
             vam_db_query("delete from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int) $article_id . "' and topics_id = '" . (int) $article_topics[$i] . "'");
         }
         $article_topics_query = vam_db_query("select count(*) as total from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int) $article_id . "'");
         $article_topics = vam_db_fetch_array($article_topics_query);
         if ($article_topics['total'] == '0') {
             vam_remove_article($article_id);
         }
     }
     if (USE_CACHE == 'true') {
         vam_reset_cache_block('topics');
     }
     vam_redirect(vam_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath));
     break;
 case 'move_topic_confirm':
     if (isset($_POST['topics_id']) && $_POST['topics_id'] != $_POST['move_to_topic_id']) {
         $topics_id = vam_db_prepare_input($_POST['topics_id']);
         $new_parent_id = vam_db_prepare_input($_POST['move_to_topic_id']);
         $path = explode('_', vam_get_generated_topic_path_ids($new_parent_id));
         if (in_array($topics_id, $path)) {
             $messageStack->add_session(ERROR_CANNOT_MOVE_TOPIC_TO_PARENT, 'error');
             vam_redirect(vam_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $topics_id));