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