• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with Namelock

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
My namelock system works fine, but I have some problems to make the character name change history for site purposes...

When I namelock someone, it records in MySQL table: `bans`

It should record also at `player_namelocks`

Bans table structure:

313rmdg.jpg


And player_namelocks:

player_id
name
new_name
date


I want to do this to work with this script:
http://otland.net/f295/php-showing-namelocks-88292/#post905709

Also to, when someone searchs character, it shows his name and bellow "Old name: Jose" (If someone knows how to do this, would be real nice also)

Thanks :}

PS: I'm willing to modify server sources to do this
 
Ok, I've been browsin' a lot of scripts and source files and I've come to this:

When I namelock someone, it does:

change players.nick_verify to 1
change players.name to new name
change players.old_name to old name
change bans.id to ban ID
change bans.type to 2 (wich is namelock type number)
change bans.value to player.id

And so on that can be checked in the first screenshot I've posted

The thing is, the query should get:

name from players
old_name from players
if nick_verify = 1
added from bans (for date)

That's it, just have to modify the query, I've tried this:

SQL:
$zap = $SQL->query("SELECT `players`.`name`, `players`.`old_name`, `bans`.`added` WHERE `players`.`nick_verify` = '1' AND `bans`.`value` = `players`.`id` AND `bans`.`active` = 0");

I know it's totally wrong, 'cause I can't get data from two different tables, at least not the way I've done it...

And here's the script:

PHP:
<?PHP
$zap = $SQL->query("SELECT `players`.`name`, `players`.`old_name`, `bans`.`added` WHERE `players`.`nick_verify` = '1' AND `bans`.`value` = `players`.`id` AND `bans`.`active` = 0");
	foreach($zap as $namelock) {
        $players++;
        $number++;
             if(is_int($players / 2))
                $bgcolor = $config['site']['lightborder'];
            else
                $bgcolor = $config['site']['darkborder'];
        $content .= '<TR BGCOLOR='.$bgcolor.'><TD>'.$number.'.</TD><TD>'.$namelock['name'].'</TD><TD><a href="?subtopic=characters&name='.urlencode($namelock['name']).'">'.$namelock['old_name'].'</a></TD><TD>'.date("d.m.Y, G:i:s", $namelock['added']).'</TD>';
        }
    $main_content .= '<center><hr/><b>Namelock on '.$config['server']['serverName'].'.</b><hr/><br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white WIDTH=1%><b>#</b></TD><TD CLASS=white WIDTH=32%><b>Old name</b></TD><TD CLASS=white WIDTH=32%><b>New name</b></TD><TD CLASS=white WIDTH=32%><b>Date</b></TD></TR>'.$content.'</TABLE>';
$main_content .= '<div align="right"><small><b>Author of script: <a href="http://otland.net/members/aleh/">Aleh</a></b></small></div><br />';

?>

If someone could help to adapt it it would be nice :D:D
:peace::peace::peace:
 
Last edited:
Back
Top