Custom Profile Field Mod

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

Previous topic - Next topic

Rumbaar

If you have it showing in the Display area then it can't be hidden from guests.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Perfektionist

Quote from: Blue Dream on February 25, 2009, 01:19:24 PM
Mod is updated to 3.20. This version fixes a minor permission issue related to unauthorized editing of fields. Package includes upgrade from older versions.

After having updated from 3.19 to 3.20 I notice that data is not saved which our users are forced to enter at registration into custom profile fields. It can`t be found neither within phpmyadmin nor within SMF itself. Profiles dating from pre-update are not affected and still display correctly. Reverting to 3.19 makes everything work fine again.

I did a second test on a freshly installed SMF 1.1.8 on my local server (XAMPP) with the same result.

Any clues? Thanks in advance!

Filipina

Quote from: Rumbaar on February 28, 2009, 03:43:55 AM
If you have it showing in the Display area then it can't be hidden from guests.

Darn.... ok thanks for the reply :)

[SiNaN]

Quote from: willj on February 26, 2009, 04:02:57 PM
Does this mod work with Ultimate Profile?

../Themes/default/UltimateProfile.template.php

Find:

<td>', $context['member']['last_login'], '</td>
</tr>


Replace:

<td>', $context['member']['last_login'], '</td>
</tr>';
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldsProfile();

echo '
</tr>


Quote from: Filipina on February 27, 2009, 08:37:54 PM
Hi I tried searching for the answer on this thread  but get error "Unable to access the search daemon" whatever it means.

Anyway I have a question someone might know. I have this mod on 1.1.8 default and love it. I have my profiles all visible to guests. However, one field I created with this mod I want to restrict guests from seeing it. Can someone tell if this is possible? Which file I would go to to find these fields? What code would I put to restrict guests from viewing this one field? 

Thanks for any assistance.

Sources/CustomProfile.php

Find:

if ($modSettings['CP' . $i . '_view'] && !$context['user']['is_admin'])

Replace:

if (($modSettings['CP' . $i . '_view'] && !$context['user']['is_admin']) || ($context['user']['is_guest'] && $modSettings['CP' . $i . '_id'] == 'FIELD_ID'))

Change FIELD_ID as the id of the field you want to hide. You can find the id in the field settings. Also, there are 3 instances of the code above in that file; the first two is for Display section and the third is for the Profile. If you change all 3, then it will be hidden for guests everywhere.

Quote from: Perfektionist on February 28, 2009, 09:52:39 AM
Quote from: Blue Dream on February 25, 2009, 01:19:24 PM
Mod is updated to 3.20. This version fixes a minor permission issue related to unauthorized editing of fields. Package includes upgrade from older versions.

After having updated from 3.19 to 3.20 I notice that data is not saved which our users are forced to enter at registration into custom profile fields. It can`t be found neither within phpmyadmin nor within SMF itself. Profiles dating from pre-update are not affected and still display correctly. Reverting to 3.19 makes everything work fine again.

I did a second test on a freshly installed SMF 1.1.8 on my local server (XAMPP) with the same result.

Any clues? Thanks in advance!

Thankfully I wasn't able to reproduce this. Is it an admin-edit-only field you are testing with?
Former SMF Core Developer | My Mods | SimplePortal

Perfektionist

Quote
Quote from: Blue Dream on March 02, 2009, 03:25:27 AM


