本文整理汇总了PHP中valid_request函数的典型用法代码示例。如果您正苦于以下问题:PHP valid_request函数的具体用法?PHP valid_request怎么用?PHP valid_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了valid_request函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: update
function update()
{
global $db;
foreach ($this->options as $opt) {
if ($this->title == 'Fonts' || $this->title == 'General') {
$optval = $_POST[$opt->name];
$search_pattern = array('/script/i', '/;/', '/%/');
$replace_pattern = array('', '', '');
$optval = preg_replace($search_pattern, $replace_pattern, $optval);
} else {
$optval = valid_request($_POST[$opt->name], 0);
}
$result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tvalue\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_Options\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tkeyname='{$opt->name}'\r\n\t\t\t\t");
if ($db->num_rows($result) == 1) {
$result = $db->query("\r\n\t\t\t\t\t\tUPDATE\r\n\t\t\t\t\t\t\thlstats_Options\r\n\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\tvalue='{$optval}'\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tkeyname='{$opt->name}'\r\n\t\t\t\t\t");
} else {
$result = $db->query("\r\n\t\t\t\t\t\tINSERT INTO\r\n\t\t\t\t\t\t\thlstats_Options\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\tkeyname,\r\n\t\t\t\t\t\t\t\tvalue\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t'{$opt->name}',\r\n\t\t\t\t\t\t\t'{$optval}'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t");
}
}
}
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:20,代码来源:options.php
示例2: complete_login
function complete_login()
{
if (valid_request(array(isset($_POST['login']), isset($_POST['password'])))) {
global $db;
global $smarty;
//getting the name parts
if (!preg_match('/^[a-zA-Z\\x80-\\xFF]+\\.{1}[a-zA-Z\\x80-\\xFF]+$/', $_POST['login'])) {
$smarty->assign('message', 'Ihr Login musst das Format \'Vorname.Nachname\' haben (z.B. Hans.Meier).');
$smarty->display('login.tpl');
return true;
}
$point_pos = strpos($_POST['login'], ".");
$first_name = substr($_POST['login'], 0, $point_pos);
$last_name = substr($_POST['login'], $point_pos + 1);
//see if we hit the right firstname.lastname - password pair
$sql = "get_customer_login_data('" . $first_name . "', '" . $last_name . "', '" . $_POST['password'] . "')";
$db->run($sql);
if (!$db->empty_result) {
//store the user informations for further actions
$row = $db->get_result_row();
$_SESSION['customer_id'] = $row['customer_id'];
$_SESSION['form_of_address'] = $row['form_of_address'];
$_SESSION['first_name'] = $first_name;
$_SESSION['last_name'] = $last_name;
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {
if (php_sapi_name() == 'cgi') {
header('Status: 303 See Other ');
} else {
header('HTTP/1.1 303 See Other ');
}
header('Location: index.php?site=jobs');
}
} else {
$smarty->assign('message', 'Ihr Login und ihr Passwort passen nicht zusammen.');
$smarty->display('login.tpl');
return true;
}
}
return true;
}
开发者ID:soi,项目名称:int_repair,代码行数:40,代码来源:complete_functions.php
示例3: Table
function Table($columns, $keycol, $sort_default, $sort_default2, $showranking = false, $numperpage = 50, $var_page = 'page', $var_sort = 'sort', $var_sortorder = 'sortorder', $sorthash = '', $sort_default_order = 'desc', $ajax = false)
{
global $g_options;
$this->columns = $columns;
$this->keycol = $keycol;
$this->showranking = $showranking;
$this->numperpage = $numperpage;
$this->var_page = $var_page;
$this->var_sort = $var_sort;
$this->var_sortorder = $var_sortorder;
$this->sorthash = $sorthash;
$this->sort_default_order = $sort_default_order;
$this->ajax = $g_options['playerinfo_tabs'] ? $ajax : false;
$this->page = valid_request(intval($_GET[$var_page]), 1);
$this->sort = valid_request($_GET[$var_sort], 0);
$this->sortorder = valid_request($_GET[$var_sortorder], 0);
if ($this->page < 1) {
$this->page = 1;
}
$this->startitem = ($this->page - 1) * $this->numperpage;
foreach ($columns as $col) {
if ($col->sort != 'no') {
$this->columnlist[] = $col->name;
}
}
if (!is_array($this->columnlist) || !in_array($this->sort, $this->columnlist)) {
$this->sort = $sort_default;
}
if ($this->sortorder != 'asc' && $this->sortorder != 'desc') {
$this->sortorder = $this->sort_default_order;
}
if ($this->sort == $sort_default2) {
$this->sort2 = $sort_default;
} else {
$this->sort2 = $sort_default2;
}
}
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:37,代码来源:class_table.php
示例4: die
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Action Statistics
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$db->query("SELECT name FROM hlstats_Games WHERE code='{$game}'");
if ($db->num_rows() < 1) {
error("No such game '{$game}'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
$tblPlayerActions = new Table(array(new TableColumn('description', 'Action', 'width=45&link=' . urlencode("mode=actioninfo&action=%k&game={$game}")), new TableColumn('obj_count', 'Achieved', 'width=25&align=right&append=+times'), new TableColumn('obj_bonus', 'Skill Bonus', 'width=25&align=right')), 'code', 'obj_count', 'description', true, 9999, 'obj_page', 'obj_sort', 'obj_sortorder');
$db->query("\n\t\tSELECT\n\t\t\tSUM(count)\n\t\tFROM\n\t\t\thlstats_Actions\n\t\tWHERE\n\t\t\thlstats_Actions.game='{$game}'\n\t");
list($totalactions) = $db->fetch_row();
$result = $db->query("\n\t\tSELECT\n\t\t\tcode,\n\t\t\tdescription,\n\t\t\tcount AS obj_count,\n\t\t\treward_player AS obj_bonus\n\t\tFROM\n\t\t\thlstats_Actions\n\t\tWHERE\n\t\t\thlstats_Actions.game='{$game}'\n\t\t\tAND count > 0\n\t\tGROUP BY\n\t\t\thlstats_Actions.id\n\t\tORDER BY\n\t\t\t{$tblPlayerActions->sort} {$tblPlayerActions->sortorder},\n\t\t\t{$tblPlayerActions->sort2} {$tblPlayerActions->sortorder}\n\t");
?>
<?php
$tblPlayerActions->draw($result, $db->num_rows($result), 100);
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:actions.php
示例5: update
function update()
{
global $db;
$setstrings = array();
foreach ($this->propertygroups as $group) {
foreach ($group->properties as $prop) {
if ($prop->name == 'name') {
$value = $_POST[$prop->name];
$search_pattern = array('/script/i', '/;/', '/%/');
$replace_pattern = array('', '', '');
$value = preg_replace($search_pattern, $replace_pattern, $value);
$setstrings[] = $prop->name . "='" . $value . "'";
} else {
$setstrings[] = $prop->name . "='" . valid_request($_POST[$prop->name], 0) . "'";
}
}
}
$db->query("\r\n\t\t\t\tUPDATE\r\n\t\t\t\t\t" . $this->table . "\r\n\t\t\t\tSET\r\n\t\t\t\t\t" . implode(",\n", $setstrings) . "\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t" . $this->keycol . "='" . mysql_real_escape_string($this->keyval) . "'\r\n\t\t\t");
}
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:19,代码来源:admin.php
示例6: error
require INCLUDE_PATH . '/pChart/pData.class';
require INCLUDE_PATH . '/pChart/pChart.class';
$db_classname = 'DB_' . DB_TYPE;
if (class_exists($db_classname)) {
$db = new $db_classname(DB_ADDR, DB_USER, DB_PASS, DB_NAME, DB_PCONNECT);
} else {
error('Database class does not exist. Please check your config.php file for DB_TYPE');
}
$g_options = getOptions();
$bg_color = array('red' => 90, 'green' => 90, 'blue' => 90);
if (isset($_GET['bgcolor']) && is_string($_GET['bgcolor'])) {
$bg_color = hex2rgb(valid_request($_GET['bgcolor'], 0));
}
$color = array('red' => 213, 'green' => 217, 'blue' => 221);
if (isset($_GET['color']) && is_string($_GET['color'])) {
$color = hex2rgb(valid_request($_GET['color'], 0));
}
if (isset($_GET['player'])) {
$player = (int) $_GET['player'];
}
if (!$player) {
exit;
}
$res = $db->query("SELECT UNIX_TIMESTAMP(eventTime) AS ts, skill, skill_change FROM hlstats_Players_History WHERE playerId = '{$player}' ORDER BY eventTime DESC LIMIT 30");
$skill = array();
$skill_change = array();
$date = array();
$rowcnt = $db->num_rows();
$last_time = 0;
for ($i = 1; $i <= $rowcnt; $i++) {
$row = $db->fetch_array($res);
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:trend_graph.php
示例7: die
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Clan Details
$clan = valid_request(intval($_GET['clan']), 1) or error('No clan ID specified.');
$db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Clans.tag,\r\n\t\t\thlstats_Clans.name,\r\n\t\t\thlstats_Clans.homepage,\r\n\t\t\thlstats_Clans.game,\r\n\t\t\tSUM(hlstats_Players.kills) AS kills,\r\n\t\t\tSUM(hlstats_Players.deaths) AS deaths,\r\n\t\t\tSUM(hlstats_Players.connection_time) AS connection_time,\r\n\t\t\tCOUNT(hlstats_Players.playerId) AS nummembers,\r\n\t\t\tROUND(AVG(hlstats_Players.skill)) AS avgskill,\r\n\t\t\tTRUNCATE(AVG(activity),2) as activity\r\n\t\tFROM\r\n\t\t\thlstats_Clans\r\n\t\tLEFT JOIN hlstats_Players ON\r\n\t\t\thlstats_Players.clan = hlstats_Clans.clanId\r\n\t\tWHERE\r\n\t\t\thlstats_Clans.clanId={$clan}\r\n\t\t\tAND hlstats_Players.hideranking = 0\r\n\t\tGROUP BY\r\n\t\t\thlstats_Clans.clanId\r\n\t");
if ($db->num_rows() != 1) {
error("No such clan '{$clan}'.");
}
$clandata = $db->fetch_array();
$db->free_result();
$cl_name = preg_replace(' ', ' ', htmlspecialchars($clandata['name']));
$cl_tag = preg_replace(' ', ' ', htmlspecialchars($clandata['tag']));
$cl_full = "{$cl_tag} {$cl_name}";
$game = $clandata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='{$game}'");
if ($db->num_rows() != 1) {
$gamename = ucfirst($game);
} else {
list($gamename) = $db->fetch_row();
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:claninfo.php
示例8: die
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Global Server Chat History
$showserver = 0;
if (isset($_GET['server_id'])) {
$showserver = valid_request(strval($_GET['server_id']), true);
}
if ($showserver == 0) {
$whereclause = "hlstats_Servers.game='{$game}'";
} else {
$whereclause = "hlstats_Servers.game='{$game}' AND hlstats_Events_Chat.serverId={$showserver}";
}
$db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Games.name\r\n\t\tFROM\r\n\t\t\thlstats_Games\r\n\t\tWHERE\r\n\t\t\thlstats_Games.code = '{$game}'\r\n\t");
if ($db->num_rows() < 1) {
error("No such game '{$game}'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader(array($gamename, 'Server Chat Statistics'), array($gamename => "%s?game={$game}", 'Server Chat Statistics' => ''));
flush();
$servername = "(All Servers)";
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:chat.php
示例9: json_decode
*/
$payload = $_POST["data"];
$request = json_decode($payload, True);
if (json_last_error() !== JSON_ERROR_NONE) {
http_response_code(400);
trigger_json_response(400, "Bad Request");
die;
}
/*
* As is good practice, never trust that the input
* supplied by the user is valid - we must verify it
* ourselves. If the provided JSON encoding is invalid,
* return a Bad Request error and status code.
*
*/
if (!valid_request($request)) {
http_response_code(400);
trigger_json_response(400, "Bad Request");
die;
}
/*
* Once the request has been determined to be valid, we
* can handle the request and return a JSON encoding of
* the rendered automata diagram.
*
*/
$message = handle_render_request($request);
/*
* Just to be safe, we encode the response JSON message
* and verify that no errors occurred during its encoding.
*
开发者ID:PatrickMurray,项目名称:AutomataFiddle,代码行数:31,代码来源:index.php
示例10: valid_request
}
$show_map_wins = '1';
if (isset($_GET['show_map_wins']) && is_numeric($_GET['show_map_wins'])) {
$show_map_wins = valid_request($_GET['show_map_wins'], 1);
}
$top_players = '10';
if (isset($_GET['top_players']) && is_numeric($_GET['top_players'])) {
$top_players = valid_request($_GET['top_players'], 1);
}
$players_images = '1';
if (isset($_GET['players_images']) && is_numeric($_GET['players_images'])) {
$players_images = valid_request($_GET['players_images'], 1);
}
$show_password = '';
if (isset($_GET['show_password']) && is_string($_GET['show_password'])) {
$show_password = valid_request($_GET['show_password'], 1);
}
//// Entries
$result = $db->query("\r\n\tSELECT\r\n\t\tIF(publicaddress != '', publicaddress, concat(address, ':', port)) AS addr,\r\n\t\tname, \r\n\t\tpublicaddress, \r\n\t\tact_map, \r\n\t\tplayers, \r\n\t\tkills, \r\n\t\theadshots, \r\n\t\tmap_started, \r\n\t\tact_players, \r\n\t\tmax_players, \r\n\t\tmap_ct_wins, \r\n\t\tmap_ts_wins\r\n\tFROM \r\n\t\thlstats_Servers\r\n\tWHERE \r\n\t\tserverId={$server_id}");
$server_data = $db->fetch_array($result);
if ($small_fonts == 1) {
$fsize = 'fSmall';
} else {
$fsize = 'fNormal';
}
if ($server_data['addr'] != '') {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
echo '<html>';
echo '<head>';
echo '<title>' . $g_options["sitename"] . '</title>';
echo '<style type="text/css">{margin:0px;padding:0px;}</style>';
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:status.php
示例11: Copyright
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
global $game;
// Search
require PAGE_PATH . '/search-class.php';
pageHeader(array('Search'), array('Search' => ''));
$sr_query = $_GET['q'];
$sr_type = valid_request(strval($_GET['st']), 0) or 'player';
$sr_game = valid_request(strval(isset($_GET['game']) ? $_GET['game'] : $game), 0);
$search = new Search($sr_query, $sr_type, $sr_game);
$search->drawForm(array('mode' => 'search'));
if ($sr_query || $sr_query == '0') {
$search->drawResults();
}
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:search.php
示例12: die
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Map Details
$map = valid_request($_GET['map'], 0) or error('No map specified.');
$db->query("SELECT name FROM hlstats_Games WHERE code='{$game}'");
if ($db->num_rows() != 1) {
error('Invalid or no game specified.');
} else {
list($gamename) = $db->fetch_row();
}
$table = new Table(array(new TableColumn('killerName', 'Player', 'width=60&align=left&flag=1&link=' . urlencode('mode=statsme&player=%k')), new TableColumn('frags', 'Kills on $map', 'width=15&align=right'), new TableColumn('headshots', 'Headshots', 'width=15&align=right'), new TableColumn('hpk', 'Hpk', 'width=5&align=right')), 'killerId', 'frags', 'killerName', true, 50);
$result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Events_Frags.killerId,\n\t\t\thlstats_Players.lastName AS killerName,\n\t\t\thlstats_Players.flag as flag,\n\t\t\tCOUNT(hlstats_Events_Frags.map) AS frags,\n\t\t\tSUM(hlstats_Events_Frags.headshot=1) as headshots,\n\t\t\tIFNULL(SUM(hlstats_Events_Frags.headshot=1) / Count(hlstats_Events_Frags.map), '-') AS hpk\n\t\tFROM\n\t\t\thlstats_Events_Frags,\n\t\t\thlstats_Players\t\t\n\t\tWHERE\n\t\t\thlstats_Players.playerId = hlstats_Events_Frags.killerId\n\t\t\tAND hlstats_Events_Frags.map='{$map}'\n\t\t\tAND hlstats_Players.game='{$game}'\n\t\t\tAND hlstats_Players.hideranking<>'1'\n\t\tGROUP BY\n\t\t\thlstats_Events_Frags.killerId\n\t\tORDER BY\n\t\t\t{$table->sort} {$table->sortorder},\n\t\t\t{$table->sort2} {$table->sortorder}\n\t\tLIMIT {$table->startitem},{$table->numperpage}\n\t");
$resultCount = $db->query("\n\t\tSELECT\n\t\t\tCOUNT(DISTINCT hlstats_Events_Frags.killerId),\n\t\t\tSUM(hlstats_Events_Frags.map='{$map}')\n\t\tFROM\n\t\t\thlstats_Events_Frags,\n\t\t\thlstats_Servers\n\t\tWHERE\n\t\t\thlstats_Servers.serverId = hlstats_Events_Frags.serverId\n\t\t\tAND hlstats_Events_Frags.map='{$map}'\n\t\t\tAND hlstats_Servers.game='{$game}'\n\t");
list($numitems, $totalkills) = $db->fetch_row($resultCount);
?>
<?php
$table->draw($result, $numitems, 100, 'center');
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:mapinfo.php
示例13: die
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Player Chat History
$player = valid_request(intval($_GET['player']), 1) or error('No player ID specified.');
$db->query("\r\n\t\tSELECT\r\n\t\t\tunhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,\r\n\t\t\thlstats_Players.game\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\thlstats_Players.playerId = {$player}\r\n\t");
if ($db->num_rows() != 1) {
error("No such player '{$player}'.");
}
$playerdata = $db->fetch_array();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10) {
$pl_shortname = substr($pl_name, 0, 8) . '...';
} else {
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$game = $playerdata['game'];
$db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Games.name\r\n\t\tFROM\r\n\t\t\thlstats_Games\r\n\t\tWHERE\r\n\t\t\thlstats_Games.code = '{$game}'\r\n\t");
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:chathistory.php
示例14: die
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
if ($auth->userdata["acclevel"] < 80) {
die("Access denied!");
}
$id = -1;
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$id = valid_request($_GET['id'], 1);
}
?>
<img src="<?php
echo IMAGE_PATH;
?>
/downarrow.gif" width="9" height="6" class="imageformat" alt="" /><b> <a href="<?php
echo $g_options['scripturl'];
?>
?mode=admin&task=tools_editdetails">Edit Player or Clan Details</a></b><br />
<img src="<?php
echo IMAGE_PATH;
?>
/spacer.gif" width="1" height="8" border="0" alt=""><br />
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:30,代码来源:tools_editdetails_player.php
示例15: die
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Contents
$resultGames = $db->query("\r\n\t\tSELECT\r\n\t\t\tcode,\r\n\t\t\tname\r\n\t\tFROM\r\n\t\t\thlstats_Games\r\n\t\tWHERE\r\n\t\t\thidden='0'\r\n\t\tORDER BY\r\n\t\t\trealgame, name ASC\r\n\t");
$num_games = $db->num_rows($resultGames);
$redirect_to_game = 0;
if ($num_games == 1 || ($game = valid_request($_GET['game'], 0))) {
$redirect_to_game++;
if ($num_games == 1) {
list($game) = $db->fetch_row($resultGames);
}
include PAGE_PATH . '/game.php';
} else {
unset($_SESSION['game']);
pageHeader(array('Contents'), array('Contents' => ''));
include PAGE_PATH . '/voicecomm_serverlist.php';
printSectionTitle('Games');
?>
<div class="subblock">
<table class="data-table">
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:contents.php
示例16: check_writable
$game2 = '';
if (isset($_POST['game2'])) {
if ($_POST['game2'] != '') {
$game2 = $_POST['game2'];
}
}
$game2name = '';
if (isset($_POST['game2name'])) {
if ($_POST['game2name'] != '') {
$game2name = $_POST['game2name'];
}
}
echo '<ul><br />';
check_writable();
$game2 = valid_request($game2, 0);
$game2name = valid_request($game2name, 0);
echo '<li>hlstats_Games ...';
$db->query("SELECT code FROM hlstats_Games WHERE code='{$game2}' LIMIT 1;");
if ($db->num_rows() != 0) {
echo '</ul><br /><br /><br />';
echo '<b>Target gametype exists, nothing done!</b><br /><br />';
} else {
$db->query("INSERT INTO hlstats_Games (code,name,hidden,realgame) SELECT '{$game2}', '{$game2name}', '0', realgame FROM hlstats_Games WHERE code='{$game1}'");
echo 'OK</li>';
$dbtables = array();
array_push($dbtables, 'hlstats_Actions', 'hlstats_Awards', 'hlstats_Ribbons', 'hlstats_Ranks', 'hlstats_Roles', 'hlstats_Teams', 'hlstats_Weapons');
foreach ($dbtables as $dbt) {
echo "<li>{$dbt} ... ";
echo copySettings($dbt, $game1, $game2);
}
echo '</ul><br /><br /><br />';
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:tools_settings_copy.php
示例17: define
<?php
define('IN_HLSTATS', true);
// Load required files
require 'config.php';
require INCLUDE_PATH . '/class_db.php';
require INCLUDE_PATH . '/functions.php';
$db_classname = 'DB_' . DB_TYPE;
if (class_exists($db_classname)) {
$db = new $db_classname(DB_ADDR, DB_USER, DB_PASS, DB_NAME, DB_PCONNECT);
} else {
error('Database class does not exist. Please check your config.php file for DB_TYPE');
}
$game = valid_request($_GET['game']);
$search = valid_request($_POST['value']);
$game_escaped = $db->escape($game);
$search_escaped = $db->escape($search);
if (is_string($search) && strlen($search) >= 3 && strlen($search) < 64) {
// Building the query
$sql = "SELECT hlstats_PlayerNames.name FROM hlstats_PlayerNames INNER JOIN hlstats_Players ON hlstats_PlayerNames.playerId = hlstats_Players.playerId WHERE game = '{$game_escaped}' AND name LIKE '{$search_escaped}%'";
$result = $db->query($sql);
while ($row = $db->fetch_row($result)) {
print "<li class=\"playersearch\">" . $row[0] . "</li>\n";
}
}
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:25,代码来源:autocomplete.php
示例18: die
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
die('Do not access this file directly.');
}
// Ribbon Statistics
$ribbon = valid_request($_GET['ribbon'], true) or error('No ribbon ID specified.');
$db->query("\r\n\t\tSELECT\r\n\t\t\tribbonName,\r\n\t\t\timage,\r\n\t\t\tawardCode,\r\n\t\t\tawardCount\r\n\t\tFROM\r\n\t\t\thlstats_Ribbons\r\n\t\tWHERE\r\n\t\t\thlstats_Ribbons.ribbonId={$ribbon}\r\n\t");
$actiondata = $db->fetch_array();
$db->free_result();
$act_name = $actiondata['ribbonName'];
$awardmin = $actiondata['awardCount'];
$awardcode = $actiondata['awardCode'];
$image = $actiondata['image'];
$db->query("SELECT name FROM hlstats_Games WHERE code='{$game}'");
if ($db->num_rows() < 1) {
error("No such game '{$game}'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader(array($gamename, 'Ribbon Details', $act_name), array($gamename => $g_options['scripturl'] . "?game={$game}", 'Ribbons' => $g_options['scripturl'] . "mode=awards&game={$game}&tab=ribbons", 'Ribbon Details' => ''), $act_name);
$table = new Table(array(new TableColumn('playerName', 'Player', 'width=45&align=left&flag=1&link=' . urlencode('mode=playerinfo&player=%k')), new TableColumn('numawards', 'Daily awards', 'width=10&align=right&append=' . urlencode(' times')), new TableColumn('awardName', '', 'width=40&align=left')), 'playerId', 'numawards', 'playerName', true, 50);
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:ribboninfo.php
示例19: complete_upload_match_media
/**
* Checks a registration request for invalid inputs
*
* @access public
* @return true
*/
function complete_upload_match_media()
{
if (valid_request(array(isset($_GET['match_id']), isset($_FILES['match_media']), isset($_POST['description'])))) {
require CLASS_PATH . 'class.upload.php';
global $db;
global $smarty;
if (strlen($_POST['description']) < 2 || strlen($_POST['description']) > 20) {
display_errors(751);
return true;
}
$upload = new Upload($_FILES['match_media']);
if ($upload->uploaded) {
//getting the internal file name out of the current time
$name = microtime();
$name = substr($name, 2, 8) . substr($name, 11);
$upload->file_new_name_body = $name;
$upload->allowed = array('application/zip', 'image/*');
$upload->process(MATCH_MEDIA_PATH);
if ($upload->processed) {
$sql = "add_match_media(" . $_GET['match_id'] . ",\n " . $_SESSION['user_id'] . ",\n '" . $_POST['description'] . "',\n '" . $upload->file_dst_name . "', \n " . filesize($upload->file_dst_pathname) . ")";
$db->run($sql);
if ($db->error_result) {
display_errors(750);
} else {
display_success("upload_match_media");
$smarty->assign('content', $smarty->fetch("succes.tpl"));
}
} else {
display_errors(750);
}
$upload->clean();
} else {
display_errors(750);
return true;
}
}
return true;
}
开发者ID:soi,项目名称:paul,代码行数:44,代码来源:complete_functions.php
示例20: display_cash_print
function display_cash_print()
{
if (valid_request(array(isset($_GET['date_start']), isset($_GET['date_limit'])))) {
global $smarty;
assign_cash_print($_GET['date_start'], $_GET['date_limit']);
assign_cash_print_info($_GET['date_start'], $_GET['date_limit']);
}
return true;
}
开发者ID:soi,项目名称:int_repair,代码行数:9,代码来源:display_functions.php
注:本文中的valid_request函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论