Example #1
0
    					'username'		=> $vbulletin->userinfo['username']
    			), array(
    					'title'		=> 'ad_' . $location,
    					'styleid' => array(-1,0)
    			));
    		}
    
    		build_all_styles();
    	}
    */
    print_stop_message2(array('saved_channel_x_successfully', $vbulletin->GPC['channel']['title']), 'forum', array('do' => 'modify', 'n' => $vbulletin->GPC['nodeid'] . "#channel" . $vbulletin->GPC['nodeid']));
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('nodeid' => vB_Cleaner::TYPE_UINT));
    print_delete_confirmation('vBForum:node', $vbulletin->GPC['nodeid'], 'forum', 'kill', 'channel', 0, $vbphrase['are_you_sure_you_want_to_delete_this_channel'], 'htmltitle', 'nodeid');
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('nodeid' => vB_Cleaner::TYPE_UINT));
    vB_Api::instanceInternal('content_channel')->delete($vbulletin->GPC['nodeid']);
    print_stop_message2('deleted_channel_successfully', 'forum');
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => vB_Cleaner::TYPE_ARRAY));
    if (is_array($vbulletin->GPC['order'])) {
        $channels = vB_Api::instanceInternal('search')->getChannels(true);
        foreach ($channels as $channel) {
            if (!isset($vbulletin->GPC['order']["{$channel['nodeid']}"])) {
                continue;
Example #2
0
    }
    $children = fetch_product_dependencies($vbulletin->GPC['productid'], $dependency_list);
    $product_list = fetch_product_list(true);
    $children_text = array();
    foreach ($children as $childproductid) {
        $childproduct = $product_list["{$childproductid}"];
        if ($childproduct) {
            $children_text[] = $childproduct['title'];
        }
    }
    if ($children_text) {
        $affected_children = construct_phrase($vbphrase['uninstall_product_break_products_x'], '<li>' . implode('</li><li>', $children_text) . '</li>');
    } else {
        $affected_children = '';
    }
    print_delete_confirmation('product', $vbulletin->GPC['productid'], 'plugin', 'productkill', '', 0, $affected_children);
}
// #############################################################################
if ($_POST['do'] == 'productimport') {
    $vbulletin->input->clean_array_gpc('p', array('serverfile' => TYPE_STR, 'allowoverwrite' => TYPE_BOOL));
    $vbulletin->input->clean_array_gpc('f', array('productfile' => TYPE_FILE));
    if (file_exists($vbulletin->GPC['productfile']['tmp_name'])) {
        // got an uploaded file?
        $xml = file_read($vbulletin->GPC['productfile']['tmp_name']);
    } else {
        if (file_exists($vbulletin->GPC['serverfile'])) {
            // no uploaded file - got a local file?
            $xml = file_read($vbulletin->GPC['serverfile']);
        } else {
            print_stop_message('no_file_uploaded_and_no_local_file_found');
        }
Example #3
0
    $user = fetch_userinfo($repinfo['userid']);
    if ($user) {
        $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_CP);
        $userdm->set_existing($user);
        $userdm->set('reputation', $user['reputation'] - $repinfo['reputation']);
        $userdm->save();
        unset($userdm);
    }
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "reputation\n\t\tWHERE reputationid = " . $vbulletin->GPC['reputationid']);
    define('CP_REDIRECT', "adminreputation.php?do=list&amp;u={$repinfo['userid']}");
    print_stop_message('deleted_reputation_successfully');
}
// *************************************************************************************************
if ($_REQUEST['do'] == 'deletereputation') {
    $vbulletin->input->clean_array_gpc('r', array('reputationid' => TYPE_INT));
    print_delete_confirmation('reputation', $vbulletin->GPC['reputationid'], 'adminreputation', 'killreputation');
}
if ($_REQUEST['do'] == 'modify') {
    $reputationlevels = $db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "reputationlevel\n\t\tORDER BY minimumreputation\n\t");
    print_form_header('adminreputation', 'updateminimums');
    print_table_header($vbphrase['user_reputation_manager'], 3);
    print_cells_row(array($vbphrase['reputation_level'], $vbphrase['minimum_reputation_level'], $vbphrase['controls']), 1);
    while ($reputationlevel = $db->fetch_array($reputationlevels)) {
        $reputationlevel['level'] = htmlspecialchars_uni($vbphrase['reputation' . $reputationlevel['reputationlevelid']]);
        $cell = array();
        $cell[] = "{$vbphrase['user']} <b>{$reputationlevel['level']}</b>";
        $cell[] = "<input type=\"text\" class=\"bginput\" tabindex=\"1\" name=\"reputation[{$reputationlevel['reputationlevelid']}]\" value=\"{$reputationlevel['minimumreputation']}\" size=\"5\" />";
        $cell[] = construct_link_code($vbphrase['edit'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&reputationlevelid={$reputationlevel['reputationlevelid']}") . construct_link_code($vbphrase['delete'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=remove&minimumreputation={$reputationlevel['minimumreputation']}");
        print_cells_row($cell);
    }
    print_submit_row($vbphrase['update'], $vbphrase['reset'], 3);
Example #4
0
File: ad.php Project: Kheros/MMOver
            print_submit_row($vbphrase['continue'], 0, 2, $vbphrase['go_back']);
            print_cp_footer();
            exit;
        }
    }
    // The insert of the template.
    replace_ad_template(0, $vbulletin->GPC['ad_location'], $template, $template_un, $vbulletin->userinfo['username'], $vbulletin->options['templateversion']);
    replace_ad_template(-1, $vbulletin->GPC['ad_location'], $template, $template_un, $vbulletin->userinfo['username'], $vbulletin->options['templateversion']);
    build_all_styles();
    define('CP_REDIRECT', 'ad.php');
    print_stop_message('saved_ad_x_successfully', $vbulletin->GPC['title']);
}
// #############################################################################
// confirm deletion of a ad
if ($_REQUEST['do'] == 'delete') {
    print_delete_confirmation('ad', $vbulletin->GPC['adid'], 'ad', 'remove');
}
// #############################################################################
// remove an ad
if ($_POST['do'] == 'remove') {
    // get ad location
    $adlocation = $ad_cache[$vbulletin->GPC['adid']]['adlocation'];
    // delete criteria
    $db->query_write("\r\n\t\tDELETE FROM " . TABLE_PREFIX . "adcriteria\r\n\t\tWHERE adid = " . $vbulletin->GPC['adid']);
    // delete ad
    $db->query_write("\r\n\t\tDELETE FROM " . TABLE_PREFIX . "ad\r\n\t\tWHERE adid = " . $vbulletin->GPC['adid']);
    // remove record from ad_cache
    unset($ad_cache[$vbulletin->GPC['adid']]);
    $ad_cache = array_values($ad_cache);
    // rebuild affected template
    require_once DIR . '/includes/functions_ad.php';
Example #5
0
    if ($vbulletin->GPC['forumid'] == -1) {
        define('CP_REDIRECT', 'moderator.php?do=showlist');
    } else {
        if (!empty($vbulletin->GPC['redir'])) {
            define('CP_REDIRECT', 'moderator.php?do=' . ($vbulletin->GPC['redir'] == 'showmods' ? 'showmods' : 'showlist') . '&f=' . $vbulletin->GPC['forumid']);
        } else {
            define('CP_REDIRECT', "forum.php?do=modify&amp;f=" . $vbulletin->GPC['forumid'] . "#forum" . $vbulletin->GPC['forumid']);
        }
    }
    print_stop_message('saved_moderator_x_successfully', implode('; ', $successnames));
}
// ###################### Start Remove moderator #######################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('redir' => TYPE_STR));
    $hidden = array('redir' => $vbulletin->GPC['redir']);
    print_delete_confirmation('moderator', $vbulletin->GPC['moderatorid'], 'moderator', 'kill', 'moderator', $hidden);
}
// ###################### Start Kill moderator #######################
if ($_POST['do'] == 'kill') {
    $mod = $db->query_first("\n\t\tSELECT moderator.*, user.username\n\t\tFROM " . TABLE_PREFIX . "moderator AS moderator\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)\n\t\tWHERE moderatorid = " . $vbulletin->GPC['moderatorid']);
    if (!$mod) {
        print_stop_message('invalid_moderator_specified');
    }
    log_admin_action('username = '******'username'] . ', userid = ' . $mod['userid']);
    $moddata =& datamanager_init('Moderator', $vbulletin, ERRTYPE_CP);
    $moddata->set_existing($mod);
    $moddata->delete(true);
    $vbulletin->input->clean_array_gpc('p', array('redir' => TYPE_STR));
    if ($vbulletin->GPC['redir'] == 'modlist') {
        define('CP_REDIRECT', 'moderator.php?do=showlist');
    } else {
Example #6
0
    $vbulletin->GPC['bbcodereplacement'] = str_replace('%', '%%', $vbulletin->GPC['bbcodereplacement']);
    if ($vbulletin->GPC['twoparams']) {
        $vbulletin->GPC['bbcodereplacement'] = str_replace('{param}', '%1$s', $vbulletin->GPC['bbcodereplacement']);
        $vbulletin->GPC['bbcodereplacement'] = str_replace('{option}', '%2$s', $vbulletin->GPC['bbcodereplacement']);
    } else {
        $vbulletin->GPC['bbcodereplacement'] = str_replace('{param}', '%1$s', $vbulletin->GPC['bbcodereplacement']);
    }
    $db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "bbcode SET\n\t\t\ttitle = '" . $db->escape_string($vbulletin->GPC['title']) . "',\n\t\t\tbbcodetag = '" . $db->escape_string($vbulletin->GPC['bbcodetag']) . "',\n\t\t\tbbcodereplacement = '" . $db->escape_string($vbulletin->GPC['bbcodereplacement']) . "',\n\t\t\tbbcodeexample = '" . $db->escape_string($vbulletin->GPC['bbcodeexample']) . "',\n\t\t\tbbcodeexplanation = '" . $db->escape_string($vbulletin->GPC['bbcodeexplanation']) . "',\n\t\t\ttwoparams = '" . $db->escape_string($vbulletin->GPC['twoparams']) . "',\n\t\t\tbuttonimage = '" . $db->escape_string($vbulletin->GPC['buttonimage']) . "',\n\t\t\toptions = " . convert_array_to_bits($vbulletin->GPC['options'], $vbulletin->bf_misc['bbcodeoptions']) . "\n\t\tWHERE bbcodeid = " . $vbulletin->GPC['bbcodeid']);
    build_bbcode_cache();
    define('CP_REDIRECT', 'bbcode.php?do=modify');
    print_stop_message('saved_bb_code_x_successfully', "[" . $vbulletin->GPC['bbcodetag'] . "]");
}
// ####################################### REMOVE #####################################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('bbcodeid' => TYPE_INT));
    print_delete_confirmation('bbcode', $vbulletin->GPC['bbcodeid'], 'bbcode', 'kill', 'bb_code');
}
// ######################################## KILL #####################################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('bbcodeid' => TYPE_INT));
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "bbcode WHERE bbcodeid = " . $vbulletin->GPC['bbcodeid']);
    build_bbcode_cache();
    $_REQUEST['do'] = 'modify';
}
// ######################################### TEST ######################################
if ($_POST['do'] == 'test') {
    $vbulletin->input->clean_array_gpc('p', array('text' => TYPE_STR));
    $parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
    $parsed_code = $parser->do_parse($vbulletin->GPC['text'], false, false, true, false, true);
    print_form_header('bbcode', 'test');
    print_table_header($vbphrase['test_your_bb_code']);
Example #7
0
}
// ###################### Start email password #######################
if ($_REQUEST['do'] == 'emailpassword') {
    $vbulletin->input->clean_array_gpc('r', array('email' => TYPE_STR, 'userid' => TYPE_UINT));
    print_form_header('../login', 'emailpassword');
    construct_hidden_code('email', $vbulletin->GPC['email']);
    construct_hidden_code('url', $vbulletin->config['Misc']['admincpdir'] . "/user.php?do=find&user[email]=" . urlencode($vbulletin->GPC['email']));
    construct_hidden_code('u', $vbulletin->GPC['userid']);
    print_table_header($vbphrase['email_password_reminder_to_user']);
    print_description_row(construct_phrase($vbphrase['click_the_button_to_send_password_reminder_to_x'], "<i>" . htmlspecialchars_uni($vbulletin->GPC['email']) . "</i>"));
    print_submit_row($vbphrase['send'], 0);
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_INT));
    print_delete_confirmation('user', $vbulletin->GPC['userid'], 'user', 'kill', 'user', '', $vbphrase['all_posts_will_be_set_to_guest']);
    echo '<p align="center">' . construct_phrase($vbphrase['if_you_want_to_prune_user_posts_first'], "thread.php?" . $vbulletin->session->vars['sessionurl'] . "do=pruneuser&amp;f=-1&amp;u=" . $vbulletin->GPC['userid'] . "&amp;confirm=1") . '</p>';
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('userid' => TYPE_INT));
    // check user is not set in the $undeletable users string
    if (is_unalterable_user($vbulletin->GPC['userid'])) {
        print_stop_message('user_is_protected_from_alteration_by_undeletableusers_var');
    } else {
        $info = fetch_userinfo($vbulletin->GPC['userid']);
        if (!$info) {
            print_stop_message('invalid_user_specified');
        }
        $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_CP);
        $userdm->set_existing($info);
