Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Username-column in GDN_KarmaBankBalance?

This discussion is related to the Karma Bank addon.

Hoiz!

I would like to activate a column named "name" (for username) in the GDN_KarmaBankBalance-table. Is that possible somehow? I have to say I am kindofanoob when it comes to mysql but I really need to have this, so if it is possible for me and you guys are willing to help me I will try it.

greetings!
--Niemand

Comments

  • There isn't such a field. You have a UserID which you can look up in GDN_User. I recommend get the basics down of MySQL, and the framewark before you mess with it.

    grep is your friend.

  • peregrineperegrine MVP
    edited March 2013

    edited:

    I didn't see x00 had already answered this.

    It breaks the "Normal" model of design

    http://www.ibm.com/developerworks/web/library/wa-dbdsgn2/index.html

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    @Niemand
    To point you in the right direction, you are need to look into JOINing the GDN_KarmaBankBalance and GDN_User tables based on the UserID field.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • NiemandNiemand New
    edited March 2013

    It doesnt need to be normal or rational. I just need it because i want Karma and inGame-Gold to share the same worth. and that would be easiest if my inGame-economy just adds the inGame-Gold to the karma-value. sadly the inGame-economy needs an username-column for that.
    Also I dont hink it would be some real "joining", theoretically all it needs to do is [write UserName for UserID in column "name"].

    So I guess I will somehow try to code that in. :D

    Edit: And since I usually forget it: Thanks for your answers. I will see how they help me with this cause. ;)

  • hgtonighthgtonight ∞ · New Moderator

    @Niemand check out the documentation on MySQL JOIN command. You could also read up on how Vanilla interacts with a database here and here.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Sorry how would writing to a name column help with inGame-Gold?

    You find the user then add karma to the user. You need to do a transaction if you want to add Karma, you don't just update the balance.

    $KarmaBank = new KarmaBankModel($UserID);
    $KarmaBank->Transaction($Type,$Amount);
    

    grep is your friend.

Sign In or Register to comment.