Want to use FE user as Comment Author in blog...

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
billandsonia
Forum Members
Forum Members
Posts: 13
Joined: Mon Apr 21, 2008 5:40 pm

Want to use FE user as Comment Author in blog...

Post by billandsonia »

I've set up FE users, custom content, and blogs. I have them working together, in that comments appear to all users, but I've modified the "add comments template" to only allow logged in FE users to post new comments. Works great, looks great. Now I want to do away with the "comment author" field on the front end, and substitute the username from FE users for that field on the back end. That way, only logged in users can comment, and they don't need to enter their name with each comment.

1) Is there an easy way to do this that I've overlooked?

2) I've been tinkering with the php, which has me a little nervous, as I'm not a coder, but here's what I've put in...

Code: Select all

if ($customcontent_loggedin > 0) {
  $author=$customcontent_loginname;
} elseif (!isset($params["author"]) || $params["author"]=="") {
	$params["module_error"]=$this->Lang("missingcommentauthor");
	$this->Redirect($id, 'showentry', $returnid,$params);
} else {
	$author=$params["author"];
}


which simply adds the test for $customcontent_loggedin greater than one - if so make the author name equal to $customcontent_loginname. In practice, it does nothing, though.

I've probably mashed up smarty variables with the php code, and I'm hoping there's a simpler way around. Thanks for any help.

BTW, thanks to whomever moved this post from the wrong category to the right one.
Last edited by billandsonia on Mon May 12, 2008 4:10 pm, edited 1 time in total.
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Want to use FE user as Comment Author in blog...

Post by sn3p »

Check this post for the solution.
Post Reply

Return to “Modules/Add-Ons”