Example #8
0
	print_stop_message('saved_widget_successfully');
}

// Remove ######################################################################
if ($_POST['do'] == 'removewidget')
{
	$widget->getDM()->delete();

	define('CP_REDIRECT', 'cms_admin.php?do=widget');
	print_stop_message('deleted_widget_successfully');
}

// Delete ######################################################################
if ($_REQUEST['do'] == 'deletewidget')
{
	print_delete_confirmation('cms_widget', $vbulletin->GPC['widgetid'], 'cms_admin', 'removewidget', 'widget', 0, '', 'title', 'widgetid');
}

// Update ######################################################################
if ($_POST['do'] == 'updatewidget')
{
	$vbulletin->input->clean_array_gpc('p', array(
		'title'    		=> TYPE_NOHTML,
		'description'   => TYPE_NOHTML
	));

	$widgetdm = $widget->getDM();

	try
	{
		$widgetdm->set('title', $vbulletin->GPC['title']);
Example #9
0
		$announcementid = $announcementinfo['announcementid'];
	}

	define('CP_REDIRECT', 'announcement.php');
	print_stop_message('saved_announcement_x_successfully', htmlspecialchars_uni($vbulletin->GPC['title']));
}

// ###################### Start Remove #######################

if ($_REQUEST['do'] == 'remove')
{
	$vbulletin->input->clean_array_gpc('r', array(
		'announcementid' 	=> TYPE_UINT
	));

	print_delete_confirmation('announcement', $vbulletin->GPC['announcementid'], 'announcement', 'kill', 'announcement');
}

