コード例 #1
0
ファイル: functions_faq.php プロジェクト: holandacz/nb4
function fetch_faq_delete_list($parentname)
{
    global $ifaqcache, $vbulletin;
    if (!is_array($ifaqcache)) {
        cache_ordered_faq();
    }
    static $deletelist;
    if (!is_array($deletelist)) {
        $deletelist = array('\'' . $vbulletin->db->escape_string($parentname) . '\'');
    }
    if (is_array($ifaqcache["{$parentname}"])) {
        foreach ($ifaqcache["{$parentname}"] as $faq) {
            $deletelist[] = '\'' . $vbulletin->db->escape_string($faq['faqname']) . '\'';
            fetch_faq_delete_list($faq['faqname']);
        }
    }
    return $deletelist;
}
コード例 #2
0
ファイル: faq.php プロジェクト: cedwards-reisys/nexus-web
	//-->
	</script>
	<?php 
    $data = '<div id="faqlist_checkboxes">';
    $data .= fetch_faq_checkbox_tree('vb_faq');
    $data .= '</div>';
    print_form_header('faq', 'doupdatefaq');
    print_table_header($vbphrase['delete_old_faq']);
    print_description_row($vbphrase['delete_old_faq_desc']);
    print_description_row($data);
    print_submit_row($vbphrase['delete'], $vbphrase['reset']);
}
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('faqname' => vB_Cleaner::TYPE_STR));
    // get list of items to delete
    $faqDeleteNames = fetch_faq_delete_list($vbulletin->GPC['faqname']);
    $phraseDeleteNamesSql = array();
    foreach ($faqDeleteNames as $name) {
        $phraseDeleteNamesSql[] = $name . '_gfaqtitle';
        $phraseDeleteNamesSql[] = $name . '_gfaqtext';
    }
    // delete faq
    $res = $assertor->assertQuery('vBForum:faq', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_DELETE, 'faqname' => $faqDeleteNames));
    if (defined('DEV_AUTOEXPORT') and DEV_AUTOEXPORT) {
        // get phrases to delete
        if (!empty($phraseDeleteNamesSql)) {
            $set = $assertor->assertQuery('vBForum:getDistinctProduct', array(vB_dB_Query::QUERY_STORED, 'phraseDeleteNamesSql' => $phraseDeleteNamesSql));
            $products_to_export = array();
            foreach ($set as $row) {
                $products_to_export[$row['product']] = 1;
            }
コード例 #3
0
ファイル: faq.php プロジェクト: holandacz/nb4
}
// ############################# LOG ACTION ###############################
log_admin_action();
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['faq_manager']);
// #############################################################################
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// #############################################################################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('faqname' => TYPE_STR));
    // get list of items to delete
    $faqDeleteNames = implode(', ', fetch_faq_delete_list($vbulletin->GPC['faqname']));
    // delete faq
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "faq\n\t\tWHERE faqname IN({$faqDeleteNames})\n\t");
    // delete phrases
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "phrase\n\t\tWHERE varname IN ({$faqDeleteNames})\n\t\t\tAND fieldname IN ('faqtitle', 'faqtext')\n\t");
    // get parent item
    $parent = $faqcache[$vbulletin->GPC['faqname']]['faqparent'];
    define('CP_REDIRECT', "faq.php?faq={$parent}");
    print_stop_message('deleted_faq_item_successfully');
}
// #############################################################################
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('faq' => TYPE_STR));
    print_delete_confirmation('faq', $db->escape_string($vbulletin->GPC['faq']), 'faq', 'kill', 'faq_item', '', $vbphrase['please_note_deleting_this_item_will_remove_children']);
}
// #############################################################################
コード例 #4
0
function fetch_faq_delete_list($parentname)
{
    global $ifaqcache;
    if (!is_array($ifaqcache)) {
        cache_ordered_faq();
    }
    static $deletelist;
    if (!is_array($deletelist)) {
        $deletelist = array($parentname);
    }
    if (is_array($ifaqcache["{$parentname}"])) {
        foreach ($ifaqcache["{$parentname}"] as $faq) {
            $deletelist[] = $faq['faqname'];
            fetch_faq_delete_list($faq['faqname']);
        }
    }
    return $deletelist;
}