• Welcome to Simple Machines Community Forum. Please login or sign up.
October 16, 2021, 03:22:48 PM

News:

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


Custom Profile Field Mod

Started by winrules, March 30, 2006, 02:21:25 PM

Previous topic - Next topic

winrules

Quote from: res6cue on March 19, 2008, 09:49:37 AM
Quote from: Kindred on March 18, 2008, 09:30:26 PM
meh... at this point, I wouldn't worry about this mod... :)   SMF 2.0 has custom fields built in, standard.

The real question now becomes:  Will there be a way for us to import all the existing data from this mod into the SMF 2.0 format?  This is going to be critical for my forum to keep this data!
Yes. To do this, after upgrading to 2.0 and enabling advanced profile fields, create a new field when the exact same name as the field ID (not the name, should be something like "CP1") of the field you want to input. After creating the field you can then rename the field to what you want. For example if I have a field using this mod on SMF 1.1 called "Favorite Food" with a field ID of "CP3", I would create a new field in SMF 2.0 called "CP3", hit save, then modify the field that I just created and change the name to "Favorite Food".


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


jossanaijr

Hi,
can fields created by this MOD be "force-on-registration"?

res6cue

March 19, 2008, 05:33:58 PM #1862 Last Edit: March 19, 2008, 05:36:21 PM by res6cue
Quote from: winrules on March 19, 2008, 03:33:16 PM
Yes. To do this, after upgrading to 2.0 and enabling advanced profile fields, create a new field when the exact same name as the field ID (not the name, should be something like "CP1") of the field you want to input. After creating the field you can then rename the field to what you want. For example if I have a field using this mod on SMF 1.1 called "Favorite Food" with a field ID of "CP3", I would create a new field in SMF 2.0 called "CP3", hit save, then modify the field that I just created and change the name to "Favorite Food".

Outstanding, thank you for that!

Kindred

I posted this a month ago... :)


BTW: To convert this to the standard 2.0 custom fields...
UPDATE `smf_themes` SET `variable` = '*NewFieldName*' WHERE `variable` = 'CP1';  (or CP2, or CP2, etc)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

res6cue

Ah a nice SQL method, even better!  Thanks Kindred.

SunilDVR

Quote from: Kindred on March 19, 2008, 05:36:58 PM
I posted this a month ago... :)


BTW: To convert this to the standard 2.0 custom fields...
UPDATE `smf_themes` SET `variable` = '*NewFieldName*' WHERE `variable` = 'CP1';  (or CP2, or CP2, etc)

Heh, sorry Kindred - I missed that post when I described this process earlier today, though I didn't do the SQL.

The second section of that post still stands though - i.e. SMF2's current implementation of custom profile fields loses some of the options provided by the mod. I'm about to post a feature request for it!




Quote from: jossanaijr on March 19, 2008, 05:00:16 PM
Hi,
can fields created by this MOD be "force-on-registration"?

Yes, they can. In your Admin panel, go to "Features and Options" -> "Custom Profile Fields". Once you create (or select) the field you wish to force entry, in that field's settings go to  "Show field on registration?" and select "Force Input" from the drop-down menu.

Sunil

jossanaijr


jimvy

I have tried for about 5 days to get this mod to work and can't seem to. Upon install I get ModSettings.php failure. So I install and then run through the SMF Package Parser and edited the ModSettings.php file as it says to. No options for this mod appear. Can you please help me, I have used this mod on my old forum and loved it but I needed to have access to databases so I had to move to a paid server space.

58tbird

Hi Sunil!

QuoteQuote from: jossanaijr on Yesterday at 02:00:16 PM

    Hi,
    can fields created by this MOD be "force-on-registration"?


Yes, they can. In your Admin panel, go to "Features and Options" -> "Custom Profile Fields". Once you create (or select) the field you wish to force entry, in that field's settings go to  "Show field on registration?" and select "Force Input" from the drop-down menu.

Sunil

In my drop down menu, I only have two options: "Show" and "Don't Show"

SunilDVR

Quote from: 58tbird on March 20, 2008, 11:18:15 PM
Hi Sunil!
In my drop down menu, I only have two options: "Show" and "Don't Show"

Hmh... I'm not sure about this.

On the live forum which I've applied this mod to, I'm using SMF 1.1.4 and the CPF mod 3.16.

This is a  bit small, it appears that the site has resized my image hosted externally - but here are the options I get for a text field titled "Name"



The option you need is 3rd from the bottom - the last drop-down, immediately above the two check-boxes.

Sunil

Kindred