// ###################### Start Kill #######################

if ($_POST['do'] == 'kill')
{
	$vbulletin->input->clean_array_gpc('p', array(
		'announcementid' 	=> TYPE_UINT
	));

	if ($announcement = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "announcement WHERE announcementid = " . $vbulletin->GPC['announcementid']))
	{
		$anncdata =& datamanager_init('Announcement', $vbulletin, ERRTYPE_CP);
		$anncdata->set_existing($announcement);
		$anncdata->delete();
Example #10
0
// ###################### Start kill setting #######################
if ($_POST['do'] == 'killsetting') {
    $vbulletin->input->clean_array_gpc('p', array('title' => TYPE_STR));
    // get some info
    $setting = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = '" . $db->escape_string($vbulletin->GPC['title']) . "'");
    // delete phrases
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "phrase\n\t\tWHERE languageid IN (-1, 0) AND\n\t\t\tfieldname = 'vbsettings' AND\n\t\t\tvarname IN ('setting_" . $db->escape_string($setting['varname']) . "_title', 'setting_" . $db->escape_string($setting['varname']) . "_desc')\n\t");
    // delete setting
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "setting WHERE varname = '" . $db->escape_string($setting['varname']) . "'");
    build_options();
    define('CP_REDIRECT', 'options.php?do=options&amp;dogroup=' . $setting['grouptitle']);
    print_stop_message('deleted_setting_successfully');
}
// ###################### Start remove setting #######################
if ($_REQUEST['do'] == 'removesetting') {
    print_delete_confirmation('setting', $vbulletin->GPC['varname'], 'options', 'killsetting');
}
// ###################### Start insert setting #######################
if ($_POST['do'] == 'insertsetting') {
    $vbulletin->input->clean_array_gpc('p', array('varname' => TYPE_STR, 'grouptitle' => TYPE_STR, 'optioncode' => TYPE_STR, 'defaultvalue' => TYPE_STR, 'displayorder' => TYPE_UINT, 'volatile' => TYPE_INT, 'datatype' => TYPE_STR, 'validationcode' => TYPE_STR, 'product' => TYPE_STR, 'blacklist' => TYPE_BOOL, 'title' => TYPE_STR, 'description' => TYPE_STR, 'oldproduct' => TYPE_STR));
    if (is_demo_mode()) {
        print_cp_message('This function is disabled within demo mode');
    }
    if ($s = $db->query_first("\n\t\tSELECT varname\n\t\tFROM " . TABLE_PREFIX . "setting\n\t\tWHERE varname = '" . $db->escape_string($vbulletin->GPC['varname']) . "'\n\t")) {
        print_stop_message('there_is_already_setting_named_x', $vbulletin->GPC['varname']);
    }
    if (!preg_match('#^[a-z0-9_]+$#i', $vbulletin->GPC['varname'])) {
        print_stop_message('invalid_phrase_varname');
    }
    // insert setting place-holder
    /*insert query*/
Example #11
0
    construct_hidden_code('url', $vbulletin->config['Misc']['admincpdir'] . "/user.php?do=find&user[email]=" . urlencode($vbulletin->GPC['email']));
    construct_hidden_code('u', $vbulletin->GPC['userid']);
    print_table_header($vbphrase['email_password_reminder_to_user']);
    print_description_row(construct_phrase($vbphrase['click_the_button_to_send_password_reminder_to_x'], "<i>" . htmlspecialchars_uni($vbulletin->GPC['email']) . "</i>"));
    print_submit_row($vbphrase['send'], 0);
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_INT));
    $extratext = $vbphrase['all_posts_will_be_set_to_guest'];
    // find out if the user has social groups
    $hasgroups = $vbulletin->db->query_first("\n\t\tSELECT COUNT('groupid') AS total\n\t\tFROM " . TABLE_PREFIX . "socialgroup\n\t\tWHERE creatoruserid = " . $vbulletin->GPC['userid']);
    if ($hasgroups['total']) {
        $extratext .= "<br /><br />" . construct_phrase($vbphrase[delete_user_transfer_social_groups], $hasgroups['total']) . " <input type=\"checkbox\" name=\"transfer_groups\" value=\"1\" />";
    }
    print_delete_confirmation('user', $vbulletin->GPC['userid'], 'user', 'kill', 'user', '', $extratext);
    echo '<p align="center">' . construct_phrase($vbphrase['if_you_want_to_prune_user_posts_first'], "thread.php?" . $vbulletin->session->vars['sessionurl'] . "do=pruneuser&amp;f=-1&amp;u=" . $vbulletin->GPC['userid'] . "&amp;confirm=1") . '</p>';
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('userid' => TYPE_INT, 'transfer_groups' => TYPE_BOOL));
    // check user is not set in the $undeletable users string
    if (is_unalterable_user($vbulletin->GPC['userid'])) {
        print_stop_message('user_is_protected_from_alteration_by_undeletableusers_var');
    } else {
        $info = fetch_userinfo($vbulletin->GPC['userid']);
        if (!$info) {
            print_stop_message('invalid_user_specified');
        }
        if ($vbulletin->GPC['transfer_groups']) {
            // fetch groupmember info for groups that the deleted user has ownership of
Example #12
0
        foreach ($ad_locations as $location) {
            $template = wrap_ad_template(build_ad_template($location), $location);
            $template_un = $template;
            $template = compile_template($template);
            $db->query_write("\r\n\t\t\t\tUPDATE " . TABLE_PREFIX . "template SET\r\n\t\t\t\t\ttemplate = '" . $db->escape_string($template) . "',\r\n\t\t\t\t\ttemplate_un = '" . $db->escape_string($template_un) . "',\r\n\t\t\t\t\tdateline = " . TIMENOW . ",\r\n\t\t\t\t\tusername = '******'username']) . "'\r\n\t\t\t\tWHERE\r\n\t\t\t\t\ttitle = 'ad_" . $db->escape_string($location) . "'\r\n\t\t\t\t\tAND styleid IN (-1,0)\r\n\t\t\t");
        }
        build_all_styles();
    }
    $db->free_result($ad_result);
    define('CP_REDIRECT', "forum.php?do=modify&amp;f=" . $vbulletin->GPC['forumid'] . "#forum" . $vbulletin->GPC['forumid']);
    print_stop_message('saved_forum_x_successfully', $vbulletin->GPC['forum']['title']);
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('forumid' => TYPE_UINT));
    print_delete_confirmation('forum', $vbulletin->GPC['forumid'], 'forum', 'kill', 'forum', 0, $vbphrase['are_you_sure_you_want_to_delete_this_forum'], 'title_clean');
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('forumid' => TYPE_UINT));
    $forumdata =& datamanager_init('Forum', $vbulletin, ERRTYPE_CP);
    $forumdata->set_condition("FIND_IN_SET(" . $vbulletin->GPC['forumid'] . ", parentlist)");
    $forumdata->delete();
    define('CP_REDIRECT', 'forum.php');
    print_stop_message('deleted_forum_successfully');
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => TYPE_ARRAY));
    if (is_array($vbulletin->GPC['order'])) {
        $forums = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "forum");
