PDA

View Full Version : Mys 1.3.4 Easy Change User Cash


Abronsyth
07-01-2016, 08:33 AM
This is an extremely simple mod that will enable you to change a user's cash amount in the Admin Control Panel. There are just two pieces of code that will need to be implemented.

admincp/user.php
In this file you'll want to go down to around line 52 or so, where you'll see this;
$mysidia->db->update("users", array("email" => $mysidia->input->post("email")), "uid='{$mysidia->input->get("uid")}'");
Right below that, just add this in:
$mysidia->db->update("users", array("money" => $mysidia->input->post("money")), "uid='{$mysidia->input->get("uid")}'");

admincp/view/userview.php
In this file you'll want to go down to find public function edit, and then find where this chunk of code is (lines 53-54 for me):
->buildCheckBox(" Email the user the new password (Only takes effect if setting a new password) ", "emailpwchange", "yes")
->buildComment("Change Email Address: ", FALSE)->buildTextField("email", $user->getemail())
Right below that add in this;
->buildComment("Currency: ", FALSE)->buildTextField("money", $user->money)

So now when you go into your ACP to edit a user you can now edit their cash amount, and it will show you how much they currently have!

parayna
09-02-2016, 08:03 AM
Oh, wow, this is incredibly useful o.O Thanks! I shall totally use this when I get around to adding in features XD

Micolai
07-16-2020, 01:01 AM
Thanks so much!