Custom Profile Field Mod

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

Previous topic - Next topic

gastan

Does anyone have any ideas or suggestions on how to regain access to this mod so I can add and edit added profile fields?  See my post above.  Thanks.

gastan

#2801
Does anyone have any ideas about which file to look in for the instructions set that direct the custom profile fields setting page to open when you click Admin CP > Configuration > Features and Options > Custom Profile Fields?  According to the parsing instructions the mod edits 7 files and adds 2 new ones. 

Does anyone have any ideas about which instruction set directs the proper page to display?

Using 1.1.10 & default theme.

Any help appreciated.  I an not a programmer or coder so not sure exactly what to look for.  I am/was a carpenter. Retired. If you have any questions re: building anything feel free to ask.


Arantor

Off hand I'd suggest that's done by the edits to ModSettings.php and/or Admin.php.

thezkitten

Quote from: gastan on November 21, 2009, 03:00:53 PM
Does anyone have any ideas about which file to look in for the instructions set that direct the custom profile fields setting page to open when you click Admin CP > Configuration > Features and Options > Custom Profile Fields?  According to the parsing instructions the mod edits 7 files and adds 2 new ones. 

Does anyone have any ideas about which instruction set directs the proper page to display?

Using 1.1.10 & default theme.

Any help appreciated.  I an not a programmer or coder so not sure exactly what to look for.  I am/was a carpenter. Retired. If you have any questions re: building anything feel free to ask.

ok,
is the "CustomProfile.php" file in the right spot? (./Sources/)
and is the "CustomProfile.english.php"  also in the right spot? (./Themes/default/languages)

If they are, i'd check ModSettings (./Sources/ModSettings.php)
where i'd specificly check in that file,-
find this--

