• Welcome to Simple Machines Community Forum. Please login or sign up.
October 17, 2021, 02:52:55 PM

News:

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


Custom Profile Field Mod

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

Previous topic - Next topic

Tapsa2

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

Kindred

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."

Tapsa2

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

Illori

Themes/default/languages/Install.english.php

and the upgrade*.sql files

Tapsa2

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

Tapsa2

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

TheGenie

Here are my Mods & Errors on attachment. I would love to have this mod up.

Angelina Belle

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

Kindred

Quote from: Kindred on February 24, 2011, 06:12:33 PM
I posted this 3 years ago...

Quote from: Kindred on March 19, 2008, 05:36:58 PM
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."

Mr_JimWest

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!


Mr_JimWest


Calman

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 :)

Calman

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

Oh well, thanks anyway.

All the best,
Cal :)

hcfwesker

November 20, 2011, 01:09:30 AM #3094 Last Edit: November 20, 2011, 01:19:26 AM by hcfwesker
Sometimes you just have to be patient.  I'm not 100% sure on this, but I'll try my best ...

Quote from: Calman on November 13, 2011, 01:53:17 PM
.. 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
<td><b>', $txt['local_time'], ':</b></td>
<td>', $context['member']['local_time'], '</td>
</tr><tr>';


Add this directly BELOW

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
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldsProfile();
// Can they add this member as a buddy?


Replace with
// 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.


Biology Forums

Technically you could use this mod to create your very own custom profile, why have I over-looked this for so long!

gtrump

Quote from: Illori on September 25, 2011, 07:38:46 AM
Quote from: grafitus on June 02, 2011, 12:48:36 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)

digit

Quote from: gastan on October 21, 2009, 11:00:09 PM
Quote from: Kindred on December 16, 2006, 06:49:04 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

<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!)

Kindred

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."

ramins

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?

Advertisement: