Advertisement:

Author Topic: Custom Profile Field Mod  (Read 950244 times)

Offline Tapsa2

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
Re: Custom Profile Field Mod
« Reply #3080 on: July 27, 2011, 10:30:02 AM »
Thanks Kindred for the advice.
It's just that when i first enabled 2.0 profile fields, I tried to do it like Winrules instructed, by naming the fields to CP1 first and then rename it to anything I want.
And now when i look at the smf_custom_fields table, the field name is cust_cp1.
So if i run a query in smf_themes table like this.
UPDATE smf_themes SET variable = "cust_cp1" where variable = "CP1"
And then run upgrade.php it might work?
Luckily it's still our testforum i'm working with before we upgrade the main forum to 2.0
Suomi - Finland

Offline Kindred

  • The Mean One
  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 60,437
  • Gender: Male
    • Kindred-999 on GitHub
Re: Custom Profile Field Mod
« Reply #3081 on: July 27, 2011, 10:52:45 AM »
it might work... yes...   if the field was alreayd recreated in 2.0, it might conflict... but I'd suggest trying that first.
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."

Offline Tapsa2

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
Re: Custom Profile Field Mod
« Reply #3082 on: July 27, 2011, 12:22:12 PM »
Maybe a stupid question.
I ran the query, uploaded upgrade.php from the large upgrade package, tried to run it but the installation tells me there are some files missing. (didn't tell me what files)
And i thought the upgrade.php would be enough.
So do I have to upload the entire large upgrade, or what?
Or have I screved up with something?
Suomi - Finland

Offline Illori

  • Support Specialist
  • SMF Legend
  • *
  • Posts: 52,947
Re: Custom Profile Field Mod
« Reply #3083 on: July 27, 2011, 12:23:38 PM »
Themes/default/languages/Install.english.php

and the upgrade*.sql files

Offline Tapsa2

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
Re: Custom Profile Field Mod
« Reply #3084 on: July 27, 2011, 12:58:13 PM »
Thanks Illori
I'm using Finnish as my language right now so i could upload install.finnish.php or switch to english before running upgrade.
And upload the upgrade*.sql files also of course.
Let's see how it works out.
I'll be back.  ;D
Suomi - Finland

Offline Tapsa2

  • Jr. Member
  • **
  • Posts: 183
  • Gender: Male
Re: Custom Profile Field Mod
« Reply #3085 on: July 27, 2011, 02:30:00 PM »
I'm back. But can't convert this mod to 2.0 profile fields.
Ran the query, ran the upgrade.php, but no change. The (location) field doesn't show up for any user.

Anybody have an idea what to try next?
Suomi - Finland

Offline TheGenie

  • Newbie
  • *
  • Posts: 4
Re: Custom Profile Field Mod
« Reply #3086 on: September 19, 2011, 08:10:43 AM »
Here are my Mods & Errors on attachment. I would love to have this mod up.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: Custom Profile Field Mod
« Reply #3087 on: September 19, 2011, 09:56:54 AM »
To find out how to get 1.1.x fields created with this mod to show up after upgrade to 2.0, please search this topic for BINGO
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Kindred

  • The Mean One
  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 60,437
  • Gender: Male
    • Kindred-999 on GitHub
Re: Custom Profile Field Mod
« Reply #3088 on: September 19, 2011, 10:11:01 AM »
I posted this 3 years 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)

for those to lazy to search... :P
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."

Offline Mr_JimWest

  • Semi-Newbie
  • *
  • Posts: 71
  • Gender: Male
  • http://jw-renders.com
    • JW-Renders
Re: Custom Profile Field Mod
« Reply #3089 on: September 25, 2011, 12:29:00 AM »
I just wanted to let you know that on behalf of the community, I would like to say we would really appreciate a 2.0.1 compatible version/installer!

Offline Illori

  • Support Specialist
  • SMF Legend
  • *
  • Posts: 52,947
Re: Custom Profile Field Mod
« Reply #3090 on: September 25, 2011, 07:38:46 AM »

Offline Mr_JimWest

  • Semi-Newbie
  • *
  • Posts: 71
  • Gender: Male
  • http://jw-renders.com
    • JW-Renders
Re: Custom Profile Field Mod
« Reply #3091 on: September 25, 2011, 02:37:12 PM »
Wow, that's embarrassing....

Offline Calman

  • Semi-Newbie
  • *
  • Posts: 26
  • Gender: Male
    • Pool-Chat
Re: Custom Profile Field Mod
« Reply #3092 on: November 12, 2011, 04:37:43 PM »
Hi folks,

I love the Custom Profile Mod ... but I am trying to move a newly created dropdown custom field below the standard location details ... can this be done?


Example:

--------------------------------------------------------------------------------
My Time Zone:  Eastern Standard Time (EST)   
--------------------------------------------------------------------------------
 
Gender:  Male
Age: N/A
Location: New York
Country: United States   
Local Time: November 12, 2011, 02:03:12 PM
(WOULD LIKE the custom field  'My Tome Zone' HERE!)

.. looked at Index, Display and Profile.php files, but can't see how to identify the custom field and place it below Local Time?

Any help appreciated, thank you!
Cal :)

Offline Calman

  • Semi-Newbie
  • *
  • Posts: 26
  • Gender: Male
    • Pool-Chat
Re: Custom Profile Field Mod
« Reply #3093 on: November 13, 2011, 01:53:17 PM »
.. guess this is a tougher query than I first thought!

