0) { if ($accid > 0) { $new_points = $points; $old_points = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$accid';"), 0, 'points'); $new_points += $old_points; $update_account = mysql_query("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='$accid'"); $errors[] = 'Success! Character '. $char .' has recieved '. $points .' premium points.'; } else $errors[] = 'Account id is invalid. (Did you write correct character name?)'. $accid; } else $errors[] = 'Why the heck give a character 0 points?!'; }*/ // Give points to character if (empty($_POST['points_char']) === false && empty($_POST['points_value']) === false) { $char = sanitize($_POST['points_char']); $points = (int)$_POST['points_value']; data_dump($_POST, false, "post data"); $account = mysql_select_single("SELECT `account_id` FROM `players` WHERE `name`='$char' LIMIT 1;"); data_dump($account, false, "fetching account id from players table"); $znote_account = mysql_select_single("SELECT `id`, `points` FROM `znote_accounts` WHERE `account_id`='". $account['account_id'] ."';"); data_dump($znote_account, false, "Fetching existing points from znote_accounts"); data_dump( array( 'Old:' => $znote_account['points'], 'New:' => $points, 'Total:' => ($znote_account['points'] + $points) ), false, "Points calculation:"); $points += $znote_account['points']; mysql_update("UPDATE `znote_accounts` SET `points`='$points' WHERE `account_id`='". $account['account_id'] ."';"); } // Set character position if (empty($_POST['position_name']) === false && empty($_POST['position_type']) === false) { if (user_character_exist($_POST['position_name'])) { if (array_key_exists($_POST['position_type'], $config['ingame_positions'])) { if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') { set_ingame_position($_POST['position_name'], $_POST['position_type']); } else if ($config['TFSVersion'] == 'TFS_03') { set_ingame_position03($_POST['position_name'], $_POST['position_type']); } $pos = 'Undefined'; foreach ($config['ingame_positions'] as $key=>$value) { if ($key == $_POST['position_type']) { $pos = $value; } } $errors[] = 'Character '. $_POST['position_name'] .' recieved the ingame position: '. $pos .'.'; } } else { $errors[] = 'Character '. $_POST['position_name'] .' does not exist.'; } } // If empty post } // Display whatever output we figure out to add if (empty($errors) === false){ echo ''; echo output_errors($errors); echo ''; } // end ?>

Admin Page.

"; echo "Last cached on: ". getClock($basic['cached'], true) .".
"; ?>