Example #13
0
*/
function is_subcategory_of($categoryid, $parentid)
{
    global $vbulletin;
    if (is_array($vbulletin->vbblog['icategorycache']["0"]["{$categoryid}"])) {
        foreach ($vbulletin->vbblog['icategorycache']["0"]["{$categoryid}"] as $curcategoryid => $category) {
            if ($curcategoryid == $parentid or !$is_subcategory_of($curcategoryid, $parentid)) {
                print_stop_message('cant_parent_category_to_child');
            }
        }
    }
    return true;
}
if ($_REQUEST['do'] == 'removecat') {
    $vbulletin->input->clean_array_gpc('r', array('blogcategoryid' => TYPE_UINT));
    print_delete_confirmation('blog_category', $vbulletin->GPC['blogcategoryid'], 'blog_admin', 'killcat', 'blogcategoryid');
}
if ($_POST['do'] == 'killcat') {
    $vbulletin->input->clean_array_gpc('p', array('blogcategoryid' => TYPE_UINT));
    $categoryinfo = $db->query_first_slave("\r\n\t\tSELECT *\r\n\t\tFROM " . TABLE_PREFIX . "blog_category\r\n\t\tWHERE blogcategoryid = " . $vbulletin->GPC['blogcategoryid'] . "\r\n\t\t\tAND userid = 0\r\n\t");
    if (!$categoryinfo) {
        print_stop_message('invalid_x_specified', 'blogcategoryid');
    } else {
        $dataman =& datamanager_init('Blog_Category', $vbulletin, ERRTYPE_CP);
        $dataman->set_existing($categoryinfo);
        $dataman->set_condition("FIND_IN_SET('" . $vbulletin->GPC['blogcategoryid'] . "', parentlist)");
        $dataman->delete();
        build_category_permissions();
        define('CP_REDIRECT', 'blog_admin.php?do=listcat');
        print_stop_message('deleted_blog_category_successfully');
    }
// #############################################################################
print_cp_header($vbphrase['uc_users_cleanup_rules_manager']);
// #############################################################################
// remove a rule
if ($_POST['do'] == 'remove') {
    // delete criteria
    $sql = $db->query_write("\n        DELETE FROM " . TABLE_PREFIX . "userscleanupcriteria\n        WHERE ruleid = " . $vbulletin->GPC['ruleid']);
    // delete rule
    $db->query_write("\n        DELETE FROM " . TABLE_PREFIX . "userscleanup\n        WHERE ruleid = " . $vbulletin->GPC['ruleid']);
    define('CP_REDIRECT', 'users_cleanup.php?do=list');
    print_stop_message('uc_deleted_users_cleanup_successfully');
}
// #############################################################################
// confirm deletion of a userscleanup rule
if ($_REQUEST['do'] == 'delete') {
    print_delete_confirmation('userscleanup', $vbulletin->GPC['ruleid'], 'users_cleanup', 'remove', 'rule', 0, '', 'title', 'ruleid');
}
// #############################################################################
// update or insert a rule
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', array('title' => TYPE_NOHTML, 'displayorder' => TYPE_UINT, 'active' => TYPE_BOOL, 'criteria' => TYPE_ARRAY));
    $rule_id = $vbulletin->GPC['ruleid'];
    $createria_list = array();
    foreach ($vbulletin->GPC['criteria'] as $criteria_id => $criteria) {
        if ($criteria['active']) {
            $criteria_list[$criteria_id] = array_map('trim', $criteria);
        }
    }
    if (empty($criteria_list)) {
        print_stop_message('uc_no_users_cleanup_criteria_active');
    }
Example #15
0
            print_stop_message('saved_moderator_x_successfully', $vbulletin->GPC['modusername']);
        }
    } else {
        // error
        if (!$userinfo['userid']) {
            print_stop_message('no_moderator_matched_your_query');
        }
        if (!$calendarinfo['calendarid']) {
            print_stop_message('invalid_calendar_specified');
        }
    }
}
// ###################### Start Remove moderator #######################
if ($_REQUEST['do'] == 'removemod') {
    $vbulletin->input->clean_array_gpc('r', array('moderatorid' => TYPE_UINT));
    print_delete_confirmation('calendarmoderator', $vbulletin->GPC['moderatorid'], 'admincalendar', 'killmod', 'calendar_moderator');
}
// ###################### Start Kill moderator #######################
$vbulletin->input->clean_array_gpc('p', array('calendarmoderatorid' => TYPE_UINT));
if ($_POST['do'] == 'killmod') {
    $getuserid = $db->query_first("\n\t\tSELECT user.userid,usergroupid\n\t\tFROM " . TABLE_PREFIX . "calendarmoderator AS calendarmoderator\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)\n\t\tWHERE calendarmoderatorid = " . $vbulletin->GPC['calendarmoderatorid']);
    if (!$getuserid) {
        print_stop_message('user_no_longer_moderator');
    } else {
        $db->query_write("\n\t\t\tDELETE FROM " . TABLE_PREFIX . "calendarmoderator\n\t\t\tWHERE calendarmoderatorid = " . $vbulletin->GPC['calendarmoderatorid']);
        define('CP_REDIRECT', 'admincalendar.php');
        print_stop_message('deleted_moderator_successfully');
    }
}
// ##################### Holidays ###################################
if ($_REQUEST['do'] == 'modifyholiday') {
Example #16
0
        // insert new phrases
        $q[] = "\n\t\t\t### INSERT NEW HELP PHRASES ###\n\t\t\tINSERT INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t(languageid, fieldname, varname, text, product, username, dateline, version)\n\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t{$languageid},\n\t\t\t\t\t'cphelptext',\n\t\t\t\t\t'{$newphrasename}" . "_title',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['title']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t'" . $db->escape_string($product_version) . "'\n\t\t\t\t),\n\t\t\t\t(\n\t\t\t\t\t{$languageid},\n\t\t\t\t\t'cphelptext',\n\t\t\t\t\t'{$newphrasename}" . "_text',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['text']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t'" . $db->escape_string($product_version) . "'\n\t\t\t\t)\n\t\t";
    }
    foreach ($q as $sql) {
        //echo "<pre>" . htmlspecialchars($sql) . "</pre>";
        /*insert query*/
        $db->query_write($sql);
        //echo $db->affected_rows();
    }
    define('CP_REDIRECT', 'help.php?do=manage&amp;script=' . $vbulletin->GPC['help']['script']);
    print_stop_message('saved_topic_x_successfully', $title);
}
// ############################### start confirmation for deleting a help topic ##############
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => TYPE_INT));
    print_delete_confirmation('adminhelp', $vbulletin->GPC['adminhelpid'], 'help', 'dodelete', 'topic');
}
// ############################### start actually deleting the help topic ##############
if ($_POST['do'] == 'dodelete') {
    $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => TYPE_INT));
    if ($help = $db->query_first("SELECT script, action, optionname FROM " . TABLE_PREFIX . "adminhelp WHERE adminhelpid = " . $vbulletin->GPC['adminhelpid'])) {
        // delete adminhelp entry
        $db->query_write("DELETE FROM " . TABLE_PREFIX . "adminhelp WHERE 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();
    }
    define('CP_REDIRECT', 'help.php?do=manage');
Example #17
0
    } catch (vB_Exception_Api $ex) {
        $user = false;
    }
    if (!$user['userid']) {
        print_stop_message2('invalid_user_specified');
    }
    $result = $assertor->assertQuery('vBForum:deleteUserPms', array('userid' => $user['userid']));
    if (!$result) {
        print_stop_message2('no_private_messages_matched_your_query', 'user', array('do' => 'edit', 'u' => $vbulletin->GPC['userid']));
    } else {
        print_stop_message2('deleted_private_messages_successfully', 'user', array('do' => 'edit', 'u' => $vbulletin->GPC['userid']));
    }
}
// ###################### Start Remove VMs Sent by User #######################
if ($_REQUEST['do'] == 'removesentvms') {
    print_delete_confirmation('user', $vbulletin->GPC['userid'], 'usertools', 'killsentvms', 'visitor_messages_sent_by_the_user');
}
// ###################### Start Remove User's VMs #######################
if ($_POST['do'] == 'killsentvms') {
    try {
        $user = vB_Api::instanceInternal('user')->fetchUserInfo();
    } catch (vB_Exception_Api $ex) {
        $user = false;
    }
    if (!$user['userid']) {
        print_stop_message2('invalid_user_specified');
    }
    $vms = $assertor->getRows('vBForum:node', array(vB_db_Query::CONDITIONS_KEY => array(array('field' => 'userid', 'value' => $vbulletin->GPC['userid'], vB_db_Query::OPERATOR_KEY => vB_db_Query::OPERATOR_EQ), array('field' => 'setfor', 'value' => 0, vB_db_Query::OPERATOR_KEY => vB_db_Query::OPERATOR_NE))));
    if (empty($vms)) {
        print_stop_message2('no_visitor_messages_matched_your_query', 'user', array('do' => 'edit', 'u' => $vbulletin->GPC['userid']));
    } else {
Example #18
0
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "notice\n\t\tWHERE noticeid = " . $vbulletin->GPC['noticeid']);
    // delete phrases
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "phrase\n\t\tWHERE varname = 'notice_" . $vbulletin->GPC['noticeid'] . "_html'\n\t");
    // update the datastore notice cache
    build_notice_datastore();
    // rebuild languages
    require_once DIR . '/includes/adminfunctions_language.php';
    build_language();
    define('CP_REDIRECT', 'notice.php?do=modify');
    print_stop_message('deleted_notice_successfully');
}
// #############################################################################
// confirm deletion of a notice
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('noticeid' => TYPE_UINT));
    print_delete_confirmation('notice', $vbulletin->GPC['noticeid'], 'notice', 'remove');
}
// #############################################################################
// update or insert a notice
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', array('noticeid' => TYPE_UINT, 'title' => TYPE_NOHTML, 'html' => TYPE_STR, 'displayorder' => TYPE_UINT, 'active' => TYPE_BOOL, 'persistent' => TYPE_BOOL, 'dismissible' => TYPE_BOOL, 'criteria' => TYPE_ARRAY));
    $noticeid =& $vbulletin->GPC['noticeid'];
    // Check to see if there is criteria
    $have_criteria = false;
    foreach ($vbulletin->GPC['criteria'] as $criteria) {
        if ($criteria['active']) {
            $have_criteria = true;
            break;
        }
    }
    if ($vbulletin->GPC['title'] === '') {
Example #19
0
        $vbulletin->GPC['usergroupid'] = $vbulletin->GPC['promotion']['usergroupid'];
        if ($vbulletin->GPC['usergroupid'] == $vbulletin->GPC['promotion']['joinusergroupid']) {
            print_stop_message('promotion_join_same_group');
        }
        /*insert query*/
        $db->query_write(fetch_query_sql($vbulletin->GPC['promotion'], 'userpromotion'));
    }
    // $title = $db->query_first("SELECT title FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    // $message = str_replace('{title}', $title['title'], $message);
    define('CP_REDIRECT', "usergroup.php?do=modifypromotion" . ($vbulletin->GPC['returnug'] ? "&returnug=1&usergroupid=" . $vbulletin->GPC['usergroupid'] : ''));
    print_stop_message('saved_promotion_successfully');
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'removepromotion') {
    $vbulletin->input->clean_array_gpc('r', array('userpromotionid' => TYPE_INT, 'returnug' => TYPE_BOOL));
    print_delete_confirmation('userpromotion', $vbulletin->GPC['userpromotionid'], 'usergroup', 'killpromotion', 'promotion_usergroup', array('returnug' => $vbulletin->GPC['returnug']));
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'killpromotion') {
    $vbulletin->input->clean_array_gpc('p', array('userpromotionid' => TYPE_INT, 'returnug' => TYPE_BOOL));
    $promotion = $db->query_first_slave("SELECT usergroupid FROM " . TABLE_PREFIX . "userpromotion WHERE userpromotionid = " . $vbulletin->GPC['userpromotionid']);
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "userpromotion WHERE userpromotionid = " . $vbulletin->GPC['userpromotionid']);
    define('CP_REDIRECT', 'usergroup.php?do=modifypromotion' . ($vbulletin->GPC['returnug'] ? '&returnug=1&usergroupid=' . $promotion['usergroupid'] : ""));
    print_stop_message('deleted_promotion_successfully');
}
// #############################################################################
// process usergroup join requests
if ($_POST['do'] == 'processjoinrequests') {
    $vbulletin->input->clean_array_gpc('p', array('request' => TYPE_ARRAY_INT));
    // check we have some results to process
    if (empty($vbulletin->GPC['request'])) {
Example #20
0
    if ($edited) {
        $sql = "\n\t\t\tUPDATE " . TABLE_PREFIX . "navigation\n\t\t\tSET state = " . $navelement['state'] . ",\n\t\t\tdisplayorder = " . $vbulletin->GPC['order'] . ",\n\t\t\tparent = '" . $db->escape_string($vbulletin->GPC['parent']) . "',\n\t\t\tproductid = '" . $db->escape_string($vbulletin->GPC['product']) . "'\n\t\t\t{$sqlset}\n\t\t\tWHERE navid = " . $navelement['navid'] . "\n\t\t";
        $db->query_write($sql);
    }
    if ($vbulletin->GPC['parent'] != $navelement['parent']) {
        $navelement['root'] = $roots[$vbulletin->GPC['parent']];
        // We have moved.
    }
    build_navigation_datastore();
    $taburl = $navelement['root'] ? '&amp;tabid=' . $navelement['root'] : '';
    define('CP_REDIRECT', 'navigation.php?do=list' . $taburl);
    print_stop_message('saved_settings_successfully');
}
if ($_REQUEST['do'] == 'delete') {
    ($hook = vBulletinHook::fetch_hook('navigation_admin_delete')) ? eval($hook) : false;
    print_delete_confirmation('navigation', $vbulletin->GPC['navid'], 'navigation', 'dodelete', 'element', 0, '', 'name', 'navid');
}
if ($_REQUEST['do'] == 'dodelete') {
    if ($navelement['protected']) {
        print_stop_message('cannot_delete_protected');
    }
    if ($navelement['deleted']) {
        print_stop_message('error_already_deleted');
    }
    $sqlset = '';
    $navelement['deleted'] = 1;
    ($hook = vBulletinHook::fetch_hook('navigation_admin_dodelete')) ? eval($hook) : false;
    collapse_navigation_state($navelement);
    $sql = "\n\t\tUPDATE " . TABLE_PREFIX . "navigation\n\t\tSET state = " . $navelement['state'] . "\n\t\t{$sqlset}\n\t\tWHERE navid = " . $navelement['navid'] . "\n\t";
    $db->query_write($sql);
    if ($navelement['navid'] == $navelement['root']) {
Example #21
0
            $db->query_write("UPDATE " . TABLE_PREFIX . "user SET languageid = 0 WHERE languageid = " . $vbulletin->GPC['dolanguageid']);
            $db->query_write("UPDATE " . TABLE_PREFIX . "session SET languageid = 0 WHERE languageid = " . $vbulletin->GPC['dolanguageid']);
            $db->query_write("DELETE FROM " . TABLE_PREFIX . "phrase WHERE languageid = " . $vbulletin->GPC['dolanguageid']);
            $db->query_write("DELETE FROM " . TABLE_PREFIX . "language WHERE languageid = " . $vbulletin->GPC['dolanguageid']);
            build_language_datastore();
            define('CP_REDIRECT', 'language.php');
            print_stop_message('deleted_language_successfully');
        }
    }
}
// ##########################################################################
if ($_REQUEST['do'] == 'delete') {
    if ($vbulletin->GPC['dolanguageid'] == $vbulletin->options['languageid']) {
        print_stop_message('cant_delete_default_language');
    }
    print_delete_confirmation('language', $vbulletin->GPC['dolanguageid'], 'language', 'kill', 'language', 0, $vbphrase['deleting_this_language_will_delete_custom_phrases']);
}
// ##########################################################################
if ($_POST['do'] == 'insert') {
    $vbulletin->input->clean_array_gpc('p', $langglobals);
    require_once DIR . '/includes/functions_misc.php';
    $vbulletin->GPC['options'] = convert_array_to_bits($vbulletin->GPC['options'], $vbulletin->bf_misc_languageoptions);
    $newlang = array();
    foreach ($langglobals as $key => $val) {
        $newlang["{$key}"] =& $vbulletin->GPC["{$key}"];
    }
    if (empty($newlang['title']) or empty($newlang['charset'])) {
        print_stop_message('please_complete_required_fields');
    }
    // User has defined a locale.
    if ($newlang['locale'] != '') {
Example #22
0
    $vbulletin->input->clean_gpc('p', 'rssfeedid', TYPE_UINT);
    if ($vbulletin->GPC['rssfeedid'] and $feed = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "rssfeed WHERE rssfeedid = " . $vbulletin->GPC['rssfeedid'])) {
        $feeddata =& datamanager_init('RSSFeed', $vbulletin, ERRTYPE_ARRAY);
        $feeddata->set_existing($feed);
        $feeddata->delete();
        define('CP_REDIRECT', 'rssposter.php');
        print_stop_message('deleted_rssfeed_x_successfully', $feeddata->fetch_field('title'));
    } else {
        echo "Kill oops";
    }
}
// #############################################################################
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_gpc('r', 'rssfeedid', TYPE_UINT);
    if ($vbulletin->GPC['rssfeedid'] and $feed = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "rssfeed WHERE rssfeedid = " . $vbulletin->GPC['rssfeedid'])) {
        print_delete_confirmation('rssfeed', $vbulletin->GPC['rssfeedid'], 'rssposter', 'kill');
    } else {
        echo "Delete oops";
    }
}
// #############################################################################
// this array is used by do=preview and do=update
$input_vars = array('rssfeedid' => TYPE_UINT, 'title' => TYPE_NOHTML, 'url' => TYPE_STR, 'ttl' => TYPE_UINT, 'maxresults' => TYPE_UINT, 'titletemplate' => TYPE_STR, 'bodytemplate' => TYPE_STR, 'username' => TYPE_NOHTML, 'forumid' => TYPE_UINT, 'prefixid' => TYPE_NOHTML, 'iconid' => TYPE_UINT, 'searchwords' => TYPE_STR, 'itemtype' => TYPE_STR, 'threadactiondelay' => TYPE_UINT, 'endannouncement' => TYPE_UINT, 'resetlastrun' => TYPE_BOOL, 'options' => TYPE_ARRAY_BOOL);
// #############################################################################
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', $input_vars);
    if (empty($vbulletin->GPC['url'])) {
        print_stop_message('upload_invalid_url');
    }
    if (empty($_POST['preview'])) {
        if ($vbulletin->GPC['rssfeedid']) {
Example #23
0
	{
		window.opener.window.location = window.opener.window.location;
	}

	//-->
	</script>
	<?php 
    print_cp_redirect("template.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&amp;expandset={$template['styleid']}&amp;group=" . $vbulletin->GPC['group'], 1);
}
// #############################################################################
// confirmation for template deletion
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('group' => TYPE_STR));
    $hidden = array();
    $hidden['group'] = $vbulletin->GPC['group'];
    print_delete_confirmation('template', $vbulletin->GPC['templateid'], 'template', 'kill', 'template', $hidden, $vbphrase['please_be_aware_template_is_inherited']);
}
// #############################################################################
// lets the user see the original template
if ($_REQUEST['do'] == 'view') {
    $vbulletin->input->clean_array_gpc('r', array('title' => TYPE_STR));
    $template = $db->query_first("\n\t\tSELECT templateid, styleid, title, template_un\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE styleid = -1 AND title = '" . $db->escape_string($vbulletin->GPC['title']) . "'\n\t");
    print_form_header('', '');
    print_table_header($vbphrase['show_default']);
    print_textarea_row($template['title'], '--[-ORIGINAL-TEMPLATE-]--', $template['template_un'], 20, 80, true, true, 'ltr', 'code');
    print_table_footer();
}
// #############################################################################
// update display order values
if ($_POST['do'] == 'dodisplayorder') {
    $vbulletin->input->clean_array_gpc('p', array('displayorder' => TYPE_ARRAY_INT, 'userselect' => TYPE_ARRAY_INT));
Example #24
0
        construct_hidden_code('page', $vbulletin->GPC['pagenumber']);
        construct_hidden_code('perpage', $vbulletin->GPC['perpage']);
        construct_hidden_code('sourcefieldname', $vbulletin->GPC['fieldname']);
        print_submit_row($vbphrase['save']);
    }
}
// #############################################################################
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT, 'perpage' => TYPE_UINT, 'fieldname' => TYPE_NOHTML));
    //Check if Phrase belongs to Master Language -> only able to delete if $vbulletin->debug=1
    $getvarname = $db->query_first("SELECT varname, fieldname FROM " . TABLE_PREFIX . "phrase WHERE phraseid=" . $vbulletin->GPC['phraseid']);
    $ismasterphrase = $db->query_first("\n\t\tSELECT languageid FROM " . TABLE_PREFIX . "phrase\n\t\tWHERE varname = '" . $getvarname['varname'] . "' AND\n\t\t\tlanguageid = '-1'" . iif($getvarname['fieldname'], " AND\n\t\t\tfieldname = '" . $db->escape_string($getvarname['fieldname']) . "'"));
    if (!$vbulletin->debug and $ismasterphrase) {
        print_stop_message('cant_delete_master_phrase');
    }
    print_delete_confirmation('phrase', $vbulletin->GPC['phraseid'], 'phrase', 'kill', 'phrase', array('sourcefieldname' => $vbulletin->GPC['fieldname'], 'fieldname' => $getvarname['fieldname'], 'pagenumber' => $vbulletin->GPC['pagenumber'], 'perpage' => $vbulletin->GPC['perpage']), $vbphrase['if_you_delete_this_phrase_translations_will_be_deleted']);
}
// #############################################################################
if ($_REQUEST['do'] == 'modify') {
    $vbulletin->input->clean_array_gpc('r', array('fieldname' => TYPE_NOHTML, 'perpage' => TYPE_INT, 'pagenumber' => TYPE_INT, 'showpt' => TYPE_ARRAY_UINT));
    /*if (empty($vbulletin->GPC['showpt']))
    	{
    		$vbulletin->GPC['showpt'] = array('master' => 1, 'custom' => 1);
    	}
    	$checked = array();
    	foreach ($vbulletin->GPC['showpt'] AS $type => $yesno)
    	{
    		$checked["$type$yesno"] = ' checked="checked"';
    	}*/
    $phrasetypes = fetch_phrasetypes_array();
    // make sure $fieldname is valid
Example #25
0
if ($_POST['do'] == 'killset') {
    $vbulletin->input->clean_array_gpc('p', array('prefixsetid' => TYPE_NOHTML));
    $prefixsetdm =& datamanager_init('PrefixSet', $vbulletin, ERRTYPE_CP);
    $prefixset = $db->query_first("\r\n\t\tSELECT *\r\n\t\tFROM " . TABLE_PREFIX . "prefixset\r\n\t\tWHERE prefixsetid = '" . $db->escape_string($vbulletin->GPC['prefixsetid']) . "'\r\n\t");
    if (!$prefixset) {
        print_stop_message('invalid_action_specified');
    }
    $prefixsetdm->set_existing($prefixset);
    $prefixsetdm->delete();
    define('CP_REDIRECT', 'prefix.php?do=list');
    print_stop_message('prefix_set_deleted');
}
// ########################################################################
if ($_REQUEST['do'] == 'deleteset') {
    $vbulletin->input->clean_array_gpc('r', array('prefixsetid' => TYPE_NOHTML));
    print_delete_confirmation('prefixset', $vbulletin->GPC['prefixsetid'], 'prefix', 'killset');
}
// ########################################################################
if ($_POST['do'] == 'insertset') {
    $vbulletin->input->clean_array_gpc('p', array('prefixsetid' => TYPE_NOHTML, 'origprefixsetid' => TYPE_NOHTML, 'title' => TYPE_STR, 'displayorder' => TYPE_UINT, 'forumids' => TYPE_ARRAY_INT));
    $prefixsetdm =& datamanager_init('PrefixSet', $vbulletin, ERRTYPE_CP);
    if ($vbulletin->GPC['origprefixsetid']) {
        $prefixset = $db->query_first("\r\n\t\t\tSELECT *\r\n\t\t\tFROM " . TABLE_PREFIX . "prefixset\r\n\t\t\tWHERE prefixsetid = '" . $db->escape_string($vbulletin->GPC['origprefixsetid']) . "'\r\n\t\t");
        if (!$prefixset) {
            print_stop_message('invalid_action_specified');
        }
        $prefixsetdm->set_existing($prefixset);
    } else {
        $prefixsetdm->set('prefixsetid', $vbulletin->GPC['prefixsetid']);
    }
    $prefixsetdm->set('displayorder', $vbulletin->GPC['displayorder']);
Example #26
0
    $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']);
}
// #############################################################################
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', array('faq' => TYPE_STR, 'faqparent' => TYPE_STR, 'deftitle' => TYPE_STR));
    if ($vbulletin->GPC['deftitle'] == '') {
        print_stop_message('invalid_title_specified');
    }
    if (!preg_match('#^[a-z0-9_]+$#i', $vbulletin->GPC['faq'])) {
        print_stop_message('invalid_faq_varname');
    }
    if ($vbulletin->GPC['faqparent'] == $vbulletin->GPC['faq']) {
        print_stop_message('cant_parent_faq_item_to_self');
    } else {
        $faqarray = array();
        $getfaqs = $db->query_read("SELECT faqname, faqparent FROM " . TABLE_PREFIX . "faq");
    if ($infractioninfo = verify_id('infraction', $vbulletin->GPC['infractionid'], 0, 1)) {
        $infdata =& datamanager_init('Infraction', $vbulletin, ERRTYPE_STANDARD);
        $infdata->set_existing($infractioninfo);
        $infdata->setr_info('postinfo', $postinfo);
        $infdata->setr_info('userinfo', $userinfo);
        $infdata->delete();
        unset($infdata);
    }
    $args = '&status=' . $vbulletin->GPC['status'] . '&u=' . $vbulletin->GPC['userid'] . '&whoadded=' . $vbulletin->GPC['whoadded'] . '&startstamp=' . $vbulletin->GPC['startstamp'] . '&endstamp=' . $vbulletin->GPC['endstamp'] . '&pp=' . $vbulletin->GPC['perpage'] . '&page=' . $vbulletin->GPC['pagenumber'] . '&orderby=' . $vbulletin->GPC['orderby'] . '&infractionlevelid=' . $vbulletin->GPC['infractionlevelid'];
    define('CP_REDIRECT', 'admininfraction.php?do=dolist' . $args);
    print_stop_message('deleted_infraction_successfully');
}
// ###################### Start Delete #######################
if ($_REQUEST['do'] == 'deleteinfraction') {
    $vbulletin->input->clean_array_gpc('r', array('infractionid' => TYPE_UINT, 'pagenumber' => TYPE_UINT, 'orderby' => TYPE_NOHTML, 'perpage' => TYPE_UINT, 'status' => TYPE_NOHTML, 'userid' => TYPE_UINT, 'whoadded' => TYPE_UINT, 'startstamp' => TYPE_UINT, 'endstamp' => TYPE_UINT));
    print_delete_confirmation('infraction', $vbulletin->GPC['infractionid'], 'admininfraction', 'killinfraction', '', array('page' => $vbulletin->GPC['pagenumber'], 'orderby' => $vbulletin->GPC['orderby'], 'pp' => $vbulletin->GPC['perpage'], 'status' => $vbulletin->GPC['status'], 'u' => $vbulletin->GPC['userid'], 'whoadded' => $vbulletin->GPC['whoadded'], 'startstamp' => $vbulletin->GPC['startstamp'], 'endstamp' => $vbulletin->GPC['endstamp'], 'infractionlevelid' => $vbulletin->GPC['infractionlevelid']));
}
// ###################### Start Reversal #######################
if ($_POST['do'] == 'doreverse') {
    $vbulletin->input->clean_array_gpc('r', array('infractionid' => TYPE_UINT, 'reason' => TYPE_STR, 'pagenumber' => TYPE_UINT, 'orderby' => TYPE_NOHTML, 'perpage' => TYPE_UINT, 'status' => TYPE_NOHTML, 'userid' => TYPE_UINT, 'whoadded' => TYPE_UINT, 'startstamp' => TYPE_UINT, 'endstamp' => TYPE_UINT));
    if ($infractioninfo = $db->query_first("\n\t\tSELECT infraction.*\n\t\tFROM " . TABLE_PREFIX . "infraction AS infraction\n\t\tWHERE infractionid = " . $vbulletin->GPC['infractionid'])) {
        if ($infractioninfo['action'] == 2) {
            print_stop_message('infraction_already_reversed');
        }
        $infdata =& datamanager_init('Infraction', $vbulletin, ERRTYPE_STANDARD);
        $infdata->set_existing($infractioninfo);
        $infdata->setr_info('postinfo', $postinfo);
        $infdata->setr_info('userinfo', $userinfo);
        $infdata->set('action', 2);
        $infdata->set('actionuserid', $vbulletin->userinfo['userid']);
        $infdata->set('actiondateline', TIMENOW);
                    $casesql .= "WHEN subscriptionid = {$sub['subscriptionid']} THEN {$displayorder}\n";
                    $subscriptionids .= ",{$sub['subscriptionid']}";
                }
            }
            if (!empty($casesql)) {
                $db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "subscription\n\t\t\t\t\tSET displayorder =\n\t\t\t\t\t\tCASE\n\t\t\t\t\t\t\t{$casesql}\n\t\t\t\t\t\t\tELSE 1\n\t\t\t\t\t\tEND\n\t\t\t\t\tWHERE subscriptionid IN (-1{$subscriptionids})\n\t\t\t\t");
            }
        }
    }
    define('CP_REDIRECT', 'subscriptions.php?do=modify');
    print_stop_message('saved_display_order_successfully');
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'apirem') {
    $vbulletin->input->clean_array_gpc('r', array('paymentapiid' => TYPE_INT));
    print_delete_confirmation('paymentapi', $vbulletin->GPC['paymentapiid'], 'subscriptions', 'apikill', 'paymentapi');
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'apikill') {
    $vbulletin->input->clean_array_gpc('r', array('paymentapiid' => TYPE_INT));
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "paymentapi WHERE paymentapiid = " . $vbulletin->GPC['paymentapiid']);
    toggle_subs();
    define('CP_REDIRECT', 'subscriptions.php?do=api');
    print_stop_message('deleted_paymentapi_successfully');
}
// ###################### Start Api Edit #######################
if ($_REQUEST['do'] == 'apiedit' or $_REQUEST['do'] == 'apiadd') {
    $vbulletin->input->clean_array_gpc('r', array('paymentapiid' => TYPE_INT));
    print_form_header('subscriptions', 'apiupdate');
    if ($_REQUEST['do'] == 'apiadd') {
        print_table_header($vbphrase['add_new_paymentapi']);
    if ($vbulletin->GPC['bookmarksiteid'] and $bookmarksite = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bookmarksite WHERE bookmarksiteid = " . $vbulletin->GPC['bookmarksiteid'])) {
        $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "bookmarksite WHERE bookmarksiteid = " . $vbulletin->GPC['bookmarksiteid']);
        // rebuild the cache
        build_bookmarksite_datastore();
        define('CP_REDIRECT', 'bookmarksite.php' . $vbulletin->session->vars['sessionurl_q']);
        print_stop_message('bookmark_site_deleted_successfully');
    }
    $_REQUEST['do'] = 'modify';
}
// ########################################################################
// delete handler - we want to delete one of the sites
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('bookmarksiteid' => TYPE_UINT));
    if ($vbulletin->GPC['bookmarksiteid'] and $bookmarksite = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bookmarksite WHERE bookmarksiteid = " . $vbulletin->GPC['bookmarksiteid'])) {
        // display the delete confirmation page
        print_delete_confirmation('bookmarksite', $vbulletin->GPC['bookmarksiteid'], 'bookmarksite', 'kill');
    } else {
        $_REQUEST['do'] = 'modify';
    }
}
// ########################################################################
// update handler - we sent the site details form (add new or edit old one)
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', array('bookmarksiteid' => TYPE_UINT, 'title' => TYPE_NOHTML, 'iconpath' => TYPE_STR, 'active' => TYPE_BOOL, 'displayorder' => TYPE_UINT, 'url' => TYPE_STR, 'utf8encode' => TYPE_BOOL));
    $vbulletin->GPC['url'] = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/U', '&amp;', $vbulletin->GPC['url']);
    if (!$vbulletin->GPC['title'] or !$vbulletin->GPC['url']) {
        print_stop_message('please_complete_required_fields');
    }
    if ($vbulletin->GPC['bookmarksiteid'] and $bookmarksite = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bookmarksite WHERE bookmarksiteid = " . $vbulletin->GPC['bookmarksiteid'])) {
        $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "bookmarksite SET\n\t\t\t\ttitle = '" . $db->escape_string($vbulletin->GPC['title']) . "',\n\t\t\t\ticonpath = '" . $db->escape_string($vbulletin->GPC['iconpath']) . "',\n\t\t\t\tactive = " . $vbulletin->GPC['active'] . ",\n\t\t\t\tdisplayorder = " . $vbulletin->GPC['displayorder'] . ",\n\t\t\t\turl = '" . $db->escape_string($vbulletin->GPC['url']) . "',\n\t\t\t\tutf8encode = '" . $db->escape_string($vbulletin->GPC['utf8encode']) . "'\n\t\t\tWHERE bookmarksiteid = " . $vbulletin->GPC['bookmarksiteid']);
    } else {
Example #30
0
    $image = $db->query_first("SELECT imagecategoryid FROM " . TABLE_PREFIX . $vbulletin->GPC['table'] . " WHERE {$itemid} = {$id}");
    $imagecategoryid = $image['imagecategoryid'];
    $db->query_write("DELETE FROM " . TABLE_PREFIX . $vbulletin->GPC['table'] . " WHERE {$itemid} = {$id}");
    if ($vbulletin->GPC['avatarid']) {
        @unlink(DIR . "/images/avatars/thumbs/{$vbulletin->GPC['avatarid']}.gif");
    }
    build_image_cache($vbulletin->GPC['table']);
    build_image_permissions($vbulletin->GPC['table']);
    define('CP_REDIRECT', "image.php?do=viewimages" . "&table=" . $vbulletin->GPC['table'] . "&amp;page=" . $vbulletin->GPC['page'] . "&amp;pp=" . $vbulletin->GPC['perpage'] . ($vbulletin->GPC['imagecategoryid'] ? "&amp;imagecategoryid=" . $vbulletin->GPC['imagecategoryid'] : ''));
    print_stop_message("deleted_{$itemtype}_successfully");
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'remove') {
    $vbulletin->input->clean_array_gpc('r', array('id' => TYPE_INT, 'page' => TYPE_INT, 'perpage' => TYPE_INT, 'imagecategoryid' => TYPE_UINT));
    $hidden = array('table' => $vbulletin->GPC['table'], 'page' => $vbulletin->GPC['page'], 'perpage' => $vbulletin->GPC['perpage'], 'imagecategoryid' => $vbulletin->GPC['imagecategoryid']);
    print_delete_confirmation($vbulletin->GPC['table'], $vbulletin->GPC['id'], 'image', 'kill', $itemtype, $hidden);
}
// ###################### Start Do Insert Multiple #######################
if ($_POST['do'] == 'doinsertmultiple') {
    $vbulletin->input->clean_array_gpc('p', array('page' => TYPE_INT, 'perpage' => TYPE_INT, 'imagespath' => TYPE_STR, 'doinsertmultiple' => TYPE_STR, 'ititle' => TYPE_ARRAY_STR, 'icat' => TYPE_ARRAY_STR, 'ismilietext' => TYPE_ARRAY_STR, 'iminimumposts' => TYPE_ARRAY_STR, 'doimage' => TYPE_NOCLEAN));
    if (empty($vbulletin->GPC['doinsertmultiple'])) {
        // just go back to the interface if a page button was pressed, rather than the actual submit button
        $_REQUEST['do'] = 'insertmultiple';
    } else {
        if (!is_array($vbulletin->GPC['doimage'])) {
            // return error if no images checked for insertion
            print_stop_message("no_{$itemtypeplural}_selected");
        } else {
            echo "<ul>\n";
            $duplicates = array();
            if ($vbulletin->GPC['table'] == 'smilie') {