Quote from: jimvy on March 20, 2008, 08:19:20 PM
I have tried for about 5 days to get this mod to work and can't seem to. Upon install I get ModSettings.php failure. So I install and then run through the SMF Package Parser and edited the ModSettings.php file as it says to. No options for this mod appear. Can you please help me, I have used this mod on my old forum and loved it but I needed to have access to databases so I had to move to a paid server space.

once again...   are you running the default theme and english?  (english utf-8 is different from english)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

58tbird

Hi Sunil!

I have SMF 1.1.4 and the CPF mod 3.17. 

I selected "Add a Field" and ran through all the options: Text, Text Area, Check Box, & Selection Box.  Each of those offers the ability to select Don't Show, Optional, or Force.

But when it comes to the only Custom Profile Field I've actually set-up, I only have the options to Show or Don't Show.  It's a Selection box with 12 selections.  I wondered if the option for forcing is dependant on any of the other settings:
     
   Show in profile?    
   Show in posts?    
   Parse BBC?    
   Field ID    
   Add a horizontal rule before field?    
   Show field on registration?  (not this one, of course)
   Only allow admins to edit field?    
   Only allow admins to view field?

So I ran through them and changed my settings for each, but no luck - I still only have two options: Show or Don't Show.


58tbird

Ah, you're right Perplexed.  I forgot to click Save when I set-up a test for the Selection Box.  Now I see that it doesn't offer this option after all.  Thank you!


esforum

Hello,
I am running  (www-esforum-cz) and I would like to use this mode, but I have different language (czech) and skin. If I instal this mod, there is no option. Does any solution exist ?

Thank you for your answer

ntowakbh

I had used this mod before, and found a problem with the drop down menu custom profile.  Basically, by using JavaScript injection, it's possible to add a selection to the list that was not originally there, and add it in.  I think this could be easily fixed by making sure that the selection is one of the allowed options.  While I didn't test it, I assume it would work the same way with checkboxes and etc.  If this has already been found out and fixed, please let me know, as this was a few months ago that I found this out.

jimvy

Quote from: Kindred on March 21, 2008, 08:26:16 AM
once again...   are you running the default theme and english?  (english utf-8 is different from english)

I had changed it and one of the other admins changed it back because he thought it was a mistake. It's working now and he knows to stop playing with the language settings! Thanks for the help.

Kindred

Quote from: esforum on March 22, 2008, 06:30:00 AM
Hello,
I am running  (www-esforum-cz) and I would like to use this mode, but I have different language (czech) and skin. If I instal this mod, there is no option. Does any solution exist ?

Thank you for your answer

and yet again,  the mod only installs in english and the default theme by default.
if you are running a different theme, you will have to manually apply template changes to your own theme.
if you are running a different language, you will have to apply the language strings to modifications.yourlanguage.php file (as they were applied in modification.english.php)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

BHashman

SMF 1.1.4

For those who are trying to use the custom profile fields in the memberlist or Member List.  I am listing both terms here to help future searchers.  Something close is shown but you still need to really look at it to figure it out.  the answer is below.

Quote from: fecu2008 on February 25, 2008, 01:14:54 AM
Quote from: Kindred on February 22, 2008, 01:39:05 PM
DHC...  try using search?   That question has been answered at leats 6 times in this thread.

the themes table. under the variable name CP1, CP2, etc.

And no...  the custom profile fields are not even IN the memberlist, as standard. There is code further back in this thread about how to add them to your member list, but I don't know if the coder ever put in a sort capability.

On the other hand, the custom profile fields in SMF 2.0 can be added to the member list and can be sorted on.

Ive looked through this whole thing and i dont see where you add it to your memberlist.  Can someone explain this to me or if its possible?
Quote from: Kindred on February 25, 2008, 01:48:22 AM

it's there... it may be scattered somewhere in the 90 pages...

but you would use:
echo '$context['member']['options']['CP1']';

or CP2, CP3, etc... whatever field you want displayed.


It is not in this topic - you can find the answer in a different topic over here and elsewhere on the community board:
http://www.simplemachines.org/community/index.php?topic=92854.msg1248190#msg1248190

To get CP to show up in the memberlist table you can't site $context['member']['options']['CP1'] in the members table that is assembled via the Memberlist.template.php near line 121. 

Instead inside the table use this $member['options']['CP1'] and you will get results. 

To find out more search the community for
$member['options']['CP1']


I started trying to search the 90 odd pages as someone here suggested.  Searched for:
custom fields - got nothing
memberlist - got nothing
member list - got nothing

custom profile in member list

I hope this helps to lessen the anxiety...
Quote from: Kindred on March 17, 2008, 08:20:58 AM
once again... search is your friend. The code to get information from the CPF tables has been given in this thread...

I think what he really means is search the community about custom fields in the memberlist.  Sure wish I knew that about 4 hours ago...  Hope it helps someone else!

Advertisement: