Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom image avatar, custom fields to automatically populate the Your Name field, and the ability to hide user fields when logged in. #954

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

adrianbj
Copy link

No description provided.

populate the Your Name field, and the ability to hide user fields when
logged in.
@adrianbj
Copy link
Author

Just to clarify, this is for the comments fieldtype :)

@ryancramerdesign
Copy link
Owner

Thanks Adrian, looks good to me. I like your additions. One thing I think I'll want to change when adding this is the method of hiding user fields. Currently it uses display=none to hide user fields. I think I'd rather prevent the markup from appearing in the output and let the info be determined at processing time. In addition to being a little more efficient, it'll prevent the possibility of the user manipulating those values using a web inspector or something.

@adrianbj
Copy link
Author

Great - thanks - looking forward to seeing this in the core - definitely something I need on my a few of my sites at the moment.

@adrianbj
Copy link
Author

adrianbj commented Mar 6, 2015

Actually just wondering if when it's a logged in user that is leaving the comment, maybe the cite field shouldn't be populated at all, but when rendering comments, the value for cite should be queried based on the created_users_id field and the values of the fields defined in $this->options['yourNameFields']. Seems it would be nicer in case the user changes their name at some point.

@adrianbj
Copy link
Author

Hey Ryan,

Do you think there is any chance that this might make its way into 2.6. I am using it on a few sites now and it would be great to have it part of the core.

I completely understand if there is just too much else going on at your end - this is just a polite nudge if you do have time :)

@adrianbj
Copy link
Author

adrianbj commented May 9, 2015

One more minor modification - we need to resize the image to 40 x 40

$imgUrl = count($u->{$this->options['useImageField']}) ? $u->{$this->options['useImageField']}->first()->size(40,40)->url : '';

@adrianbj
Copy link
Author

Hey @ryancramerdesign - what's the chance of getting this implemented - 4 years later and I am still doing this manually on many sites.

Thanks for considering!

@netcarver
Copy link

Hi Adrian,

Just curious, is this open on the Processwire issues repo?

@adrianbj
Copy link
Author

Hi Steve - it's not, because I made this PR against a much older version of PW and Ryan sounded keen to implement more or less as is, even adding a ToDo tag to it. I happy to add a feature request on the new repo, but I'm not going to bother with an updated PR for obvious reasons :)

@netcarver
Copy link

Yep, understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants