Jump to content
  • 0
Sign in to follow this  
Virtue

Account Creation date

Question

6 answers to this question

Recommended Posts

  • 0

Found a simpler way to do this though, just so that people would know.

ALTER TABLE `login` ADD COLUMN `reg_date` TIMESTAMP;

No modifications needed on whichever theme or CP you'll be using.

Share this post


Link to post
Share on other sites
  • 0

I recently did an event regarding account creation dates. There is nothing solid as of right now but all is not lost. You have the login log, and unless you cleared it, you can do a sql command to figure out when they first time someone loged in is, which is basically their creation date. 

    .@youractid = getcharid(3);
    query_sql("SELECT `userid` FROM `login` WHERE `account_id` = "+.@youractid, .@userid$);
    
    query_sql("SELECT * FROM `loginlog` WHERE `user` LIKE '"+.@userid$+"' AND `time` < '2017-12-28 00:00:00' ORDER BY `loginlog`.`TIME` ASC LIMIT 1", .@time, .@ip, .@user$, .@rcode, .@unid, .@log$);
 

The first query finds the username since loginlogs are stored by username and not by account id. The second query finds their login dates earlier than the specified date since I needed this for my event. It sorts it by ascending, so first log is their oldest log. And then stored the log info in the specified variables. I did not need the exact date so this worked for me, but .@time will only return the year, since date format uses - and : as a result that may not work for you. I have not tested this but you should be able to use .@time$ and it will return the full date, again not sure since I did not need the full date. If you do not need this to be automated, you can just run the sql queries your self or do a search in the phpmyadmin and sort after. Also you may not use unique ids so you may need to remove .@unid from the above list.

Hope this helps.

Share this post


Link to post
Share on other sites
  • 0

Thanks for your idea. Although I'm thinking something about pre-registration and stuff. I think this would be done as a plugin on the website when users are creating their accounts though

Share this post


Link to post
Share on other sites
  • 0

Doesn't have to be anything complicated. 

You could use the birthday field is you aren't already using it and just instead of giving players the option to put in their own birthrate, just auto write in today's date. Here is a little guide from rathena.

https://rathena.org/board/topic/58932-flux-cp-birthdate-field-in-register-page/

If you are already using it, then you can simply add another row, or create a new table entirely just for storing registration dates.

Share this post


Link to post
Share on other sites
  • 0

the best thing i can think of is to take an account variable the first time they login to their first character (in a script).

OnPCLoginEvent:
     if (#Account_Created <= 0)
          #Account_Created = gettimetick(2);
     end;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.