News:

Wondering if this will always be free?  See why free is better.

Main Menu

Made new field, how get data from it?

Started by PrizeLive.com, July 18, 2006, 08:52:21 AM

Previous topic - Next topic

PrizeLive.com

I made a new column in the smf_members table called points.

What code can I use to get this value and have it appear as a text box on the profile page so admin's only can edit it?

I also want it to display on a different page in the forum so I need to know what code I can use to pull this data back for the member thats logged in (so they view their own 'points'). I also need it so if I (as admin) look at their page, I see their 'points' instead of mine.
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Senkusha

Its been a while, so I'm a bit rusty...

In order to retrieve the data from the database you need to tweak Load.php. 

Find this and add a new data field:

// Set up the $user_info array.
$user_info += array(


Next find this, and add your column name:

}
elseif ($set == 'profile')
{
$select_columns = "


Next to modify your template: Profile.template.php:
Find the section you want to add the data and add it.  You'll use a very simular variable like $member['posts'] (I think it is), only where posts is, you'll use your column name (see first step).

You don't need to worry about the admin peice, since the profile page uses $member data not $user data.
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

PrizeLive.com

Thanks for the reply... I'll check into what you said...

I also want to be able to edit this value when I go to a members page. Is that possible?
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

PrizeLive.com

Quote from: SurfExcelerator.com on July 19, 2006, 10:20:26 AM
Thanks for the reply... I'll check into what you said...

I also want to be able to edit this value when I go to a members page. Is that possible?

Senkusha... thanks for the help...!

I got the value stored in the database and retrieved on the page I want...

Now all that's left is to add an edit box on the members' profile page exactly the same as the "Posts" option... Which files do I need to edit for that?
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

PrizeLive.com

Heh.. nevermind.. I just got it to work..

Thanks much!!  ;D
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Senkusha

Okay, glad I could be of some assistance!  Just an FYI:  To get a "post box" you use the:

<TEXTAREA ROWS=5 COLS=100 NAME=mybox>' . $datahere . '</TEXTBOX>
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

Advertisement: