Attribute CGFeedback comments to logged in FEUser [SOLVED]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

Attribute CGFeedback comments to logged in FEUser [SOLVED]

Post by tophers »

I'm looking for a way to attribute a comment to the logged in Front End User - I have CGFeedback hooked up to CGBlog on an extranet site, so ALL users will be logged in. Rather than have then fill in more fields, I'd like to pull in the user's information, both for display on the site and for admin purposes (tracking of comments). Ideally I would capture 'firstname', 'lastname' (which could be combined into a 'Name' field, but sin't necessary) and 'email'. The client doesn't want the comments system to be anonymous, but we don't want to rely on them to provide the information.

I'm sure this has been answered somewhere, but my searches haven't turned up anything useful so far. I'm running the latest version of the CMS, CGBlog and CGFeedback - it's a new site under development.
Last edited by tophers on Thu Jul 18, 2013 3:41 pm, edited 1 time in total.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Attribute CGFeedback comments to logged in FEUser

Post by Jo Morg »

I believe that the CustomContent module provides the means to extract that data from the logged in user.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Attribute CGFeedback comments to logged in FEUser

Post by calguy1000 »

This is not difficult.

You can use the methods/plugins from FEU/CustomContent to popuplate the author and email fields of the CGFeedback comment form.

You could then make these fields read only, or hidden... but not disabled.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

Re: Attribute CGFeedback comments to logged in FEUser

Post by tophers »

That's what I was thinking - here's what I have working now:

Code: Select all

{capture assign='author_name'}{ccUser::property('firstname')} {ccUser::property('lastname')}{/capture}
{capture assign='author_email'}{ccUser::property('email')}{/capture}
In conjunction with this:

Code: Select all

  {* Assign FEU info to Comment *}
        <input type="hidden" name="{$actionid}author_name" value="{$author_name}"/>
        <input type="hidden" name="{$actionid}author_email"value="{$author_email}"/>
Does this seem like the best solution? Or have I overly complicated matters?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Attribute CGFeedback comments to logged in FEUser

Post by calguy1000 »

that's what I would do, unless I could find a way to not use 'capture' (it's very slow).

{$author_email=ccuser::get_property('email')} would be better.

or

<input type="hidden" name="{$actionid}author_name" value="{ccuser::get_property('firstname')} {ccuser::get_property('lastname')}"/>
<input type="hidden" name="{$actionid}author_email" value="{ccuser::get_property('email')}"/>
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Modules/Add-Ons”