After having updated from 3.19 to 3.20 I notice that data is not saved which our users are forced to enter at registration into custom profile fields. It can`t be found neither within phpmyadmin nor within SMF itself. Profiles dating from pre-update are not affected and still display correctly. Reverting to 3.19 makes everything work fine again.

I did a second test on a freshly installed SMF 1.1.8 on my local server (XAMPP) with the same result.

Any clues? Thanks in advance!

Thankfully I wasn't able to reproduce this. Is it an admin-edit-only field you are testing with?

Thanks for your quick reply.
Yes, it is an admin-edit-only field.

[SiNaN]

Well, admin-edit-only field means only admins can set and edit it IMO. It does not let admin-edit-only fields to be set/edited during registration too. But winrules might be thinking as you did. I'll ask him then.
Former SMF Core Developer | My Mods | SimplePortal

Perfektionist

Quote from: Blue Dream on March 02, 2009, 04:40:08 AM
Well, admin-edit-only field means only admins can set and edit it IMO. It does not let admin-edit-only fields to be set/edited during registration too. But winrules might be thinking as you did. I'll ask him then.

Thanks, Blue Dream, that's the clue I have been looking for!  :)

I have tested again and can confirm that field entries in registration are saved, if the field is not configured to admin-edit-only. (However, this was different in 3.19.)

In a way the new logic is more coherent, but nonetheless a little confusing.  ;)

As we let registrants enter their real name, we don't want other members to see them. This can be prevented as long as "admin-view-only" is ticked. The only drawback is that memebers can not edit/update their own entries, since they can't view them. (This wasn't possible with 3.19 either.)

Therefore it would be great if you could configure that admins and profile owners can view and edit custom fields while other members can not view those fields on others profiles. Maybe this will be possible in SMF 2.0. (By the way: Will there be a converter from 1.1.x to 2.0 that also transfers the extended profile data?)

Thauwa

I use 1.18 and the test error is ModSettings.php. I have a lots of other mods installed. Will anyone tell me the allergic mods?

[SiNaN]

Perfektionist:

Well, if questions were to me; then winrules is the author of the mod, so I can't really have an answer. I'm sure he'll consider your ideas when he will have some time. If you were addressing winrules; then you didn't see this post. :P

Thauwa:

If you can attach your ModSettings.php file here I may have a look at it.
Former SMF Core Developer | My Mods | SimplePortal

Jessikard

Quote from: Thauwa on March 02, 2009, 10:01:56 AM
I use 1.18 and the test error is ModSettings.php. I have a lots of other mods installed. Will anyone tell me the allergic mods?
you can parse it (maybe on smfportal.de) and do the changes manual
then installing this mod include the error ans it should work fine

that was the way i did - if you do it too, make a backup before (but on your own risk)

flamechica

I am running 1.1.8 with many modifications. The test failed on the ./Sources/ModSettings.php and I tried to manually do the edits myself. I must've messed up somewhere because it is not saving properly. I can get into the settings and change the info, but when I hit save, it brings me to the "Layout and Options" screen and if I go back to the "Custom Profile Fields" screen the custom field is still labeled as "Unnamed Field" and all the settings have reverted back to default. My ModSettings.php file is attached. Thanks in advance for your help.

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Thauwa

okay...here it is  :P pls help!

[SiNaN]

Attached yours too.

The conflict was with Contact, Rules and Generic Avatars mods.
Former SMF Core Developer | My Mods | SimplePortal

flamechica


Thauwa

does that mean that those mods won't work?

[SiNaN]

Quote from: Thauwa on March 04, 2009, 08:22:45 AM
does that mean that those mods won't work?

No. They just edit the codes that Custom Profile Field Mod is searching to put its own codes. I've applied the changes manually for you. Ignore the error, install the mod and replace your file with the one attached.

Needless to say, take a back-up to be on the safe side.
Former SMF Core Developer | My Mods | SimplePortal

Thauwa

thanks ill try
thanks for helping. You are great.  :-*

Filipina

Quote from: Blue Dream on March 02, 2009, 03:25:27 AM
Change FIELD_ID as the id of the field you want to hide. You can find the id in the field settings. Also, there are 3 instances of the code above in that file; the first two is for Display section and the third is for the Profile. If you change all 3, then it will be hidden for guests everywhere.

I don't know what to say but thanks Blue Dream!  This has saved me from hours and hours of work and I am glad I checked back here :) I had no idea it was possible to do this with one field. I only changed the profile section of the file which seems to have done what I need to stop visitors from seeing the information when browsing profiles. I tested it and it is just what I neeed.  Thanks again!

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Advertisement: