MyBB Community Forums

Full Version: Integers as part of user profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I couldn't think of any wording that would actually turn up results in a search for this, but I also know it's pretty basic so it shouldn't be that hard to get working...
All I need is some simple solution to have a couple of custom fields in profiles for users that contain an integer and can only be edited by mods and admins.
I have a lot of other problems but I figure I'll start with something that at least seems basic. I'm quite confident in my programming skills, but I haven't worked with PHP too much just yet so feel free to tell me to screw off and brush up on the basics before coming whining here if this is too easy.
Well, I guess I don't really need to bump this, but I did figure out a better way to word it and I think I've figured out what I need to do...
I guess adding custom fields in user profiles isn't that big of a deal? The admin for the forum hasn't made me an admin too yet so I can't actually just sort of see what it is I'm doing yet, but I'd like to get a rough idea of the process. I looked through the tutorials section and nothing seemed to be about how to do this and what I found before only told me what I was doing and that it is possible but not really how to make it happen. I guess the Admin CP has a section for adding these sorts of things?

Update: Now that I've actually gotten into the Admin CP adding a custom text field to a profile only editable by admins and mods was a snap, but I really need an actual variable assigned to the user and not just a string in a text box on their profile... hm... anytime anyone wants to jump in...
Thanks for the... help? All I need is at least some rough idea of how one might go about assigning a single variable to each user on a forum. I've gotten someone's code for one of those "points" systems and I'm trying to decipher it but I'm not sure...
What I think I'm seeing here are variables being initialized and I suppose their global to the entire forum? I've worked with other languages too much and am expecting other parts of the code trying to call up those functions to find them too greedy to just let them go when as far as I can tell nothing is actually written to a file on the server. My immediate supposition would be that this is called by some plugins function on the server that gets the variables it assigns then saves them to a file?
The likely-hood that mostly everything I've said here is wrong is very high so perhaps I could get some clarification?

Aha. I did in fact find a tutorial on making plugins and it seems I may have been right. Apparently the functions I was seeing were for activating the plugin to make it exist on the forum and have settings and things but I can't pinpoint where the plugin gives the points system any variable to keep track of each user's points... Wait, there's also a wiki...
So the plugin runs these functions down here... which appear to actually give the variable to the profile of a user ('uid' is the user's identification number?). I don't suppose I'll be able to figure out too much more than that without some more snooping around Wikipedia or anything. Once again, feel free to jump in any time. The code I'm looking at is the plugin mybux.php by "Coolest Tech" at "http://www.coolestech.com."

Well, at least I know someone's seen this.
Sorry, but why do you need this?
And you couldn't use the edit button because.....?
Let's see now.
First post, I'm working on a project that will need to keep track of some numbers for users on a forum and eventually some sort of automation system will need to be in place for allowing those users to sort of trade what those numbers represent. That's why just a text field in the profile will eventually not be enough since I couldn't have any way to automatically change that since it would be a string... even if I could convert, which I suppose is more than likely possible, it seems like it would just be easier to have it start as an int.

Second post, I used the edit button extensively. I bumped... sort of? It wasn't on the second page yet but it certainly wasn't even being looked at.