// Load up all the tabs...
$context['admin_tabs'] = array(
'title' => &$txt['modSettings_title'],
'help' => 'modsettings',
'description' => $txt['smf3'],
'tabs' => array(


make sure that above, you have this
loadLanguage('CustomProfile');

and under, in the array (somewhere) you have the custom profile array, mine's located just above the karma array
'profile' => array(
'title' => $txt['cp_cpfields'],
'href' => $scripturl . '?action=featuresettings;sa=profile;sesc=' . $context['session_id'],
),
'karma' => array(
'title' => $txt['smf293'],
'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
'is_last' => true,
),


also, make sure that somewhere in the subactions arrays (there's two, they look like this)
$subActions = array(
you have a line in it that says this

'profile' => 'ModifyProfileSettings',


you'll also want to make sure that your function is there, (mine is just above the karma function)
function ModifyProfileSettings()
{
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
CustomFieldSettings();
}



if you're missing any of them, or if all these are correct,  you can go to the mod listing itself (http://custom.simplemachines.org/mods/index.php?mod=319)
and just under the download link is an option to parse the info, select the 1.1.10 and click parse, that will show you what files need to be altered, and what/where the alterations need to go..

hope that helped!
http://zkitten.com  :|:  http://chaoticlycreative.com  :|:  http://etsysteamteam.com [nofollow]

Lots O Smileys not working for you? This may be it!  Also, Need to Show Custom Fields in Memberlist? this could help! (for 1.1.x)

gastan

#2804
Thank you both for the pointer.  Especially you, thezkitten, for telling me exactly what to look for. 
Thank youn.

I was missing the 'profile' => 'ModifyProfileSettings', line in both places.  Everything is working just fine now.   ;D   ;D   ;D


thezkitten

http://zkitten.com  :|:  http://chaoticlycreative.com  :|:  http://etsysteamteam.com [nofollow]

Lots O Smileys not working for you? This may be it!  Also, Need to Show Custom Fields in Memberlist? this could help! (for 1.1.x)

SaMDaS

Hi, I just installed the mod over 1.1.6 smf and I wanted to work with this database stored custom data with another program.
My question is, is there any possibility to replace the data over smf_themes fields and add to smf_members? like MSN/ICQ entries? thanks

Arantor

Not without a total rewrite of the mod, and taking your forum offline while it rebuilds the members table every time you change a field.

Kindred

I will also note that you need to upgrade your forum ASAP.   1.1.6 is 4 versions old and has KNOWN security issues.
Сл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."

SaMDaS

Thanks for the answers, I was wondering why these fields weren't on members list table. With the actualization, we're working in it, testing in another test forum with the same mods to 1.1.6 to 1.1.10, no problems. So we will get update this week. Thanks again

Kindred

they are not in the memberlist table because it's much harder to add things on the fly to that table. SMF has built in capability to add fields and values to the themes tale and to track those on a per user basis.
Сл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."

kevavent

#2811
I am having a basic problem.  I don't get the Custom Profile Fields option in Admin CP > Configuration > Features and Options.

I'm on the 1.1.10 release using English but with a different Theme.  I'm using the Half-Life theme.  I reverted to the Default theme but that didn't help.

I've checked the Server Settings and my language is set to English.  (In fact I don't even have a UTF8 option.)

Thanks for any help!

Pupo

Does this mod has support for smf ver1.1.11? When I install it, i got this msg when i go to Features and Options: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/myscoote/public_html/Sources/ModSettings.php on line 122

tnx

Pupo

Quote from: Pupo on December 08, 2009, 01:52:33 PM
Does this mod has support for smf ver1.1.11? When I install it, i got this msg when i go to Features and Options: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/myscoote/public_html/Sources/ModSettings.php on line 122

tnx

I fix this, Install before "Ultimate profile" mod and in modsetting in string  'ultprofile' => 'ModifyUltProfileSettings' missing end point. Ofc should be 'ultprofile' => 'ModifyUltProfileSettings',

Now, I have new problem :( ( probably because I tried several times to install the mod) Finally, I have to manually insert mod, and works, but I have two fields in profile page :( and one field under avatar :)

perplexed

Quote from: winrules on March 19, 2008, 03:33:16 PM
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".


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)



I would like to import the data from the custom profile fields mod into the new 2.0 profile fields feature.

I tried what winrules explained in the above quote but it didn't work.

Kindred, I would like to try what you say in your quote above but I'm not sure I understand it.

I looked in smf_themes table and the data is there for those members who filled it in, but there is no mention of CP1, CP2 fields etc.  Instead, the variables seem to be called things like "text_fav_food" or "text_fav_movie" so will running the command in your quote work for me?

What happens if you had CP fields with selection boxes, is all that saved with the options for the selections boxes or only the options that members chose?

Sorry but I'm a bit confused with this.

~thanks

Kindred

perplexed,

The SMF 2.0 fields use the named fields... this mod's settings use CP1, CP2, etc... (at least they did when I used the mod)  see this bit where I say *NewFieldName*...   by that I mean put in the new field name
Сл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."

perplexed

thanks kindred, but I don't know which of the old CP fields would match up as when I look in phpmyadmin all I see is "text_fav_whatever" as the variable so I don't know what CP number that used to be, in order to match it up in 2.0.    so if I for example entered "text_fav_movie" in the newfieldname where variable = CP1, then CP1 might not have been fav movie so I would get the fields back but the data would be in all the wrong fields I think?

Shouldn't I be able to see "CP1, CP2" etc in phpmyadmin when looking at the theme table instead of just text names?

Kindred

yes, you should be able to see the CP1, etc added from this mod.
Сл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."

BLueSS

Read and searched through the thread, trying to see if this was possible, but haven't been able to get it to work.

What I'm trying to do: Use a check box field as an option to enable code on *any page* not just profile pages. (ie: load the custom profile setting on index.template.php)

I created a new check box field, it works great, it is in the database properly - everything there is good. My mod works, I just need to load it on the rest of my pages.

This is what I'm trying to put in my theme's index.template.php
if (!$context['member']['options']['mycheckboxfield']=='1')
{
run script
}


The error I receive is
8: Undefined index: member
File: myurl.net/web/public/smf/Themes/default/TPortal.template.php (tp_above sub template - eval?)

I'm running tiny portal, but I can tell that I'm trying to call to search $context['member']['options'] before it has been loaded.

I've tried adding the following code (before the call above) to index.template.php and SSI.php, but it didn't help any
require_once($sourcedir . '/Profile.php');
loadThemeOptions($context['user']['id']);

I got that from This post.  That post also referenced there would be a way to do it with SSI later? If there was a way added, I don't know how to utilize the SSI so that is no help right now for me.


Is what I'm trying to do possible?
I would just like a user-configurable check box that enables/disables a script on my page.

perplexed

#2819
Quote from: Kindred on December 12, 2009, 10:10:57 PM
yes, you should be able to see the CP1, etc added from this mod.

Ok I looked at more entries.  I only looked at the first 500 and they all had names rather than CP1, CP2 etc, but after I looked at a few thousand entries the CP field names started to appear.

I've worked out what most of them should be but I can't get the data into the fields now.

I created a new field in features and options > profile fields using the instructions given above by winrules.  I called it CP1 then saved it, then modified it to the correct display name. Then I ran the sql code that you posted in the post quoted above.  I just have an empty field with no data in it.

I think I'm doing something wrong but I don't know what.

Advertisement: