By Gilles on Tuesday, 21 October 2014
Posted in Technical Issues
Likes 0
Views 589
Votes 0
Hi Folks, How do I move a comment from one blog post to another in my EB Pro?

A user commented on the wrong post and am hoping there is a simple method of moving it.

Cheers,
Gilles
Hello Gilles,

There is no simple method to move comment in Easyblog comment. I would advise you to re create the comment in the other blog post manually.
·
Tuesday, 21 October 2014 10:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Nik, I found an easier method.... simply change the post-id field of the comment record in the table.
Brings up a new question.
This comment that I moved appears indented, that is, as a child of a another comment. Or indented under a previous comment as if it had been replied to the comment.

Q. Which database table, field and value must I edit in order to make this comment appear as a top level comment, not as a "reply" or child of another?

Thanks!
G
·
Tuesday, 21 October 2014 18:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello G,

That's is what I meant by 'no simple method'. Because of this child-parent id. As you can see in this screenshot: http://screencast.com/t/cMqeuVebJH .

The first highlighted column is the parent_id and the second column are the lft and rgt. The idea is the top most highlighted row is the parent with the ID:3. The other 3 rows are the child. You can see the lft and rgt column:

Start with 1 (Parent),
2 (first child)-3 (first child),
4 (second child)-5 (second child),
6 (third child)-7 (third child),
End with 8 (Parent)

Hope this helps.
·
Tuesday, 21 October 2014 19:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks, I don't quite get it.
Does lft mean Left and rgt mean Right?
The Ids you refer to in the columns, are they comment IDs or post IDs?

Si if I want a comment to be at the top level, what would I need the three columns to be?

Cheers!
·
Tuesday, 21 October 2014 19:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Gilles,

Take a look at the post here, http://www.sitepoint.com/hierarchical-data-database-2/ It should give you a better idea of this algorithm
·
Tuesday, 21 October 2014 23:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks! Very insightful.

Very interesting. Now I understand why it isn't as simple as it looks.
Since I moved two comments to this particular post by simply changing the parent post ID, and didn't touch any of the left and right values for either these two new posts or the parent node, will this mess up anything?
Is there a way to force a "rebuild-tree"??? or am I ok to just leave things as they now are?
Gilles
·
Wednesday, 22 October 2014 00:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Update:
Thanks to you both (and the article on the structure) I was able to fix my issue and place three comments in the top level of this particular post. I used another post with comments as a guide (using PHPmyadmin) to see what the entries should be.

The one difference I see is that I left the parent id = 0. In the examples, it isn't zero. It was set to zero for the other comment set I used as a guide, in the database. Comments which had not been moved but entered correctly for another post.

Is this an issue? is a value of "0" for the parent-id OK?
Cheers,
G
·
Wednesday, 22 October 2014 00:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Gilles,

Ideally the parent id should be the parent's comment id
·
Wednesday, 22 October 2014 01:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks.
I understand but what if we're talking about a top level comment? one which doesn't have a parent comment but only a parent post?
(I hope this makes sense)
·
Wednesday, 22 October 2014 02:05
·
0 Likes
·
0 Votes
·
0 Comments
·
If the comment is not a child comment, the parent_id should be 0
·
Wednesday, 22 October 2014 12:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect! I'm good to go.
Thanks for this and for the helping me learn hierarchical storage
Gilles
·
Wednesday, 22 October 2014 18:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Gilles,

You're welcome.
·
Wednesday, 22 October 2014 19:59
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post