R4Z0R49 / DayZAdmin

DayZAdmin - forked from katzsmile/DayZAdmin
22 stars 17 forks source link

Nickname Changelog #222

Closed seaweeduk closed 10 years ago

seaweeduk commented 11 years ago

Always something I've found useful would be nice to have it integrated into dayzadmin with gui etc

CREATE TABLE test.nickchanges ( id INT(11) NOT NULL AUTO_INCREMENT, oldname VARCHAR(255) NOT NULL, newname VARCHAR(255) NOT NULL, puid VARCHAR(255) NOT NULL, timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UNIQUE INDEX id (id) ) ENGINE = INNODB AUTO_INCREMENT = 3 AVG_ROW_LENGTH = 8192 CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE DEFINER = 'dayz'@'localhost' TRIGGER test.namechange BEFORE UPDATE ON test.player_data FOR EACH ROW BEGIN

if NEW.playername <> OLD.playername then INSERT INTO nickchanges (oldname, newname, puid) VALUES (old.playername, new.playername, old.playeruid); end if; END

Could be a bit of a ball ache for people who don't have db permissions for triggers though so maybe make it optional or something.

wriley commented 11 years ago

Yes, we can make this an optional feature in config.php and also check for the presence of the correct table. I'll add it to my list.

seaweeduk commented 11 years ago

Awesome thanks mate

wriley commented 10 years ago

@seaweeduk Sorry for the delay, I had some back surgery and life got in the way. Is this feature still needed?

seaweeduk commented 10 years ago

No problem wriley, hope you are well now. I have my own basic webpage I currently use for my name changes but it would be great to see it integrated into dayzadmin. I know I use it a lot and I'm sure other admins will probably find it useful too. It's up to you though and if you have time to look at it.

wriley commented 10 years ago

@seaweeduk I'm working on this today, may want you to test with real data.

wriley commented 10 years ago

Added in #227

seaweeduk commented 10 years ago

beautiful wriley, working perfectly with all my old data :) thanks very much