News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Profile Field [Help]

Started by Deacon Frost, December 17, 2008, 05:44:35 AM

Previous topic - Next topic

Deacon Frost

I'm trying to create the following, but I'm not aware where everything in SMF is/how it all works. I know PHP and such, but all the backtracking is difficult...

So here's what I'm trying to do:

I want to create a new field in a profile, which is ONLY viewable by the person with the permission to view it. (Which would just be the admins, and the user who owns the profile field).

I need to be able to change it in the admincp, and call on it later in other areas of the forum.

If you have information on the coding locations..

(like database connect, how these  subs work, things like that so I can put it in then that'd be great)


BTW: This isn't a request, it's a help. I'm trying to make this, not asking someone else too ^.^. If you feel like you can do it quicker, that's cool.

I'm using 1.1.7... dunno if that changes too much.

I'm not gonna be using any images for it, but yeah, it just needs to be viewable by the owner of the account, and the admin. (For instance, a random number that only the admin, and the id of that random number's row.) And only admins can change it.

So, what all files do I need to change, and how does this whole thing work?

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Deacon Frost

Ok, thanks. That does show me how to add a profile field.

Now how do I go about making it only available to people with the permission to view JUST that profile field in their own/any profile?

[SiNaN]

Do you have a custom permission for that? If not, how do you plan to limit members?
Former SMF Core Developer | My Mods | SimplePortal

Deacon Frost

Just for admins, and the owner of the account. Kind of like a private field.

The person who owns the account can see the info, and the administrators only. Else, no one else can see other's.

[SiNaN]

If you add that to the profil edit sections, only admins and the owner will be able to edit it.

If you want to show on profile summary just for admins and the owner, you can try this:

if ($context['user']['is_admin'] || $context['user']['is_owner'])
   echo 'PROFILE FIELD';
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: