Want to use FE user as Comment Author in blog...
Posted: Mon May 12, 2008 3:53 pm
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...
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.
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.