Coder Social home page Coder Social logo

yiiext / comment-module Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 11.0 145 KB

Module that adds comments to your application. You can add comments on any AR Model you like.

Home Page: http://yiiext.github.com/extensions/comment-module/index.html

PHP 100.00%

comment-module's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comment-module's Issues

model table name

change to
public function tableName()
{
return '{{comments}}';
}
Or to take out in module options

Do not work option - "delete"

Hi!
I've installed your app comment-module for yii-framework. This is only the beginning of my learning web development, and I can not understand why I do not work comment-option-delete? If you're not hard, help in what could be the reason.

I really hope for your answer!

Its my config:
'comment'=>array(
'class'=>'ext.comment-module.CommentModule',
'commentableModels'=>array(
// define commentable Models here (key is an alias that must be lower case, value is the model class name)
'event'=>'Event'
),
// set this to the class name of the model that represents your users
'userModelClass'=>'User',
// set this to the username attribute of User model class
'userNameAttribute'=>'username',
// set this to the email attribute of User model class
'userEmailAttribute'=>'email',
// you can set controller filters that will be added to the comment controller {@see CController::filters()}
// 'controllerFilters'=>array(),
// you can set accessRules that will be added to the comment controller {@see CController::accessRules()}
// 'controllerAccessRules'=>array(),
// you can extend comment class and use your extended one, set path alias here
// 'commentModelClass'=>'comment.models.Comment',
),

This is my dump database:
Это мой dump database:
CREATE TABLE IF NOT EXISTS comments (
id int(11) NOT NULL AUTO_INCREMENT,
message text COLLATE utf8_unicode_ci,
userId int(11) NOT NULL,
createDate datetime DEFAULT NULL,
PRIMARY KEY (id),
KEY fk_comments_userId (userId),
CONSTRAINT FK_user_users FOREIGN KEY (userId) REFERENCES tbl_users (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

 CREATE TABLE IF NOT EXISTS `comment_event` (
  `eventId`    int(11) NOT NULL,
  `commentId` int(11) NOT NULL,
  PRIMARY KEY (`eventId`,`commentId`),
 CONSTRAINT `FK_coments_event_comment` FOREIGN KEY (`commentId`) REFERENCES `comments` (`id`),

CONSTRAINT FK_comments_event FOREIGN KEY (eventId) REFERENCES event (id) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Sincerely, Dmitry Gorbachev.
from Ukraine

redesign database layout

There are currently problems with updating Comments.
It is not easy to find out to which Model a comment belongs.
Therefore onUpdateComment and onDeleteComment Events currently has no related record

Can not run.

Thank you very much your COMMENT-the MODULES. Problems encountered in use. There have been errors: Event IssueController.onAfterConstruct, "is not defined.
Do I want to how to resolve this error?

replace the field name

file: yiiext/comment-module/blob/master/README.md

CREATE TABLE IF NOT EXISTS posts_comments_nm (
postId int(11) UNSIGNED NOT NULL,
commentId int(11) UNSIGNED NOT NULL,
PRIMARY KEY (taskId,commentId),
KEY fk_tasks_comments_comments (commentId),
KEY fk_tasks_comments_tasks (taskId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

in line PRIMARY KEY (taskId,commentId),

taskId should be replaced by postId

nested comments

Have you had any milestone for this feature? Adding nested comment seems to be a great feature to be opt-in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.