Oh well, thanks anyway.

All the best,
Cal :)

Offline hcfwesker

  • SMF Hero
  • ******
  • Posts: 2,214
  • Gender: Male
  • SMF 2.0.4
Re: Custom Profile Field Mod
« Reply #3094 on: November 20, 2011, 01:09:30 AM »
Sometimes you just have to be patient.  I'm not 100% sure on this, but I'll try my best ...

.. guess this is a tougher query than I first thought!

.. looked at Index, Display and Profile.php files, but can't see how to identify the custom field and place it below Local Time?

I seen you try Profile.php , is that from Sources/Profile.php?

you should check /Themes/default/Profile.template.php

Find
Code: [Select]
<td><b>', $txt['local_time'], ':</b></td>
<td>', $context['member']['local_time'], '</td>
</tr><tr>';

Add this directly BELOW
Code: [Select]
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldsProfile();


then you will have to remove the same code from the spot it was riginall added from the MOD, or it'll show in 2 different places.

Find
Code: [Select]
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldsProfile();
// Can they add this member as a buddy?

Replace with
Code: [Select]
// Can they add this member as a buddy?
Be sure to download and save the file, in case any errors or this doesnt work and you want to revert back.

Only thing is, I'm not too familiar with SMF1 mods anymore, but i think all your custom fields will show, you cant separate them on SMF1 if i remember correctly.

« Last Edit: November 20, 2011, 01:19:26 AM by hcfwesker »

Offline Biology Forums

  • SMF Hero
  • ******
  • Posts: 3,781
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: Custom Profile Field Mod
« Reply #3095 on: November 20, 2011, 01:32:19 AM »
Technically you could use this mod to create your very own custom profile, why have I over-looked this for so long!

Offline gtrump

  • Newbie
  • *
  • Posts: 1
Re: Custom Profile Field Mod
« Reply #3096 on: December 11, 2011, 04:47:13 PM »
SMF 2.0 is already include this feature name Advanced Profile Fields.

But how can one get the custom fields to be listed in the Members List??? (version 2.0.1)

Offline digit

  • Sophist Member
  • *****
  • Posts: 1,364
  • Gender: Male
Re: Custom Profile Field Mod
« Reply #3097 on: January 04, 2012, 12:19:36 PM »
WOW!!!!   I seem to have found a BIG oversight here...

if you add a custom text field, there is no limit to the number of characters that can be added...

in other words, in the display screen, a person can have 300 lines of text added...

I think you need to add a maxlength stat in the field settings... 
(the current "size" of the field is set to 50, but that should probably be the same size as "maxlength", especially if you make it into a settable variable.)

for the moment, I have change the field size and maxlength (in my set up) to 25...
If anyone else is interested in 'fixing" this:

line 31 in CustomProfile.php
Code: [Select]

<td><b>' . $modSettings['CP' . $i . '_name'] . ': </b>' , !empty($modSettings['CP' . $i . '_desc']) ? '<div class="smalltext">' . $modSettings['CP' . $i . '_desc'] . '</div>' : '' , '</td><td><input type="text" name="default_options[' . $modSettings['CP' . $i . '_id'] . ']" size="25" maxlength="25" value="', @$context['member']['options'][$modSettings['CP' . $i . '_id']], '" /></td>

Would this edit limit character length for all added fields if you have more than one?  Say you set it at 8 ... would all added fields be limited to 8 characters?

I have two added fields but only want to set a character length limit for the 2nd one.  I found the code mentioned on two lines (lines 30 and 88 in my file).  I changed the one on line 88 thinking it would limit the 2nd field but it had no effect.  Do I need to change both?  If I change both, will it effect all added fields?

BTW, the code in my file doesn't exactly match the one Kindred posted. It doesn't have the 'max length'.  It looks like this:

                              <td><b>' . $modSettings['CP' . $i . '_name'] . ': </b>' , !empty($modSettings['CP' . $i . '_desc']) ? '<div class="smalltext">' . $modSettings['CP' . $i . '_desc'] . '</div>' : '' , '</td><td><input type="text" name="default_options[' . $modSettings['CP' . $i . '_id'] . ']" size="50" value="', @$context['member']['options'][$modSettings['CP' . $i . '_id']], '" /></td>


I guess what I'm asking is how do I set a character size limit for a particular added field.

Thanks.

Max length can not be set on a per field basis.  :(

I would love to see a maxlength field added to the custom profile field settings area.  My users are abusing these fields.  :(  (hopefully just an edit or two i can make without uninstalling and reinstalling!)

Thanks for an awesome mod.
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Offline Kindred

  • The Mean One
  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 60,437
  • Gender: Male
    • Kindred-999 on GitHub
Re: Custom Profile Field Mod
« Reply #3098 on: January 04, 2012, 12:44:15 PM »
well, since this is already a feature in 2.0, I don't believe that any further development is being done with this mod...

you would have to create a new database field and add it to the admin area...
$modSettings['CP' . $i . '_maxlen']
 and then call it in the input tag....
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."

Offline ramins

  • Semi-Newbie
  • *
  • Posts: 12
Re: Custom Profile Field Mod
« Reply #3099 on: January 31, 2012, 11:31:01 AM »
Is there a mod that allows you to put any/all of the custom fields on a report?
If there isn't - I need to have a report of my membership data including the custom fields. Anyone wants to take on the challenge?