Пример #1
0
}
//I'm not sure how much we need this, but the old branch logic checks some
//actions against REQUEST and some against POST. This should maintain
//equivilent behavior (error instead of explicit fallthrough;
$post_only_actions = array('taginsert', 'tagclear', 'tagkill', 'tagmerge', 'tagdomerge');
if (in_array($action, $post_only_actions) and empty($_POST['do'])) {
    exit;
}
$dispatch = array('taginsert' => 'taginsert', 'tagclear' => 'tagclear', 'tagmerge' => 'tagmerge', 'tagdomerge' => 'tagdomerge', 'tagdopromote' => 'tagdopromote', 'tagkill' => 'tagkill', 'tags' => 'displaytags', 'modify' => 'displaytags');
if (array_key_exists($action, $dispatch)) {
    print_cp_header($vbphrase['tag_manager']);
    tagcp_init_tag_action();
    call_user_func($dispatch["{$action}"]);
    print_cp_footer();
} else {
    print_cp_message(construct_phrase($vbphrase['action_x_not_defined'], $action));
}
// ########################################################################
// some utility function for the actions
function tagcp_init_tag_action()
{
    global $vbulletin;
    $vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT, 'sort' => TYPE_NOHTML));
    define('CP_REDIRECT', 'tag.php?do=tags&page=' . $vbulletin->GPC['pagenumber'] . '&sort=' . $vbulletin->GPC['sort']);
}
function tagcp_fetch_tag_list()
{
    global $vbulletin;
    $vbulletin->input->clean_array_gpc('p', array('tag' => TYPE_ARRAY_KEYS_INT));
    $vbulletin->input->clean_array_gpc('c', array('vbulletin_inlinetag' => TYPE_STR));
    $taglist = $vbulletin->GPC['tag'];
Пример #2
0
	</div>
	</div>
	</div>
	<?php 
    // this is a small hack to prevent the shutdown function from causing database errors
    $vbulletin->db->shutdownqueries = array();
    $vbulletin->session = null;
}
// #############################################################################
if ($_POST['do'] == 'confirm') {
    $vbulletin->input->clean_array_gpc('p', array('newprefix' => TYPE_STR, 'rename' => TYPE_ARRAY));
    if (array_sum($vbulletin->GPC['rename']) == 0) {
        print_stop_message('sorry_no_tables_were_submitted_to_be_renamed');
    } else {
        if ($vbulletin->GPC['newprefix'] == TABLE_PREFIX) {
            print_cp_message(construct_phrase($vbphrase['new_prefix_same_as_old'], TABLE_PREFIX, $vbulletin->GPC['newprefix']));
        }
        $prefixlength = strlen(TABLE_PREFIX);
        $dorename = array();
        $warn = array();
        $dotables = '';
        $warntables = '';
        print_form_header('tableprefix', 'rename');
        print_table_header(construct_phrase($vbphrase['confirm_prefix_change_x_to_y'], TABLE_PREFIX, $vbulletin->GPC['newprefix']));
        construct_hidden_code('newprefix', $vbulletin->GPC['newprefix']);
        foreach ($vbulletin->GPC['rename'] as $table => $yesno) {
            if ($yesno) {
                construct_hidden_code("rename[{$table}]", 1);
                $dorename[] = $table;
                $tablename = fetch_renamed_table_name($table, TABLE_PREFIX, $vbulletin->GPC['newprefix'], true);
                $dotables .= "<tr class=\"alt2\"><td class=\"smallfont\">{$tablename['old']}</td><td class=\"smallfont\">{$tablename['new']}</td></tr>";
Пример #3
0
	private function moveCategory()
	{
		//Here's the approach
		//
		// verify and set the new values;
		// call fixCategoryLR()

		global $vbulletin;
		//First let's make sure that we actually need to do a move. Pull the current values
		//from the database
		if (!$record = $vbulletin->db->query_first("SELECT parentnode, parentcat, catleft, catright FROM "
			. TABLE_PREFIX . "cms_category where categoryid = " . $vbulletin->GPC['categoryid']))
		{
			print_cp_message($vbphrase['invalid_data_submitted']);
			return false;
		}

		$fromleft = intval($record['catleft']);
		$fromright = intval($record['catright']);
		$space = $fromright - $fromleft + 1 ;

		//See what we need to change. Check categoryid first, because if we have one
		// we'll use that in preference to the sectionid.
		if (intval($vbulletin->GPC['target_categoryid'] > 0)
				and intval($vbulletin->GPC['target_categoryid']) != intval($record['parentcat']))
		{
			$newparentcat = intval($vbulletin->GPC['target_categoryid']);
			if (! $newparent = $vbulletin->db->query_first("SELECT parentnode, parentcat, catleft, catright FROM "
			. TABLE_PREFIX . "cms_category where categoryid = $newparentcat" ))
			{
				print_cp_message($vbphrase['invalid_data_submitted']);
				return false;
			}

			//Check to make sure we aren't trying to move a parent to it's own child. That would
			// cause an explosion.
			if (intval($newparent['catleft']) > intval($record['catleft'])
					and intval($newparent['catleft']) < intval($record['catright']) )
			{
				return false;
			}
			$newparentnode = $newparent['parentnode'];
		}
		else if (intval($vbulletin->GPC['sectionid'])
				and intval($vbulletin->GPC['sectionid']) != intval($record['parentnode']))
		{
			$newparentnode = intval($vbulletin->GPC['sectionid']);
			$newparentcat = 'NULL' ;

		}
		else if (-1 == $vbulletin->GPC['target_categoryid'])
		{
			if ($vbulletin->GPC_exists['sectionid'] AND intval($vbulletin->GPC['sectionid']) > 0)
			{
				$newparentnode = $vbulletin->GPC['sectionid'];

			}
			else
			{
				$newparentnode = $record['parentnode'];
			}
			$newparentcat = 'NULL' ;
		}

		if (!isset($newparentcat) AND ! isset($newparentnode))
		{
			//nothing to change
			return true;
		}
		//If we got here, we have valid data and we're ready to move.

		//If we have a new parentnode, let's set it.
		$sql = "UPDATE ". TABLE_PREFIX . "cms_category SET parentnode = $newparentnode, parentcat = $newparentcat
					WHERE categoryid = " . $vbulletin->GPC['categoryid'];
		$vbulletin->db->query_write($sql);
		self::fixCategoryLR();

	}
Пример #4
0
             }
             $text .= $chunk_text;
         }
     }
     return $text;
 }
 $vbulletin->input->clean_array_gpc('r', array('group' => vB_Cleaner::TYPE_STR, 'searchstring' => vB_Cleaner::TYPE_STR, 'expandset' => vB_Cleaner::TYPE_STR, 'showmerge' => vB_Cleaner::TYPE_BOOL));
 $template = vB::getDbAssertor()->getRow('fetchTemplateWithStyle', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_STORED, 'templateid' => $vbulletin->GPC['templateid']));
 if ($template['styleid'] == -1) {
     $template['style'] = $vbphrase['master_style'];
 }
 if ($vbulletin->GPC['showmerge']) {
     try {
         $text = edit_get_merged_text($vbulletin->GPC['templateid']);
     } catch (Exception $e) {
         print_cp_message($e->getMessage());
     }
     print_table_start();
     print_description_row(construct_phrase($vbphrase['edting_merged_version_view_highlighted'], "template.php?do=docompare3&amp;templateid={$template['templateid']}"));
     print_table_footer();
 } else {
     if ($template['mergestatus'] == 'conflicted') {
         print_table_start();
         print_description_row(construct_phrase($vbphrase['default_version_newer_merging_failed'], "template.php?do=docompare3&amp;templateid={$template['templateid']}", $vbulletin->scriptpath . '&amp;showmerge=1'));
         print_table_footer();
     } else {
         if ($template['mergestatus'] == 'merged') {
             $merge_info = vB::getDbAssertor()->getRow('templatemerge', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'templateid' => $template[templateid]));
             print_table_start();
             print_description_row(construct_phrase($vbphrase['changes_made_default_merged_customized'], "template.php?do=docompare3&amp;templateid={$template['templateid']}", "template.php?do=viewversion&amp;id={$merge_info['savedtemplateid']}&amp;type=historical"));
             print_table_footer();
Пример #5
0
    */
}
// #############################################################################
// rebuilds all parent lists and id cache lists
if ($_REQUEST['do'] == 'rebuild') {
    $vbulletin->input->clean_array_gpc('r', array('renumber' => TYPE_INT, 'install' => TYPE_INT));
    echo "<p>&nbsp;</p>";
    build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], "template.php?" . $vbulletin->session->vars['sessionurl']);
}
// #############################################################################
// create template files
if ($_REQUEST['do'] == 'createfiles' and $vbulletin->debug) {
    // this action requires that a web-server writable folder called
    // 'template_dump' exists in the root of the vbulletin directory
    if (is_demo_mode()) {
        print_cp_message('This function is disabled within demo mode');
    }
    if (function_exists('set_time_limit') and !SAFEMODE) {
        @set_time_limit(1200);
    }
    chdir(DIR . '/template_dump');
    $templates = $db->query_read("\n\t\tSELECT title, templatetype, username, dateline, template_un AS template\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE styleid = " . $vbulletin->GPC['dostyleid'] . "\n\t\t\tAND templatetype = 'template'\n\t\t\t" . iif($vbulletin->GPC['mode'] == 1, "AND templateid IN({$templateids})") . "\n\t\tORDER BY title\n\t");
    echo "<ol>\n";
    while ($template = $db->fetch_array($templates)) {
        echo "<li><b class=\"col-c\">{$template['title']}</b>: Parsing... ";
        $text = str_replace("\r\n", "\n", $template['template']);
        $text = str_replace("\n", "\r\n", $text);
        echo 'Writing... ';
        $fp = fopen("./{$template['title']}.htm", 'w+');
        fwrite($fp, $text);
        fclose($fp);
Пример #6
0
 /**
  * Shows an error message and halts execution - use this in the same way as print_stop_message();
  *
  * @param	string	Phrase name for error message
  */
 function error($errorphrase)
 {
     $args = func_get_args();
     if (is_array($errorphrase)) {
         $error = fetch_error($errorphrase);
     } else {
         $error = call_user_func_array('fetch_error', $args);
     }
     $this->errors[] = $error;
     if ($this->failure_callback and is_callable($this->failure_callback)) {
         call_user_func_array($this->failure_callback, array(&$this, $errorphrase));
     }
     switch ($this->error_handler) {
         case ERRTYPE_ARRAY:
         case ERRTYPE_SILENT:
             // do nothing
             break;
         case ERRTYPE_STANDARD:
             eval(standard_error($error));
             break;
         case ERRTYPE_CP:
             print_cp_message($error);
             break;
     }
 }
Пример #7
0
        print_form_header('socialgroups', '');
        print_table_header($vbphrase['deleting_groups']);
        $groups = $vbulletin->db->query_read("\n\t\t\tSELECT * FROM " . TABLE_PREFIX . "socialgroup\n\t\t\tWHERE groupid IN (" . implode(',', $ids) . ")\n\t\t");
        if ($vbulletin->db->num_rows($groups) == 0) {
            print_description_row($vbphrase['no_groups_found']);
        }
        while ($group = $vbulletin->db->fetch_array($groups)) {
            $socialgroupdm = datamanager_init('SocialGroup', $vbulletin);
            print_description_row(construct_phrase($vbphrase['deleting_x'], $group['name']));
            $socialgroupdm->set_existing($group);
            $socialgroupdm->delete();
            unset($socialgroupdm);
        }
    } else {
        // This should never happen without playing with the URLs
        print_cp_message($vbphrase['no_groups_selected_or_invalid_input']);
    }
    print_table_footer();
    print_cp_redirect('socialgroups.php', 5);
}
// #######################################################################
if ($_POST['do'] == 'updatecategory') {
    $vbulletin->input->clean_array_gpc('p', array('socialgroupcategoryid' => TYPE_UINT, 'title' => TYPE_STR, 'description' => TYPE_STR));
    $sgcatdata = datamanager_init('SocialGroupCategory', $vbulletin);
    if ($vbulletin->GPC['socialgroupcategoryid'] and $category = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "socialgroupcategory WHERE socialgroupcategoryid = " . $vbulletin->GPC['socialgroupcategoryid'])) {
        // update
        $sgcatdata->set_existing($category);
    } else {
        if ($vbulletin->GPC['socialgroupcategoryid']) {
            // error
            print_stop_message('invalid_social_group_category_specified');
Пример #8
0
// ############## ADD/EDIT GROUP SETTINGS ################################
if ($do == 'set_group_settings') {
    $vbulletin->input->clean_array_gpc('r', array('group_name' => TYPE_STR, 'is_active' => TYPE_INT, 'map_id' => TYPE_INT));
    $nntp_group->set_group_id($vbulletin->GPC['group_id']);
    $nntp_group->set_group_name($vbulletin->GPC['group_name']);
    $nntp_group->set_plugin_id($vbulletin->GPC['plugin']);
    $nntp_group->set_is_active($vbulletin->GPC['is_active']);
    $nntp_group->set_map_id($vbulletin->GPC['map_id']);
    if ($vbulletin->GPC['group_id']) {
        define('CP_REDIRECT', $this_script . '.php' . '?do=group_settings' . '&group_id=' . $vbulletin->GPC['group_id'] . '&plugin=' . $vbulletin->GPC['plugin']);
    } else {
        define('CP_REDIRECT', $this_script . '.php' . '?do=group_settings' . '&plugin=' . $vbulletin->GPC['plugin']);
    }
    // save settings
    if ($nntp_group->save_group()) {
        print_cp_message($vbphrase['saved_nntp_group_settings_successfully'], $this_script . '.php?do=list');
    } else {
        print_stop_message('saved_nntp_group_settings_defeated', $vbulletin->GPC['group_name']);
    }
}
// ############## ADD/EDIT GROUP SETTINGS FORM ###########################
if ($do == 'group_settings') {
    // check for existing plugin
    if (!array_key_exists($vbulletin->GPC['plugin'], $plugins)) {
        define('CP_REDIRECT', $this_script . '.php?do=list');
        print_stop_message('invalid_nntp_plugin_specified');
    }
    // load existing group
    $group_id = $vbulletin->GPC['group_id'];
    $nntp_group->get_group($group_id);
    print_form_header($this_script, 'set_group_settings');
Пример #9
0
                vBCms_ContentManager::updateCategories();
                echo vBCms_ContentManager::showNodes($per_page, 'category');
                print_cp_footer();
            } else {
                if ($vbulletin->GPC_exists['sentfrom'] and $vbulletin->GPC['sentfrom'] == 'nodes') {
                    print_cp_header($vbphrase['content_manager']);
                    vBCms_ContentManager::updateSections();
                    echo vBCms_ContentManager::showNodes($per_page);
                    print_cp_footer();
                }
            }
        }
    case 'fix_nodes':
        print_cp_header($vbphrase['vbcms']);
        echo vBCms_ContentManager::fixNodeLR();
        print_cp_message($vbphrase['nodetable_repaired']);
        print_cp_footer();
        break;
    case 'list':
        //This is our default action. We need to display a list of items.
    //This is our default action. We need to display a list of items.
    default:
        $vbulletin->input->clean_array_gpc('r', array('sortby' => TYPE_STR, 'sortdir' => TYPE_STR, 'title_filter' => TYPE_STR, 'submit' => TYPE_STR, 'state_filter' => TYPE_INT, 'author_filter' => TYPE_UINT, 'filter_section' => TYPE_UINT, 'contenttypeid' => TYPE_INT));
        print_cp_header($vbphrase['content_manager']);
        echo vBCms_ContentManager::showNodes($per_page);
        print_cp_footer();
        break;
}
/*======================================================================*\
  || ####################################################################
  || # Downloaded: 03:13, Sat Sep 7th 2013
Пример #10
0
    } catch (Exception $e) {
        print_cp_message('Something wrong when saving block: ' . $e->getMessage());
        exit;
    }
    print_cp_message($vbphrase['block_saved'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify");
}
// #############################################################################
if ($_REQUEST['do'] == 'deleteblock') {
    $vbulletin->input->clean_array_gpc('r', array('blockid' => TYPE_INT));
    print_delete_confirmation('block', $vbulletin->GPC['blockid'], 'block', 'killblock', 'block', array('blockid' => $vbulletin->GPC['blockid']));
}
// #############################################################################
if ($_REQUEST['do'] == 'killblock') {
    $vbulletin->input->clean_array_gpc('r', array('blockid' => TYPE_INT));
    $blockmanager->deleteBlock($vbulletin->GPC['blockid']);
    print_cp_message($vbphrase['block_deleted'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify");
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => TYPE_ARRAY));
    if (is_array($vbulletin->GPC['order'])) {
        $blocks = $blockmanager->getBlocks(false);
        foreach ($blocks as $block) {
            if (!isset($vbulletin->GPC['order']["{$block['blockid']}"])) {
                continue;
            }
            $displayorder = intval($vbulletin->GPC['order']["{$block['blockid']}"]);
            if ($block['displayorder'] != $displayorder) {
                $blockmanager->updateBlockOrder($block['blockid'], $displayorder);
            }
        }
Пример #11
0
    print_input_row('[New] Per Reply Value', 'perreply', -1);
    print_input_row('[New] Per Char Value', 'perchar', -1);
    print_submit_row("Reset Policy", 0);
    print_table_footer();
    print_cp_footer();
}
if ($_GET['do'] == "do_resetpolicy") {
    $processed = true;
    $vbulletin->input->clean_array_gpc('p', array('forum' => TYPE_ARRAY_UINT, 'perthread' => TYPE_INT, 'perreply' => TYPE_INT, 'perchar' => TYPE_INT));
    $forumids =& $vbulletin->GPC['forum'];
    if (count($forumids) > 0) {
        $vbulletin->db->query("\n\t\t\tUPDATE `" . TABLE_PREFIX . "forum`\n\t\t\tSET \n\t\t\t\tkbank_perthread = {$vbulletin->GPC['perthread']}\n\t\t\t\t,kbank_perreply = {$vbulletin->GPC['perreply']}\n\t\t\t\t,kbank_perchar = {$vbulletin->GPC['perchar']}\n\t\t\tWHERE forumid IN (" . implode(',', $forumids) . ")\n\t\t");
        build_forum_permissions();
        print_cp_message('Reset Forums Point Policy Operation Completed!', 'kbankadmin.php?do=policy_man');
    } else {
        print_cp_message('You haven\'t selected any forum to Reset Forums Point Policy');
    }
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
// ###################### Do Donate To All Members ########################
if ($_POST['do'] == "do_donate_all") {
    $processed = true;
    $vbulletin->input->clean_array_gpc('p', array('amount' => TYPE_INT, 'usergroup' => TYPE_STR));
    print_cp_header("Donate To Members");
    if ($vbulletin->GPC['amount'] == 0) {
        print_stop_message('kbank_sendmsomthing');
    }
    if ($vbulletin->GPC['usergroup'] != "All") {
        if (!$db->query_first("SELECT * FROM " . TABLE_PREFIX . "usergroup where usergroupid='" . $vbulletin->GPC['usergroup'] . "'")) {
// Clear the login log.
if (!empty($vbulletin->GPC['do'])) {
    // Confirm the purge.
    if ($vbulletin->GPC['do'] == "purge") {
        print_table_start();
        print_table_header('Login Log');
        print_form_header('loginlog', 'purgenow');
        print_description_row('Are you sure you want to purge the login log? This action can not be reverted.');
        print_submit_row('Purge Log');
        print_table_footer();
        exit;
        // This actually truncates the table.
    } elseif ($vbulletin->GPC['do'] == "purgenow") {
        print_cp_header('Clear Login Log');
        $vbulletin->db->execute_query("TRUNCATE TABLE " . TABLE_PREFIX . "loginlog");
        print_cp_message('The login log has been purged.', 'loginlog.php');
        exit;
    }
}
// Filter table
print_table_start();
print_table_header('Login Log Filter');
print_form_header('loginlog', '', false, true, 'cpform', '90%', '', true, 'get', 0, false, '');
print_input_select_row('Search', 'value', isset($vbulletin->GPC['value']) ? htmlentities($vbulletin->GPC['value'], ENT_QUOTES) : '', 'type', array(0 => 'Username', 1 => 'UserID', 2 => 'Loginstamp', 3 => 'IP', 4 => 'ISP', 5 => 'Country', 6 => 'User Agent'), isset($vbulletin->GPC['type']) ? $vbulletin->GPC['type'] : '');
print_submit_row('Filter');
print_table_footer();
// Pagination table
print_table_start();
print_description_row('<a href="loginlog.php?page=' . (isset($vbulletin->GPC['page']) && $vbulletin->GPC['page'] > 0 ? $vbulletin->GPC['page'] - 1 : 0) . (isset($vbulletin->GPC['type']) && isset($vbulletin->GPC['value']) ? '&type=' . $vbulletin->GPC['type'] . '&value=' . $vbulletin->GPC['value'] : '') . '">Previous Page</a> - <a href="loginlog.php?page=' . (isset($vbulletin->GPC['page']) && $vbulletin->GPC['page'] != 0 ? $vbulletin->GPC['page'] + 1 : 1) . (isset($vbulletin->GPC['type']) && isset($vbulletin->GPC['value']) ? '&type=' . $vbulletin->GPC['type'] . '&value=' . $vbulletin->GPC['value'] : '') . '">Next Page</a> - Currently on page: ' . (isset($vbulletin->GPC['page']) ? htmlentities($vbulletin->GPC['page'], ENT_QUOTES) : 0));
print_table_footer();
// Output table
Пример #13
0
function print_stop_message2($phrase, $file = NULL, $extra = array(), $backurl = NULL, $continue = false, $redirect_route = 'admincp')
{
    //handle phrase as a string
    if (!is_array($phrase)) {
        $phrase = array($phrase);
    }
    $phraseAux = vB_Api::instanceInternal('phrase')->fetch(array($phrase[0]));
    if (isset($phraseAux[$phrase[0]])) {
        $message = $phraseAux[$phrase[0]];
    } else {
        $message = $phrase[0];
        // phrase doesn't exist or wasn't found, display the varname
    }
    if (sizeof($phrase) > 1) {
        $phrase[0] = $message;
        $message = call_user_func_array('construct_phrase', $phrase);
    }
    //todo -- figure out where this is needed and remove.
    global $vbulletin;
    if ($vbulletin->GPC['ajax']) {
        require_once DIR . '/includes/class_xml.php';
        $xml = new vB_XML_Builder_Ajax('text/xml');
        $xml->add_tag('error', $message);
        $xml->print_xml();
    }
    //todo -- figure out where this is needed and remove.
    if (VB_AREA == 'Upgrade') {
        echo $message;
        exit;
    }
    $hash = '';
    if ($file) {
        if (!empty($extra['#'])) {
            $hash = '#' . $extra['#'];
            unset($extra['#']);
        }
        $redirect = get_redirect_url($file, $extra, $redirect_route);
    }
    print_cp_message($message, $redirect . $hash, 1, $backurl, $continue);
}
Пример #14
0
                    break;
                case 'padding':
                    $allowedlist = $allowedpaddings;
                    break;
            }
            if (isset($allowedlist)) {
                if (!in_array($value, $allowedlist) and $value != '') {
                    $usercss->invalid["{$selectorname}"]["{$property}"] = ' usercsserror ';
                    continue;
                }
            }
            $usercss->parse($selectorname, $property, $value);
        }
    }
    if (!empty($usercss->error)) {
        print_cp_message(implode("<br />", $usercss->error));
    } else {
        if (!empty($usercss->invalid)) {
            print_stop_message2('invalid_values_customize_profile');
        }
    }
    $usercss->save();
    print_stop_message2('saved_profile_customizations_successfully', 'user', array('do' => 'edit', 'u' => $userinfo['userid']));
}
// ########################################################################
if ($_REQUEST['do'] == 'usercss') {
    require_once DIR . '/includes/adminfunctions_template.php';
    ?>
	<script type="text/javascript" src="<?php 
    echo $vbulletin->options['bburl'];
    ?>
Пример #15
0
         print_cp_message($vbphrase['hqthffs_item_exist'], 'hqth_ffs.php?' . $vbulletin->session->vars['sessionurl'] . 'do=' . $_REQUEST['do']);
     } else {
         print_form_header('hqth_ffs', $_REQUEST['do']);
         print_table_header($vbphrase['edit'] . ' ' . $vbphrase['hqthffs_' . $_REQUEST['do']], 0);
         construct_hidden_code('act', 'update');
         construct_hidden_code('actionid', $_REQUEST['id']);
         print_input_row($vbphrase['hqthffs_actionname'], 'actionname', $checkexits['actionname']);
         print_input_row($vbphrase['hqthffs_actiondelay'], 'actiondelay', $checkexits['actiondelay']);
         print_input_row($vbphrase['hqthffs_moneymaster'], 'money_master', $checkexits['money_pet']);
         print_input_row($vbphrase['hqthffs_moneypet'], 'money_pet', $checkexits['money_master']);
         print_submit_row();
         print_table_footer();
     }
 } elseif ($_REQUEST['act'] == "del") {
     $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "hqth_ffs_action WHERE actioncat='" . $_REQUEST['do'] . "' AND actionid=" . $_REQUEST['id']);
     print_cp_message($vbphrase['hqthffs_item_del_success'], 'hqth_ffs.php?' . $vbulletin->session->vars['sessionurl'] . 'do=' . $_REQUEST['do']);
 } else {
     $catlist = $db->query_read("SELECT *\n\t\t\t\t\t   FROM " . TABLE_PREFIX . "hqth_ffs_action\n\t\t\t\t\t   WHERE actioncat='" . $_REQUEST['do'] . "'\n\t\t\t\t\t   ORDER BY actionname");
     print_form_header();
     print_table_header($vbphrase['hqthffs_' . $_REQUEST['do']], 5);
     $header = array();
     $header[] = $vbphrase['hqthffs_actionname'];
     $header[] = $vbphrase['hqthffs_actiondelay'];
     $header[] = $vbphrase['hqthffs_moneymaster'];
     $header[] = $vbphrase['hqthffs_moneypet'];
     $header[] = $vbphrase['option'];
     print_cells_row($header, 1, 0, 1);
     $cell = array();
     while ($last = $db->fetch_array($catlist)) {
         $cell[] = $last['actionname'];
         $cell[] = $last['actiondelay'];
Пример #16
0
            }
            print_submit_row('Back', '');
        } else {
            print_cp_message('Campaign ID must be greater than zero!', 'qhvbmailer.php?do=manage_campaigns', 2);
        }
    } elseif ($_GET['act'] == 3) {
        $vbulletin->input->clean_array_gpc('g', array('campaign_id' => TYPE_UINT));
        if ($vbulletin->GPC['campaign_id'] > 0) {
            $db->query_write("DELETE FROM " . TABLE_PREFIX . "qhvbmailer_campaigns WHERE id='" . $vbulletin->GPC['campaign_id'] . "'");
            print_cp_message('Campaign deleted!', 'qhvbmailer.php?do=manage_campaigns', 1);
        } else {
            print_cp_message('Campaign ID must be greater than zero!', 'qhvbmailer.php?do=manage_campaigns', 2);
        }
    }
} else {
    print_cp_message("Invalid page: " . $_GET['do']);
}
echo "<br><center>Copyright <a href=\"http://www.blogtorank.com/\" target=\"_blank\">BlogToRank</a> 2007. All rights reserved.</center>";
/*
Please do not remove this Copyright notice.
As you see this is a free script accordingly under GPL laws and you will see
a license attached accordingly to GNU.
You may NOT rewrite another hack and release it to the vBulletin.org community
or another website using this code without our permission, So do NOT try to release a hack using any part of our code without written permission from us!
Copyright 2007, BlogToRank.com
QH vbMailer v2.1
December 2, 2007
*/
/*======================================================================*\
|| #################################################################### ||
|| # Copyright QH  vbMailer, www.BlogToRank.com, All rights Reserved! # ||
Пример #17
0
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
log_admin_action();
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'chooser';
}
$vbulletin->input->clean_array_gpc('r', array('perpage' => TYPE_UINT, 'startat' => TYPE_UINT));
// ###################### Start clear cache ########################
if ($_REQUEST['do'] == 'clear_cache') {
    print_cp_header($vbphrase['clear_system_cache']);
    vB_Cache::instance()->clean(false);
    print_cp_message($vbphrase['cache_cleared']);
} else {
    print_cp_header($vbphrase['maintenance']);
}
// ###################### Clear Autosave option #######################
if ($_REQUEST['do'] == 'clearauto') {
    print_form_header('misc', 'doclearauto');
    print_table_header($vbphrase['clear_autosave_title']);
    print_description_row($vbphrase['clear_autosave_desc']);
    print_input_row($vbphrase['clear_autosave_limit'], 'cleandays', 21);
    print_submit_row($vbphrase['clear_autosave_run']);
}
if ($_POST['do'] == 'rebuildactivity') {
    vB_ActivityStream_Manage::rebuild();
    vB_ActivityStream_Manage::updateScores();
    print_stop_message('rebuild_activity_stream_done');
Пример #18
0
/**
* Halts execution and shows a message based upon a parsed phrase
*
* After the first parameter, this function can take any number of additional
* parameters, in order to replace {1}, {2}, {3},... {n} variable place holders
* within the given phrase text. The parsed phrase is then passed to print_cp_message()
*
* Note that a redirect can be performed if CP_REDIRECT is defined with a URL
*
* @param	string	Name of phrase (from the Error phrase group)
* @param	string	1st variable replacement {1}
* @param	string	2nd variable replacement {2}
* @param	string	Nth variable replacement {n}
*/
function print_stop_message($phrasename)
{
    global $vbulletin, $vbphrase;
    if (!function_exists('fetch_phrase')) {
        require_once DIR . '/includes/functions_misc.php';
    }
    $message = fetch_phrase($phrasename, 'error', '', false);
    $args = func_get_args();
    if (sizeof($args) > 1) {
        $args[0] = $message;
        $message = call_user_func_array('construct_phrase', $args);
    }
    if (defined('CP_CONTINUE')) {
        define('CP_REDIRECT', CP_CONTINUE);
    }
    print_cp_message($message, defined('CP_REDIRECT') ? CP_REDIRECT : NULL, 1, defined('CP_BACKURL') ? CP_BACKURL : NULL, defined('CP_CONTINUE') ? true : false);
}
Пример #19
0
/**
* Halts execution and shows a message based upon a parsed phrase
*
* After the first parameter, this function can take any number of additional
* parameters, in order to replace {1}, {2}, {3},... {n} variable place holders
* within the given phrase text. The parsed phrase is then passed to print_cp_message()
*
* Note that a redirect can be performed if CP_REDIRECT is defined with a URL
*
* @param	string	Name of phrase (from the Error phrase group)
* @param	string	1st variable replacement {1}
* @param	string	2nd variable replacement {2}
* @param	string	Nth variable replacement {n}
*/
function print_stop_message($phrasename)
{
    global $vbulletin, $vbphrase;
    if (!function_exists('fetch_phrase')) {
        require_once DIR . '/includes/functions_misc.php';
    }
    $message = fetch_phrase($phrasename, 'error', '', false);
    $args = func_get_args();
    if (sizeof($args) > 1) {
        $args[0] = $message;
        $message = call_user_func_array('construct_phrase', $args);
    }
    if (defined('CP_CONTINUE')) {
        define('CP_REDIRECT', CP_CONTINUE);
    }
    if ($vbulletin->GPC['ajax']) {
        require_once DIR . '/includes/class_xml.php';
        $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
        $xml->add_tag('error', $message);
        $xml->print_xml();
    }
    if (VB_AREA == 'Upgrade') {
        echo $message;
        exit;
    }
    print_cp_message($message, defined('CP_REDIRECT') ? CP_REDIRECT : NULL, 1, defined('CP_BACKURL') ? CP_BACKURL : NULL, defined('CP_CONTINUE') ? true : false);
}
Пример #20
0
print_cp_header($vbphrase['thread_prefix_manager']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'list';
}
// notes on phrases:
// prefixset_ID_title (prefixes), prefix_ID_title_plain (global), prefix_ID_title_rich (global)
// ########################################################################
if ($_REQUEST['do'] == 'duplicate') {
    $prefixes = array();
    $prefixes_result = $vbulletin->db->query_read("\r\n\t\tSELECT prefix.prefixid, prefixset.prefixsetid\r\n\t\tFROM " . TABLE_PREFIX . "prefix AS prefix\r\n\t\tINNER JOIN " . TABLE_PREFIX . "prefixset AS prefixset ON (prefix.prefixsetid = prefixset.prefixsetid)\r\n\t\tORDER BY prefixset.displayorder ASC, prefix.displayorder ASC\r\n\t");
    while ($prefix = $vbulletin->db->fetch_array($prefixes_result)) {
        $prefixsetphrase = htmlspecialchars_uni($vbphrase["prefixset_{$prefix[prefixsetid]}_title"]);
        $prefixes["{$prefixsetphrase}"]["{$prefix['prefixid']}"] = htmlspecialchars_uni($vbphrase["prefix_{$prefix[prefixid]}_title_plain"]);
    }
    if (empty($prefixes)) {
        print_cp_message($vbphrase['no_prefix_sets_defined_click_create']);
    }
    print_form_header('prefix', 'doduplicate');
    print_table_header($vbphrase['thread_prefixes'], 2);
    print_select_row($vbphrase['copy_permissions_from'], 'from', $prefixes);
    print_select_row($vbphrase['copy_permissions_to'], 'copyto[]', $prefixes, '', false, 10, true);
    print_yes_no_row($vbphrase['overwrite_customized_permissions_no_restrictions'], 'overwrite', 0);
    print_submit_row();
}
// ########################################################################
if ($_POST['do'] == 'doduplicate') {
    $vbulletin->input->clean_array_gpc('p', array('from' => TYPE_STR, 'copyto' => TYPE_ARRAY_STR, 'overwrite' => TYPE_BOOL));
    $from_prefixid = $vbulletin->GPC['from'];
    if (empty($vbulletin->GPC['copyto']) or count($vbulletin->GPC['copyto']) == 1 and reset($vbulletin->GPC['copyto']) == $from_prefixid) {
        print_stop_message('did_not_select_any_valid_prefixes_to_copy_to');
    }
Пример #21
0
     // update phrase text contents for master language
     if ($vbulletin->GPC['orig']['text'] != $vbulletin->GPC['text']) {
         $q[] = "\n\t\t\t### UPDATE HELP TEXT CONTENTS PHRASES FOR MASTER LANGUAGE ###\n\t\t\tREPLACE INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t(text, fieldname, languageid, varname, product, username, dateline, version)\n\t\t\tVALUES\n\t\t\t\t('" . $db->escape_string($vbulletin->GPC['text']) . "',\n\t\t\t\t'cphelptext',\n\t\t\t\t{$languageid},\n\t\t\t\t'{$newphrasename}_text',\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t" . TIMENOW . ",\n\t\t\t\t'" . $db->escape_string($product_version) . "')\n\t\t\t";
     } else {
         if ($vbulletin->GPC['orig']['product'] != $vbulletin->GPC['help']['product']) {
             // haven't changed the text, but we changed the product,
             // so we need to reflect that
             $q[] = "\n\t\t\t\tUPDATE " . TABLE_PREFIX . "phrase SET\n\t\t\t\t\tproduct = '" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t\tusername = '******'username']) . "',\n\t\t\t\t\tdateline = " . TIMENOW . ",\n\t\t\t\t\tversion = '" . $db->escape_string($product_version) . "'\n\t\t\t\tWHERE fieldname = 'cphelptext'\n\t\t\t\t\tAND varname = '{$newphrasename}_text'\n\t\t\t";
         }
     }
 } else {
     $sql = "\n\t\tSELECT * FROM " . TABLE_PREFIX . "adminhelp\n\t\tWHERE script = '" . $db->escape_string($vbulletin->GPC['help']['script']) . "'\n\t\t\tAND action = '" . $db->escape_string($vbulletin->GPC['help']['action']) . "'\n\t\t\tAND optionname = '" . $db->escape_string($vbulletin->GPC['help']['optionname']) . "'";
     if ($check = $db->query_first($sql)) {
         // error message, this already exists
         // why phrase when its only available in debug mode and its meant for us?
         print_cp_message('This help item already exists.');
     }
     unset($sql);
     // insert help item
     $q[] = fetch_query_sql($vbulletin->GPC['help'], 'adminhelp');
     // 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);
Пример #22
0
 /**
  * Shows an error message and halts execution - use this in the same way as print_stop_message();
  *
  * @param	string	Phrase name for error message
  */
 function error($errorphrase)
 {
     //if we are passed a array then assume that it is the phrase plus arguments
     if (is_array($errorphrase)) {
         $args = $errorphrase;
     } else {
         $args = func_get_args();
     }
     //if we aren't processing the error, just save the phrase id and args raw
     if ($this->error_handler == vB_DataManager_Constants::ERRTYPE_ARRAY_UNPROCESSED) {
         $error = $args;
     } else {
         if ($this->error_handler == vB_DataManager_Constants::ERRTYPE_UPGRADE) {
             $error = $args;
         } else {
             //otherwise fetch the error message
             $error = fetch_error($args);
         }
     }
     $this->errors[] = $error;
     if ($this->failure_callback and is_callable($this->failure_callback)) {
         call_user_func_array($this->failure_callback, array(&$this, $errorphrase));
     }
     switch ($this->error_handler) {
         case vB_DataManager_Constants::ERRTYPE_ARRAY:
         case vB_DataManager_Constants::ERRTYPE_SILENT:
         case vB_DataManager_Constants::ERRTYPE_ARRAY_UNPROCESSED:
         case vB_DataManager_Constants::ERRTYPE_UPGRADE:
             // do nothing -- either we are ignoring errors or manually checking the error array at intervals.
             break;
         case vB_DataManager_Constants::ERRTYPE_STANDARD:
             throw new Exception($error);
             break;
         case vB_DataManager_Constants::ERRTYPE_CP:
             print_cp_message($error);
             break;
     }
 }
Пример #23
0
     $itemname = $_GET['itemname'];
     $itemimg = $_GET['itemimg'];
     $itemdes = $db->escape_string($_GET['itemdes']);
     $itemclass = $_GET['itemclass'];
     $itemlevel = $_GET['itemlevel'];
     $itemhp = $_GET['itemhp'];
     $itematt = $_GET['itematt'];
     $itemdef = $_GET['itemdef'];
     $itemcri = $_GET['itemcri'];
     $itemluck = $_GET['itemluck'];
     $itemgp = $_GET['itemgp'];
     $itemspecial = $_GET['itemspecial'];
     $itemtype = $_GET['itemtype'];
     $itemshop = $_GET['itemshop'];
     $vbulletin->db->query_write("INSERT INTO\r\n\t\t\t" . TABLE_PREFIX . "rpg_item\r\n\t\t\t\t(`image`,\r\n\t\t\t\t`name`,\r\n\t\t\t\t`mieuta`,\r\n\t\t\t\t`class`,\r\n\t\t\t\t`level`,\r\n\t\t\t\t`hp`,\r\n\t\t\t\t`att`,\r\n\t\t\t\t`def`,\r\n\t\t\t\t`cri`,\r\n\t\t\t\t`luck`,\r\n\t\t\t\t`gold`,\r\n\t\t\t\t`special`,\r\n\t\t\t\t`type`,\r\n\t\t\t\t`active`)\r\n\t\t\tVALUES\r\n\t\t\t\t('{$itemimg}',\r\n\t\t\t\t'{$itemname}',\r\n\t\t\t\t\"{$itemdes}\",\r\n\t\t\t\t'{$itemclass}',\r\n\t\t\t\t'{$itemlevel}',\r\n\t\t\t\t'{$itemhp}',\r\n\t\t\t\t'{$itematt}',\r\n\t\t\t\t'{$itemdef}',\r\n\t\t\t\t'{$itemcri}',\r\n\t\t\t\t'{$itemluck}',\r\n\t\t\t\t'{$itemgp}',\r\n\t\t\t\t'{$itemspecial}',\r\n\t\t\t\t'{$itemtype}',\r\n\t\t\t\t'{$itemshop}')\r\n\t\t");
     print_cp_message('<b><center>DONE<br> <br>REFRESHING ...</center></b>', 'rpgpet_item.php', 2);
 }
 print_cp_header("RPG ADD ITEM");
 echo "<form name='settings' action='rpgpet_add.php?add=item' method='GET'>";
 print_table_start();
 print_table_header("ADD NEW item");
 print_input_row('Name', 'itemname');
 print_input_row('Image', 'itemimg', '', 0, 60);
 print_textarea_row('Description', 'itemdes', '', 3, 60);
 print_select_row('Class', 'itemclass', array('0' => 'NOT', '1' => $rpgpetlang['rpg1'], '2' => $rpgpetlang['rpg2'], '3' => $rpgpetlang['rpg3'], '4' => $rpgpetlang['rpg4'], '5' => $rpgpetlang['rpg5']));
 print_input_row('Level', 'itemlevel', 0, 0, 5);
 print_input_row('HP', 'itemhp', 0, 0, 5);
 print_input_row('Attack', 'itematt', 0, 0, 5);
 print_input_row('Defense', 'itemdef', 0, 0, 5);
 print_input_row('Critical', 'itemcri', 0, 0, 5);
 print_input_row('Luck', 'itemluck', 0, 0, 5);