Пример #1
0
// ############################### start actually deleting the help topic ##############
if ($_POST['do'] == 'dodelete') {
    $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => TYPE_INT));
    $help = $db->query_first("\n\t\tSELECT script, action, optionname, product \n\t\tFROM " . TABLE_PREFIX . "adminhelp \n\t\tWHERE adminhelpid = " . $vbulletin->GPC['adminhelpid']);
    if ($help) {
        // delete adminhelp entry
        $db->query_write("\n\t\t\tDELETE FROM " . TABLE_PREFIX . "adminhelp \n\t\t\tWHERE adminhelpid = " . $vbulletin->GPC['adminhelpid']);
        // delete associated phrases
        $phrasename = $db->escape_string(fetch_help_phrase_short_name($help));
        $db->query_write("\n\t\t\tDELETE FROM " . TABLE_PREFIX . "phrase\n\t\t\tWHERE fieldname = 'cphelptext'\n\t\t\t\tAND varname IN ('{$phrasename}" . "_title', '{$phrasename}" . "_text')\n\t\t");
        // update language records
        require_once DIR . '/includes/adminfunctions_language.php';
        build_language();
        if (defined('DEV_AUTOEXPORT') and DEV_AUTOEXPORT) {
            require_once DIR . '/includes/functions_filesystemxml.php';
            autoexport_write_help($help['product']);
        }
    }
    define('CP_REDIRECT', 'help.php?do=manage');
    print_stop_message('deleted_topic_successfully');
}
// ############################### start list of existing help topics ##############
if ($_REQUEST['do'] == 'manage') {
    $vbulletin->input->clean_array_gpc('r', array('script' => TYPE_STR));
    // query phrases
    $helpphrase = array();
    $phrases = $db->query_read("SELECT varname, text FROM " . TABLE_PREFIX . "phrase WHERE fieldname = 'cphelptext'");
    while ($phrase = $db->fetch_array($phrases)) {
        $helpphrase["{$phrase['varname']}"] = $phrase['text'];
    }
    unset($phrase);
Пример #2
0
// ############################### start actually deleting the help topic ##############
if ($_POST['do'] == 'dodelete') {
    $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => vB_Cleaner::TYPE_INT));
    $help = $assertor->assertQuery('vBForum:adminhelp', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'adminhelpid' => $vbulletin->GPC['adminhelpid']));
    if ($help and $help->valid()) {
        $result = $help->current();
        $assertor->assertQuery('vBForum:adminhelp', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_DELETE, 'adminhelpid' => $vbulletin->GPC['adminhelpid']));
        // delete associated phrases
        $phrasename = $vbulletin->db->escape_string(fetch_help_phrase_short_name($result));
        $assertor->assertQuery('vBForum:phrase', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_DELETE, 'fieldname' => 'cphelptext', 'varname' => array($phrasename . '_title', $phrasename . '_text')));
        // update language records
        require_once DIR . '/includes/adminfunctions_language.php';
        build_language();
        if (defined('DEV_AUTOEXPORT') and DEV_AUTOEXPORT) {
            require_once DIR . '/includes/functions_filesystemxml.php';
            autoexport_write_help($result['product']);
        }
    }
    print_stop_message2('deleted_topic_successfully', 'help', array('do' => 'manage'));
}
// ############################### start list of existing help topics ##############
if ($_REQUEST['do'] == 'manage') {
    $vbulletin->input->clean_array_gpc('r', array('script' => vB_Cleaner::TYPE_STR));
    // query phrases
    $helpphrase = array();
    $phrases = $assertor->assertQuery('vBForum:phrase', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'fieldname' => 'cphelptext'));
    if ($phrases and $phrases->valid()) {
        foreach ($phrases as $phrase) {
            $helpphrase["{$phrase['varname']}"] = $phrase['text'];
        }
    }