News:

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

Main Menu

Custom Profile Field Mod

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

Previous topic - Next topic

lesmond

Great mod ty :)

I have a required field that ask the member to add there Union number upon registration,  What I would like to know is there anyway that I could add a search for the field, under the Search for members page ???

I am running SMF 1.1.10


Free Forum Image Hosting


The only person who got all his work done by Friday was Robinson Crusoe

Rumbaar

@steelsheen
As long as you have english and english-utf8 (or any other language file, well technically on the index.{language}.php is required) it will be an option to use that language.  If that is not the case then there is something else wrong with your forum.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Kindred

lesmond...   that would take some custom coding.

however, SMF 2 already has that capability by default with no further modifications
Слaва
Украинi

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

Angelina Belle

How easy is it to migrate custom profile fields to SMF2, and get the contents properly stowed in the right tables?
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Kindred

it's pretty easy... but you have to run some SQL statements after you create the new custom fields in smf 2.   Look back in this thread... we've listed them at least twice.
Слaва
Украинi

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

Angelina Belle

#2605
Thanks!  I finally found it!  :)

Silly me :-[ -- I had tried SMF's search feature to search this topic for single terms like "upgrade", "2.0" "SQL", "SET" "UPDATE", "join" and even "table", but had no luck at all.  :(

I guess I've learned not to depend on SMF2.0's search feature when I actually want to find something.

So I randomly flipped back to March and discovered a helpful posting, which can be found by searching on "BINGO" or "convert", but not any of the other terms.
http://www.simplemachines.org/community/index.php?topic=79004.msg1995522#msg1995522

So -- update the contents of the field variable in smf_themes for each of the CP fields to reflect the newly-created SMF2.0 profile fields. That's easy.

Thanks.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

J-Bird

There is the option for fields to be viewable only to admin, I would like to extend that view to Global Moderators as well. How can this be done?

Thanks!
Love, often

Kindred

you would have to modify the code (not sure exactly where) 

it's not a standard permission, if I recall correctly.
Слaва
Украинi

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

J-Bird

Thank you Kindred.
I suspected that was the case.
Love, often

Matthew K.

Where are the fields located in the Database?

I need to be able to call up each field individually in a post and on the profile.

Thanks,
Labradoodle-360

Kindred

try reading the thread? This has been answered at least 5 times.


So... for you folks who can't be bothered...    the field values are stored in the themes table
Слaва
Украинi

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

J-Bird

Can anyone help me with the code changes I need?
Love, often

steelsheen

#2612
Quote from: Rumbaar on August 10, 2009, 05:53:34 PM
@steelsheen
As long as you have english and english-utf8 (or any other language file, well technically on the index.{language}.php is required) it will be an option to use that language.  If that is not the case then there is something else wrong with your forum.

Umm, well everything seems to be working just fine. utf8 is the only option for any of the languages.

Nevermind...I really don't feel like messing with it

patdj

Nice Mod, thanks!

Have a German translation for you:
<?php
// Don't translate FIELDNAME in the below string.
$txt['cp_enable'] = 'FIELDNAME aktivieren';
$txt['cp_text'] = 'Textzeile';
$txt['cp_textarea'] = 'Textfeld';
$txt['cp_checkbox'] = 'Häkchen';
$txt['cp_selectbox'] = 'Auswahl';
$txt['cp_type'] = 'Art';
$txt['cp_addfield'] = 'Feld hinzufügen';
$txt['cp_name'] = 'Name';
$txt['cp_profileshow'] = 'Im Profil anzeigen?';
$txt['cp_dontshow'] = 'Nicht anzeigen';
$txt['cp_underpostcount'] = 'Unter Beitragszähler zeigen';
$txt['cp_underimages'] = 'Neben Benutzerbild zeigen';
$txt['cp_showposts'] = 'In Beiträgen anzeigen?';
$txt['cp_parsebbc'] = 'BBC umwandeln?';
$txt['cp_before'] = 'Text, der vor dem Feld angezeigt werden soll (BBC-fähig wenn aktiviert)';
$txt['cp_after'] = 'Text, der nach dem Feld angezeigt werden soll (BBC-fähig wenn aktiviert)';
$txt['cp_fieldid'] = 'Feld ID';
$txt['cp_hrule'] = 'Horizontalen Trennstrich vor dem Feld anzeigen?';
$txt['co_optinput'] = 'Freiwillige Angabe';
$txt['cp_forceinput'] = 'Eingabe erzwingen';
$txt['cp_showreg'] = 'Feld bei Registrierung anzeigen?';
$txt['cp_adminedit'] = 'Nur Administratoren Feldänderungen erlauben?';
$txt['cp_adminview'] = 'Nur Administratoren Einsicht erlauben?';
$txt['cp_recreate'] = 'Feld wiederherstellen';
$txt['cp_checked'] = 'Anzeigetext wenn Häkchen';
$txt['cp_notchecked'] = 'Anzeigetext wenn kein Häkchen';
$txt['cp_show'] = 'Anzeigen';
// Don't translate OPTIONNUMBER in the below string
$txt['cp_option'] = 'Antwort OPTIONNUMBER';
$txt['cp_addoption'] = 'Antwort hinzufügen';
$txt['cp_cpfields'] = 'Eigene Profilfelder';
// Don't translate FIELDNUMBER in the below string
$txt['cp_fieldsettings'] = 'Einstellungen für Profilfeld Nr. FIELDNUMBER';
// Don't translate FIELDNAME in the below string
$txt['cp_regerror'] = 'Du hast das "FIELDNAME"-Feld nicht ausgefüllt.';
$txt['cp_moveup'] = '[ Nach oben ]';
$txt['cp_movedown'] = '[ Nach unten ]';
$txt['cp_delete'] = '[ Löschen ]';
$txt['cp_unnamed'] = 'Neues Feld';
$txt['cp_settings'] = '[ Einstellungen ]';
$txt['cp_hrsummary'] = 'In Profilzusammenfassung';
$txt['cp_hredit'] = 'Im Profiländerungsbildschirm';
$txt['cp_onboth'] = 'In beiden';
$txt['cp_desc'] = 'Feldbeschreibung';
?>


Works for me so far, should be ok.

I just have one problem: the Custom Fields are not displayed in posts, whatever setting I choose. My template is fire_09, could this be the problem?

Kindred

yes... as with any mod on the 1.1.x series of smf, you will have to manually install the mod code into any custom themes (i.e. any theme other than the default theme)
Слaва
Украинi

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

patdj

Sure! Did that already for other mods I fighted with today, just forgot, thank you! Now it's working.  8)

CodeDev

If like me you get an error like this:

Call to undefined function DisplayFieldPosts Pictures()

Here is the workaround:

in Display.template.php
FIND:
DisplayFieldPostsPictures();
BEFORE ADD:

global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');



in PersonalMessage.template.php
FIND:
DisplayFieldPostsPictures();
BEFORE ADD:

global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');


And that should get you rid of those annoying and fatal errors!  ;)

