Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
titles.func.php
Go to the documentation of this file.
1 <?php
2 
3 if(!defined('IN_GAME')) {
4  exit('Access Denied');
5 }
6 //反正应该不会重复获得头衔……偷懒
7 //还是会重复的 反正没什么工作量
8 function get_title($t,$n){
9  global $gamecfg,$name,$db,$tablepre;
10  require config("gamecfg",$gamecfg);
11  $result = $db->query("SELECT nicks FROM {$tablepre}users WHERE username = '$n'");
12  $k = $db->result($result, 0);
13  if (strpos($k,$t)===false){
14  $cf = GAME_ROOT.'./gamedata/clearlog.php';
15  $d = "$n".','."$t\n";
16  writeover($cf,$d,'ab+');
17  $k=$k.'/'.$t;
18  }
19  $db->query("UPDATE {$tablepre}users SET nicks='$k' WHERE username='".$n."'" );
20 }
21 ?>
$tablepre
Definition: config.inc.php:58
writeover($filename, $data, $method="rb+", $iflock=1, $check=1, $chmod=1)
$gamecfg
Definition: system.php:22
$n
Definition: rank.php:51
$db
Definition: clear.php:32
const GAME_ROOT
Definition: clear.php:6
$k
Definition: stat.php:7
config($file= '', $cfg=1)
if(!defined('IN_GAME')) get_title($t, $n)
Definition: titles.func.php:8
if(!$cuser||!$cpass) $result
Definition: admin.php:25