News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Custom Profile Fields

Started by Mike Bobbitt, May 27, 2004, 10:21:33 PM

Previous topic - Next topic

Mike Bobbitt

Hello again,

As you're probably painfully aware, I'm converting from UBB, where I have several custom profile fields. (Rank, unit, etc). Unfortunately there are no custom fields in SMF, so that data will be lost for all my users. :(

Any plans to add custom fields?


Thanks

Oldiesmann

You can add custom fields, just not as easily as you might want... Check out http://unknown.network32.net/tutorial.smf_custom-profile

Mike Bobbitt

Hey, that's really cool and very easy, but... where are these new fields stored? I can't find them in the DB anywhere...  ???

Mike Bobbitt

Cancel my last.. it's stored in the themes table... odd place for it, but it works. :)

Thanks

dschwab9

I just added columns to the members table, modified the queries, and added it to the templates.  Still not really easy, but, IMO, the data is much more organized that way.

Oldiesmann

Well, I guess that method works too, but I would suggest following [Unknown]'s tutorials in the future. The reason the new field is added as a theme option is because most of the time that field won't contain critical data that you need everytime the user's information is loaded...

dschwab9

Quote from: Oldiesmann on May 31, 2004, 07:45:49 PM
Well, I guess that method works too, but I would suggest following [Unknown]'s tutorials in the future.

Sorry,  but I refuse to put profile data in the Themes table.  Makes no sense to have it there, and it's slower to query 20 separate rows each containing 2 columns from the Themes table than to query 1 row containing 20 columns from the Members table.

Quote from: Oldiesmann on May 31, 2004, 07:45:49 PM
The reason the new field is added as a theme option is because most of the time that field won't contain critical data that you need everytime the user's information is loaded...

The way I have it, the only time those fields are loaded is when you click on someone profile.  There are different queries for loading member data.  One loads a limited amount of data for posts and stuff, and another loads the complete profile (that's the one I have the extra fields in).

Plus, I already had it like that in YaBBSE, and it was a very simple matter to just leave it like that for SMF.

[Unknown]

Yeah, reminds me of those people who refuse to install in Program Files because they think the name is stupid....

Or those people who put My Documents outside Documents and Settings for reasons that they don't like Documents and Settings.

-[Unknown]

Senkusha

Hi, just wanted to let you know that some of the search boxes on the tutorial aren't displaying correctly. (for example: When you ask to search for something, all I see is a horizontal scroll bar.)

Thanks!  Great tutorial!
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Fizzy

I was just wondering,
Instead of hard-coding the wording eg
"location"
I would like to keep the entries all together in the language files.
Which english files would I have to add the word "location" to? And would that entry in the english files be global or template specific?

Thanks

Fizz
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Skoen

Location is already in the language file. It's in the index.{your language}.php

$txt[227] = 'Location';
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Fizzy

Sorry Skoen, I should have explained better, I am not looking to use "location".
Say I was looking to customise the word to something like "weight" or "height" I would have to give it a new $txt number and I just wanted to make sure where to add it.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


[Unknown]

Modifications.language.php.

Don't use numbers, they're ugly.  Something like "fizzys_cool_width_option" would be better imho :P ;).

-[Unknown]

Fizzy

"Reality is merely an illusion, albeit a very persistent one." - A.E.


setec

#14
Quote from: Senkusha on July 12, 2004, 07:26:36 AM
Hi, just wanted to let you know that some of the search boxes on the tutorial aren't displaying correctly. (for example: When you ask to search for something, all I see is a horizontal scroll bar.)

Thanks! Great tutorial!

Having same problem.  I had to view the source and guess, but I couldn't get the mod to work.

UPDATE: It loads correct in Firefox, so trying the mod again now that I can see everything. Wish it would load right in IE though :)

setec

Okay, now that I could see everything, worked like a charm!!!

Thanks [Unknown] !!!!

[Unknown]


Advertisement: