Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Comments seem to be automatically approved. How do I change this so that the admin approves them?
I have added to the NewComment Event Handler, it sends an email, but don't get the ID of the Comment which would be useful to make further changes.
Guess you'll have to customize the source for you needs, you can find it here http://ucomment.codeplex.com
ok, wanted to check first that I wasn't missing anything, thanks.
Strange, because looking at the source code, the ID should be set before, so don't know why it isn't being passed through to OnCommentCreated
Yeah looks like it,time to debug then ;)
I am just using
sender.Id.ToString()
in
public void NewComment(Comment sender, EventArgs e) {}
but its coming out as '0'
I see its this
line 146: c.Id = sqlHelper.ExecuteScalar<int>(..
it returns null
Fixed:
Need to change this in Cooment.cs:
c.Id = sqlHelper.ExecuteScalar<int>( @"insert into Comment(mainid,nodeid,name,email,website,comment,spam,created) values(@mainid,@nodeid,@name,@email,@website,@comment,@spam,@created) SELECT CAST(scope_identity() AS int)", sqlHelper.CreateParameter("@mainid", -1), sqlHelper.CreateParameter("@nodeid", c.ParentNodeId), sqlHelper.CreateParameter("@name", c.Name), sqlHelper.CreateParameter("@email", c.Email), sqlHelper.CreateParameter("@website", c.Website), sqlHelper.CreateParameter("@comment", c.CommenText), sqlHelper.CreateParameter("@spam", c.Spam), sqlHelper.CreateParameter("@created", c.Created), sqlHelper.CreateParameter("@approved", c.Approved), sqlHelper.CreateParameter("@thumbsUp", 0), sqlHelper.CreateParameter("@thumbsDown", 0));
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Do not auto-approve comments
Comments seem to be automatically approved. How do I change this so that the admin approves them?
I have added to the NewComment Event Handler, it sends an email, but don't get the ID of the Comment which would be useful to make further changes.
Guess you'll have to customize the source for you needs, you can find it here http://ucomment.codeplex.com
ok, wanted to check first that I wasn't missing anything, thanks.
Strange, because looking at the source code, the ID should be set before, so don't know why it isn't being passed through to OnCommentCreated
Yeah looks like it,time to debug then ;)
I am just using
sender.Id.ToString()
in
public void NewComment(Comment sender, EventArgs e)
{}
but its coming out as '0'
I see its this
line 146: c.Id = sqlHelper.ExecuteScalar<int>(..
it returns null
Fixed:
Need to change this in Cooment.cs:
c.Id = sqlHelper.ExecuteScalar<int>(
@"insert into Comment(mainid,nodeid,name,email,website,comment,spam,created)
values(@mainid,@nodeid,@name,@email,@website,@comment,@spam,@created)
SELECT CAST(scope_identity() AS int)",
sqlHelper.CreateParameter("@mainid", -1),
sqlHelper.CreateParameter("@nodeid", c.ParentNodeId),
sqlHelper.CreateParameter("@name", c.Name),
sqlHelper.CreateParameter("@email", c.Email),
sqlHelper.CreateParameter("@website", c.Website),
sqlHelper.CreateParameter("@comment", c.CommenText),
sqlHelper.CreateParameter("@spam", c.Spam),
sqlHelper.CreateParameter("@created", c.Created),
sqlHelper.CreateParameter("@approved", c.Approved),
sqlHelper.CreateParameter("@thumbsUp", 0),
sqlHelper.CreateParameter("@thumbsDown", 0));
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.