Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Custom profie "text" field
Avatar
Lorenzo
Guest
Guests
Feb 6, 2012 - 4:59 am

Hello,

I am working on the "custom profile fields" and I found a odd behaveur on the "text" fields.

1) Editing: the text displayed on the edit profile is html encoeded, i.e. on the textarea I have the <p>...</p> tags

2) Display: if I dont specify the userid on the sp_CustomProfileFieldsDisplay (i.e. the custom field is always "my own " data) the text displayed is correctly transformed to html (i.e. "\n" -> "<br/>"), if I specify the userId the text comes from without the html "translation"

I have tried to fix it myself, but I guess it is better if you look at it and fix in your code.

Here's the couple of thing sthat I came up with:

sp-custom-profile-fields-components.php line 95:

esc_html($text) should become sp_filter_text_edit($text)

sp-custom-profile-fileds-display-tag.php: I didn't find the "correct" way to pick up the html-ed field;

 

Thank you

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 6, 2012 - 8:49 am

I really need Mr Papa to take this one on board and he is away for a couple of days but will see it when he returns... thanks.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lorenzo
Member
Free Members
sp_UserOfflineSmall Offline
Feb 6, 2012 - 10:04 am

Thank you.

I had a couple of ideas as well, i.e. a function which displays all the custom fields (with both name/value) just to avoid the need to type all the htmls.

If you reckon that to be of any help, let me know, I'll be happy to share it.

Avatar
Lorenzo
Member
Free Members
sp_UserOfflineSmall Offline
Feb 10, 2012 - 12:45 pm

Any update on this?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 10, 2012 - 4:48 pm

nope, sorry. due to an annoying limit of 50 (which we plan to change) in the unread posts, I never saw this one...

interesting...  you should see html in the input area since html is allowed, but it should not be encoded...  your hint does look like a proper fix... will open a ticket to research in detail and get it fixed up...

Avatar
RobertL
Guest
Guests
Feb 10, 2012 - 5:06 pm

I like the support here and how the creators are actively involved.  It adds a personal touch to software and makes it fun to use because as users...we help create it!!! kiss

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 10, 2012 - 5:15 pm

we try! wink

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 10, 2012 - 5:59 pm

corrections for this have been submitted to svn trunk...  will be in next push update for RC, likely Sunday...

Avatar
Lorenzo
Member
Free Members
sp_UserOfflineSmall Offline
Feb 11, 2012 - 1:47 am

Wow, that's speedy!!

I guess I should use the bug-tracker too...

I'll have a go with the changes and do some testing.

 

Thank you,

Lorenzo

Avatar
Lorenzo
Member
Free Members
sp_UserOfflineSmall Offline
Feb 11, 2012 - 6:10 am

Hello,

I thought I could contribute to the bug tracker, but I guess I need to be authorization...

Anyway, thank you for the fix which is mostly working, however I have few notes:

  1. On sp-custom-profile-fields-display-tag.php: the sp_filter_text_display() is needed only for the get_usermeta(). $spThisUser->$fields['slug'] returns it already html-ed. Maybe it does not harm, but as a matter of principle...
  2. The include_once(CPFTAGSDIR.'sp-custom-profile-fileds-display-tag.php'); (line 101 on sp-custom-profile-fields-plugin.php) prevents it to be called twice. Either include(...) or make sp-custom-profile-fileds-display-tag.php a function.
  3. I was thinking of adding some little work on it, i.e. to be able to call a single function from the layout template to show all (of some) of the fields with the name / value and the divs so that it does not need to be done on the template. I am wondering if I could pass to you the suggestion, so that if you think it's worth having it you can include in your code.

Thank you,

Lorenzo

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626