alexandervba

is it possible to send an admin/all admins a message/email whenever a field is editted? Or have like an approval function. if some1 wants to edit a field... The admin would have to verify it first?

Thx, great mod!




To come back at some1 else's question:

The fields are stored in SMF_Themes.

Huskyteer

Hi - I'm having a problem with this mod. Apologies if this has been dealt with lots of times but I didn't have any luck with the Search.

I've set up two custom fields which appear on the registration screen as mandatory fields. This works fine, and the fields show up in the user's profile - but they're blank. The information doesn't get transferred from registration to profile.

What might I be doing wrong? I'm using SMF 1.1.10, and I had to install the mod manually.

I tried switching back to the default theme, which seems to be the answer to a lot of problems, but no joy.

Thanks!

Arantor

Quote from: alexandervba on September 03, 2009, 12:14:13 PM
is it possible to send an admin/all admins a message/email whenever a field is editted? Or have like an approval function. if some1 wants to edit a field... The admin would have to verify it first?

Sending a message when the field is edited is possible; in theory you'd drop a call it to send a PM to the admins. Having an approval function is a LOT more work though.

At its simplest, you'd just add a hook into addSettings() in CustomProfile.php to send a PM, however that wouldn't be smart enough to check what had changed - simply that it had been called upon to be changed, so you'd get another query, pull out the existing values, then do a comparison on them. It's not a huge amount of work but it's enough to be getting on with.
Holder of controversial views, all of which my own.


Advertisement: