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

perplexed

Quote from: danoli on March 01, 2008, 01:49:21 PM
I just accidentally deleted the mod before uninstalling it. I tried to uninstall it and it said it wasn't there. I uploaded it again and uninstalled it ok. Now when I install it and go to features and options I get the following error...


Fatal error: Cannot redeclare modifyprofilesettings() (previously declared in /home/xxxx/public_html/Sources/ModSettings.php:314) in /home/xxxx/public_html/Sources/ModSettings.php on line 324


If I uninstall it the error goes?

looks like you have duplicate code on line 314 and 324 from installing twice, open that file, remove the duplicate code and it should be ok

danoli

Quote from: danoli on March 01, 2008, 11:22:41 AM
Just found the setting, it is english utf-8. Any other suggestions?
Just re-read the previous post. It said I should have it as english, I had utf-8. This sorted it.

danoli

My custom field mod is almost working. I am now getting a duplicate custom filed for every one I create. e.g.

If I create a custom field it displays twice in the profile.

I guess this is to do with my previous problem of a doubled up installation so the bit that lists it in the profile is duplicated, any ideas wher ethis 'bit' is so I can strip it out?

Thanks

Kindred

run the mod code through the mod parser at sleepycode.com

then edit each of those files to make sure that the code was only installed once in eahc place.
Сл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."

despain

Things are working perfectly, the mod looks great.

But here's my question: is there a way to use this mod with ssi? For example, I added a Friend Code field into member profiles. I want to make a page that displays a list of these Friend Codes. Is there a way to get the value of a custom field using ssi, like there is with the default SMF fields?

Thanks.
hxxp:www.rhinocap.net [nonactive]

SunilDVR

Hi despain,

Quote from: despain on March 03, 2008, 11:32:39 AM
But here's my question: is there a way to use this mod with ssi? For example, I added a Friend Code field into member profiles. I want to make a page that displays a list of these Friend Codes. Is there a way to get the value of a custom field using ssi, like there is with the default SMF fields?

Not that I am aware of, though I could be wrong. In my case, I wrote a custom SQL query to retrieve the data for all the members on the site, which I then run from a page which uses SSI for login access.

I reproduce it below for your (and perhaps other people's) benefit.

SELECT smf_members.ID_MEMBER
,smf_members.emailAddress
,smf_members.memberName
,full_name.value AS fullName
,member_no.value AS memberNo

FROM smf_members
,smf_themes AS full_name
,smf_themes AS member_no

WHERE (smf_members.ID_MEMBER = full_name.ID_MEMBER
AND smf_members.ID_MEMBER = member_no.ID_MEMBER
AND full_name.variable = 'cp1'
AND member_no.variable = 'cp2')
ORDER BY ID_MEMBER;



It's slightly more complicated to get the data from the database than a simple "SELECT column1, column2, column 3 FROM table".  For a start, the basic information is stored in smf_members, whilst the custom profile fields are in smf_themes. Also, the data in smf_themes is stored by row, rather than in distinct columns.

To get around this, you use aliases and self-joins, and limit the output with a WHERE clause  so that you only get the information you need (where the ID_MEMBER matches in all cases, as well as where the variables are the two you need - cp1 and cp2).

As you can see, I'd left the default values (cp1 and cp2), though if you've given these your own names, you'd substitute them in. Similarly in my case those two fields refer to Full Name and Membership Number, so my aliases use these names. If you had more or different custom fields, you would need to tweak the code accordingly.

I am not an SQL expert, and I developed the above code with much assistance from my father (who has been working with SQL for longer than I've been alive). I would be interested in seeing if its the most efficient way of doing things.

It certainly works, however, and you can add in extra fields to the SELECT query if you wish to check, for instance, the last-logged in date, or the registered date (or any other bit of data) about each member.

I hope that is of some use as a starting point for your own queries.

Sunil

res6cue

Would someone please tackle this issue:

I'm trying to have it so Global Moderators can view/edit these fields if those options are checked, not just Administrators.  I found 4 entries for "is_admin" in the CustomProfile.php file and tried changing them all to "can_admin", "is_mod" or "can_mod" but none of them seemed to do the trick.  As a matter of fact, any setting except "is_admin" wouldn't even allow the primary admin account to view/edit the fields!  I even tried assigning Global Moderator as the secondary group with no success.  There HAS to be a solution for this! ::)

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

and

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

perplexed

@ res6cue  why don't you just give your global admins permission to edit profiles which would include these fields?

res6cue

perplexed - They already do have the permission to edit profiles, that's the problem!  This mod still prevents anyone but a true Administrator from viewing/editing these fields if the "allow admin" fields are checked.

perplexed

hmmm well my global moderators can do it on my forum no worries.  they have 'edit additional profile settings' box checked in permissions and they can edit all the custom profile fields

res6cue

My Global Mods have nearly the same permissions as Admins, including full control over all profiles.

Here's the $64,000 question for you:  Are your custom profile fields set to "Only allow admins to edit field?" or "Only allow admins to view field?"  That is where this whole issue stems from.  I do not want my regular members to be able to edit these fields once they fill them in at registration, but I DO want to allow my Global Mods to be able to edit them, which is not working no matter what I try.

Seriously, someone out there has to be able to figure this out.


58tbird

Hi!

I'm new around here, and don't see a way to post a new topic, so I'm using "Reply".  Let me know if I should handle some other way.

I have installed this mod, but when I chose "Selection Box", I got the same menu as for "Text".  There is no "Options" or "Add an Option" listed.

These are all the packages I have installed:

1.     Registered Links 1.0     
2.    Easy Edit Meta Data 1.0    
3.    Custom Profile Field Mod 3.17    
4.    Ad Managment 2.3    
5.    SMF 1.0.12 / 1.1.4 / 2.0 b1.1 Update 1.0    
6.    SMF 1.1.4 Search "brd" Bug Fix (1.0.1) 1.0.1

I'm using the Default Core theme. 

After I installed the Registered Links 1.0 mod I couldn't find it anywhere and my Meta tab from the Easy Edit Meta Data 1.0 mod I installed earlier disappeared (the tab for it was previously located in Admin>Configuration>Features and Options).  I don't know if this has anything to do with the problem or not.  Maybe the Registered Links mod caused some conflict with the Custom Profile Field mod as well?

Any thoughts on how I can create options?

Thank you very much!

res6cue

After you created the field and changed the type to Selection Box, you DID hit SAVE at the bottom of that page before going into the Settings, right??

58tbird

...duh, no.  Well, I'm glad the solution was something simple, even at the expense of my embarrassment.  Thank you very much res6cue!

res6cue

Oh don't feel too bad...there's a reason I knew exactly what the problem was! :-[ :D

4b11l

#1836
Hello,

Is there a way to make the profile field on the left show up at the top at the beginning of the field rather than floating in the middle? Check the picture for example as it is somewhat hard to explain.

4b11l


Kindred

of course there IS a way...

You'll have to modify the code that displays the custom info...  (and possibly the CSS)
Сл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."

Filipina

hi I searched this thread for "shifting fields" and "moving fields" but could not find the exact question.  I see that "3.17-Fixed a bug with moving fields." is noted on the latest upgrade, but I saw it noted on a previous upgrade.  If I upgrade this to 3.17 will I be able to add additional feilds without the information from other fields being effected?  The reason I ask is I have thousands of profiles which would be effected. Thanks for any feedback :)

Advertisement: