schmunk42 / yii2-extension-requests

Ideas "marketplace" for Yii 2 extensions
18 stars 0 forks source link

Comment Module #3

Open cebe opened 10 years ago

cebe commented 10 years ago

May port this one if I have time: https://github.com/yiiext/comment-module

samdark commented 10 years ago

I can handle it. Have a good idea on how comments should be implemented and will need it for my blog.

cebe commented 10 years ago

I'll also need it in one of my projects so who ever comes first ;)

schmunk42 commented 10 years ago

Join your efforts! :) That's another purpose of this repo.

Von meinem iPhone gesendet

Am 26.03.2014 um 14:03 schrieb Carsten Brandt notifications@github.com:

I'll also need it in one of my projects so who ever comes first ;)

— Reply to this email directly or view it on GitHub.

samdark commented 10 years ago

If you'll do it first make sure you're using simple id-parent_id storage. That's more than enough for fast recursive rendering with only a single DB query. Also It will allow using noSQL backends.

cebe commented 10 years ago

will do.

schmunk42 commented 10 years ago

And as an AR behavior it would be awesome ;) https://github.com/phundament/yii2-extension-requests/issues/7

samdark commented 10 years ago

@schmunk42 which part? Traversing?

schmunk42 commented 10 years ago

Yes, roots(), descendants(), children(), ... I am unsure about this one: https://github.com/creocoder/yii2-nested-set-behavior#getting-the-whole-tree

and insertAfter(), prependTo(), ... if possible, but you'd need an additional rank column.

samdark commented 10 years ago

Well, for comments there's no need for rank column and I'm not sure all these extras are needed as well. It may build upon such behavior but public API should not depend on it.

schmunk42 commented 10 years ago

IMHO The rank column for a comments table would be the create date, it's just about ordering the descendants. This should just be configurable in the behavior. Maybe some methods are not available in certain configs.

We can do this step-by-step.

Von meinem iPhone gesendet

Am 26.03.2014 um 20:29 schrieb Alexander Makarov notifications@github.com:

Well, for comments there's no need for rank column and I'm not sure all these extras are needed as well. It may build upon such behavior but public API should not depend on it.

— Reply to this email directly or view it on GitHub.

samdark commented 10 years ago

In case of comment you can safely order by id.

philippfrenzel commented 10 years ago

pls add anonymous comments if possible...

kartik-v commented 10 years ago

Wish list:

schmunk42 commented 10 years ago
samdark commented 10 years ago

signatures in comments? It's not a forum...

kartik-v commented 10 years ago

@samdark - possibly yes... but its a good option to have for applications where user/community participation is large ... which may lead to a question why not use a forum for that? We then are talking about a totally different (forum) extension for such a small need then...

samdark commented 10 years ago

I think ability to use custom data source/view for comments will cover it (and much more) well.

samdark commented 10 years ago

A widget displaying comments can work with interface such as:

interface CommentInterface
{
    public function getId();
    public function getParentId();
    public function getTimestamp();

    public function getUserName();
    public function getUserEmail();
    public function getUserUrl();

    public function getHtml();
    public function getSource();
}

It will allow you to implement such an interface for any model.