Welcome, Guest. Please Login or Register.
September 29, 2024, 11:18:40 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  How do I add something to members profile that only admins can edit? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: How do I add something to members profile that only admins can edit?  (Read 1171 times)
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
How do I add something to members profile that only admins can edit?
« on: January 03, 2002, 05:07:30 PM »
Reply with quote

How could I add something to the members profile?

What I want is an option in the profile that only I can edit thats like

"Member of UD  [combobox Yes/No]" how would I go about making that? i'm sure its not that hard.
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #1 on: January 03, 2002, 05:22:20 PM »
Reply with quote

it isn't, wait until tomorrow and i'll post instructions for you, now i have to go from office to home ;D
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #2 on: January 04, 2002, 09:12:17 AM »
Reply with quote

Ok let's start, now i'll show you how to add a field to compile with text or a checkbox to check/uncheck.

The file you have to edit is Profile.php:

we have to load the var we need:

search:
$request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER FROM {$db_prefix}members WHERE memberName='$user'");
and add the var (we can call it test) in this way:
$request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,test FROM {$db_prefix}members WHERE memberName='$user'");
we now need to define the default value:

search:
$memsettings['location'] = isset($memsettings['location'])?$memsettings['location']:'';
and add before:
$memsettings['test'] = isset($memsettings['test'])?$memsettings['test']:'';
now we set that only admins can view this option:

search:
   <td width="45%"><font size=2><b>$txt[86]: </b></font></td>
   <td><font size=2><input type=text name=settings6 size=4 value="$memsettings[6]"></font></td>
      </tr><tr>

and, to make it a filed to compile, add before:
   <td width="45%"><font size=2><b>$txt[test]: </b></font></td>
   <td><input type="text" name="test" size="30" value="$memsettings[test]"></font></td>
     </tr><tr>

or, to make it a checkbox, add before:
   <td width="45%"><font size=2><b>$txt[test]</b></font></td>
   <td><input type="checkbox" name="test"$memsettings[test]></td>
     </tr><tr>

naturally the var $txt[test] must be defined in english.lng

when you save the profile the var must be saved:

search:
      $request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',dateRegistered='$member[dr]',location='$member[location]',birthdate='$member[bday]',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,hideEmail=$hideEmail WHERE memberName='$user'");
and add the var test in this way:
      $request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',dateRegistered='$member[dr]',location='$member[location]',birthdate='$member[bday]',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,hideEmail=$hideEmail,test='$member[test]' WHERE memberName='$user'");
now you have to create in your db a column at the end of members table, it must be called as the var (test in this case) and the data type must be TINYTEXT

in this way you have a new profile setting, but you must decide how to use it :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #3 on: January 04, 2002, 09:13:41 AM »
Reply with quote

My post screwed the page, must be a bug ;D
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #4 on: January 04, 2002, 01:26:27 PM »
Reply with quote

You think it's a bug cause we didn't force your code to wordwrap? LOL
Logged

Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #5 on: January 04, 2002, 01:44:00 PM »
Reply with quote

you didn't format the [code] tag box so i joked about this, i was not serious ;D
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #6 on: January 04, 2002, 02:04:30 PM »
Reply with quote

well it kinda worked, I now see an extra chekbox that wont save, the text wont display (does it matter where i put it in english.lng?) and it wont save, also, how do I display it if you view someones profile it will say "Member of UD: Yes/no"?
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #7 on: January 04, 2002, 02:57:24 PM »
Reply with quote

If you tell me exactly what you want to do i can give you an exact example.

P.S, have you created the column in the right table?
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #8 on: January 04, 2002, 03:00:39 PM »
Reply with quote

All I want is a checkbox in peoples profiles that only admins can edit. it will be "Membmer of UD" and a checkbox then, in the persons profile I want it to say "Member of UD: [Yes/no]"
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #9 on: January 05, 2002, 01:08:28 PM »
Reply with quote

So the instructions are right, you may send your sources to me. I can do the chagens for you and then comment the lines added :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
rican5vl
Full Member
***
Posts: 120


I would do this girl for hours!

Re:How do I add something to members profile that only admins can edit?
« Reply #10 on: January 05, 2002, 03:08:48 PM »
Reply with quote

I love it when you programmers talk code to each other lol



Rican
Logged
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #11 on: January 05, 2002, 03:11:39 PM »
Reply with quote

me, programmer? lol, Godai did all the work, I just copied and pasted ;D


Godai you should have my sources any minute.
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #12 on: January 05, 2002, 09:27:15 PM »
Reply with quote

Received the mail, i'll work on your sources on sunday :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
irbrian
Sr. Member
****
Posts: 489


I create. Therefore I am.

brian@inverse-reality.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #13 on: January 12, 2002, 04:20:25 AM »
Reply with quote

Wow, Godai.. wanna solve my problems too?  ;)

Logged

Imparting great wisdom daily to those who will mistake my words as such.
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:How do I add something to members profile that only admins can edit?
« Reply #14 on: January 15, 2002, 01:20:37 PM »
Reply with quote

Arghhhh i forgot thid question :o

excuse me!!!!
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  How do I add something to members profile that only admins can edit? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.035 seconds with 20 queries.