mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 12:49:55 +09:00
merge from 1.5.2
git-svn-id: http://xe-core.googlecode.com/svn/trunk@10446 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
6c23751ef8
commit
c727926d9e
382 changed files with 6855 additions and 3603 deletions
|
|
@ -12,7 +12,143 @@
|
|||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Modify comment(s) status to publish/unpublish if calling module is using Comment Approval System
|
||||
* @return Object
|
||||
*/
|
||||
function procCommentAdminChangePublishedStatusChecked()
|
||||
{ // Error display if none is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart))
|
||||
{
|
||||
$comment_srl_list= explode('|@|', $cart);
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment_srl_list = $cart;
|
||||
}
|
||||
|
||||
$this->procCommentAdminChangeStatus();
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_keyword', '');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function procCommentAdminChangeStatus()
|
||||
{
|
||||
$will_publish = Context::get('will_publish');
|
||||
|
||||
// Error display if none is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart)
|
||||
{
|
||||
return $this->stop('msg_cart_is_null');
|
||||
}
|
||||
if(!is_array($cart))
|
||||
{
|
||||
$comment_srl_list= explode('|@|', $cart);
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment_srl_list = $cart;
|
||||
}
|
||||
|
||||
$args->status = $will_publish;
|
||||
$args->comment_srls_list = $comment_srl_list;
|
||||
$output = executeQuery('comment.updatePublishedStatus', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
//update comment count for document
|
||||
$updated_documents_arr = array();
|
||||
// create the controller object of the document
|
||||
$oDocumentController = &getController('document');
|
||||
// create the model object of the document
|
||||
$oDocumentModel = &getModel('document');
|
||||
// create the comment model object
|
||||
$oCommentModel = &getModel('comment');
|
||||
//get admin info
|
||||
$logged_info = Context::get('logged_info');
|
||||
//$oMemberModule = &getModel("member");
|
||||
//$logged_info = $oMemberModule->getMemberInfoByMemberSrl($logged_member_srl);
|
||||
$new_status = ($will_publish) ? "published" : "unpublished";
|
||||
foreach($comment_srl_list as $comment_srl)
|
||||
{
|
||||
// check if comment already exists
|
||||
$comment = $oCommentModel->getComment($comment_srl);
|
||||
if($comment->comment_srl != $comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
$document_srl = $comment->document_srl;
|
||||
if (!in_array($document_srl,$updated_documents_arr))
|
||||
{
|
||||
$updated_documents_arr[] = $document_srl;
|
||||
// update the number of comments
|
||||
$comment_count = $oCommentModel->getCommentCount($document_srl);
|
||||
// update comment count of the article posting
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, null, false);
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
$author_email=$oDocument->variables['email_address'];
|
||||
|
||||
$oModuleModel = &getModel("module");
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($comment->module_srl);
|
||||
$already_sent = array();
|
||||
|
||||
// send email to comment's author, all admins and thread(document) subscribers - START
|
||||
// -------------------------------------------------------
|
||||
$oMail = new Mail();
|
||||
$mail_title = "[XE - ".$module_info->mid."] comment(s) status changed to ".$new_status." on document: \"".$oDocument->getTitleText()."\"";
|
||||
$oMail->setTitle($mail_title);
|
||||
$mail_content = "
|
||||
The comment #".$comment_srl." on document \"".$oDocument->getTitleText()."\" has been ".$new_status." by admin of <strong><i>". strtoupper($module_info->mid)."</i></strong> module.
|
||||
<br />
|
||||
<br />Comment content:
|
||||
".$comment->content."
|
||||
<br />
|
||||
";
|
||||
$oMail->setContent($mail_content);
|
||||
$oMail->setSender($logged_info->user_name, $logged_info->email_address);
|
||||
|
||||
$document_author_email = $oDocument->variables['email_address'];
|
||||
|
||||
//mail to author of thread - START
|
||||
if($document_author_email != $comment->email_address && $logged_info->email_address != $document_author_email) {
|
||||
$oMail->setReceiptor($document_author_email, $document_author_email);
|
||||
$oMail->send();
|
||||
$already_sent[] = $document_author_email;
|
||||
}
|
||||
//mail to author of thread - STOP
|
||||
|
||||
//mail to all emails set for administrators - START
|
||||
if($module_info->admin_mail)
|
||||
{
|
||||
$target_mail = explode(',',$module_info->admin_mail);
|
||||
for($i=0;$i<count($target_mail);$i++) {
|
||||
$email_address = trim($target_mail[$i]);
|
||||
if(!$email_address) continue;
|
||||
if($author_email != $email_address) {
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
}
|
||||
}
|
||||
//mail to all emails set for administrators - STOP
|
||||
}
|
||||
// ----------------------------------------------------------
|
||||
// send email to comment's author, all admins and thread(document) subscribers - STOP
|
||||
}
|
||||
// call a trigger for calling "send mail to subscribers" (for moment just for forum)
|
||||
ModuleHandler::triggerCall("comment.procCommentAdminChangeStatus","after",$comment_srl_list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Delete the selected comment from the administrator page
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -25,18 +25,35 @@
|
|||
$args->sort_index = 'list_order'; // /< Sorting values
|
||||
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
|
||||
/*
|
||||
$search_target = Context::get('search_target');
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
if ($search_target == 'is_published' && $search_keyword == 'Y')
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
if ($search_target == 'is_published' && $search_keyword == 'N')
|
||||
{
|
||||
$args->status = 0;
|
||||
}
|
||||
*/
|
||||
|
||||
// get a list by using comment->getCommentList.
|
||||
$oCommentModel = &getModel('comment');
|
||||
$secretNameList = $oCommentModel->getSecretNameList();
|
||||
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress');
|
||||
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress');
|
||||
$output = $oCommentModel->getTotalCommentList($args, $columnList);
|
||||
|
||||
|
||||
$oCommentModel = &getModel("comment");
|
||||
$modules = $oCommentModel->getDistinctModules();
|
||||
$modules_list = $modules;
|
||||
|
||||
// set values in the return object of comment_model:: getTotalCommentList() in order to use a template.
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('comment_list', $output->data);
|
||||
Context::set('modules_list', $modules_list);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('secret_name_list', $secretNameList);
|
||||
// set the template
|
||||
|
|
|
|||
|
|
@ -57,7 +57,16 @@
|
|||
|
||||
if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
return true;
|
||||
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!$oDB->isIndexExists("comments", "idx_status"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +102,7 @@
|
|||
}
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point"))
|
||||
$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, true);
|
||||
|
||||
|
||||
if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
$oDB->addIndex
|
||||
(
|
||||
|
|
@ -103,6 +112,19 @@
|
|||
true
|
||||
);
|
||||
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status")) {
|
||||
$oDB->addColumn("comments", "status", "number", 1, 1, true);
|
||||
}
|
||||
if (!$oDB->isIndexExists("comments", "idx_status"))
|
||||
$oDB->addIndex
|
||||
(
|
||||
"comments",
|
||||
"idx_status",
|
||||
array("status", "comment_srl", "module_srl", "document_srl"),
|
||||
true
|
||||
);
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,11 +98,62 @@
|
|||
$_SESSION['own_comment'][$comment_srl] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
*@brief Check if module is using comment validation system
|
||||
* @param number $document_srl
|
||||
* @return boolean
|
||||
*/
|
||||
function isModuleUsingPublishValidation($document_srl=null, $module_srl=null)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
$module_part_config = $oModuleModel->getModulePartConfig('comment',$module_info->module_srl);
|
||||
$use_validation = false;
|
||||
if (isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y")
|
||||
{
|
||||
$use_validation = true;
|
||||
}
|
||||
return $use_validation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enter comments
|
||||
**/
|
||||
function insertComment($obj, $manual_inserted = false) {
|
||||
$obj->__isupdate = false;
|
||||
|
||||
// check if comment's module is using comment validation and set the publish status to 0 (false)
|
||||
// for inserting query, otherwise default is 1 (true - means comment is published)
|
||||
$using_validation = $this->isModuleUsingPublishValidation($obj->module_srl);
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if ($logged_info->is_admin == 'Y')
|
||||
{
|
||||
$is_admin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_admin = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$using_validation)
|
||||
{
|
||||
$obj->status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($is_admin)
|
||||
{
|
||||
$obj->status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$obj->__isupdate = false;
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -195,7 +246,7 @@
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('comment.insertCommentList', $list_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
// insert comment
|
||||
|
|
@ -211,7 +262,17 @@
|
|||
// create the controller object of the document
|
||||
$oDocumentController = &getController('document');
|
||||
// Update the number of comments in the post
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, true);
|
||||
if (!$using_validation)
|
||||
{
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($is_admin)
|
||||
{
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, true);
|
||||
}
|
||||
}
|
||||
// grant autority of the comment
|
||||
$this->addGrant($obj->comment_srl);
|
||||
// call a trigger(after)
|
||||
|
|
@ -238,6 +299,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
$this->sendEmailToAdminAfterInsertComment($obj);
|
||||
|
||||
|
||||
$output->add('comment_srl', $obj->comment_srl);
|
||||
//remove from cache
|
||||
|
|
@ -249,7 +312,128 @@
|
|||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send email to module's admins after a new comment was interted successfully
|
||||
* if Comments Approval System is used
|
||||
* @param type $obj
|
||||
*/
|
||||
function sendEmailToAdminAfterInsertComment($obj)
|
||||
{
|
||||
$using_validation = $this->isModuleUsingPublishValidation($obj->module_srl);
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
|
||||
|
||||
$oMemberModel = &getModel("member");
|
||||
if (isset($obj->member_srl) && !is_null($obj->member_srl))
|
||||
{
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$member_info->is_admin = "N";
|
||||
$member_info->nick_name = $obj->nick_name;
|
||||
$member_info->user_name = $obj->user_name;
|
||||
$member_info->email_address = $obj->email_address;
|
||||
}
|
||||
|
||||
$oCommentModel = &getModel("comment");
|
||||
$nr_comments_not_approved = $oCommentModel->getCommentAllCount(null,false);
|
||||
$oModuleModel = &getModel("module");
|
||||
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl);
|
||||
// If there is no problem to register comment then send an email to all admin were set in module admin panel
|
||||
if($module_info->admin_mail && $member_info->is_admin != 'Y')
|
||||
{
|
||||
$oMail = new Mail();
|
||||
$oMail->setSender($obj->email_address, $obj->email_address);
|
||||
$mail_title = "[XE - ".Context::get('mid')."] A new comment was posted on document: \"".$oDocument->getTitleText()."\"";
|
||||
$oMail->setTitle($mail_title);
|
||||
if ($using_validation)
|
||||
{
|
||||
$url_approve = getFullUrl('','module','comment','act','procCommentAdminChangePublishedStatusChecked','cart[]',$obj->comment_srl,'will_publish','1','search_target','is_published','search_keyword','N');
|
||||
$url_trash = getFullUrl('','module','comment','act','procCommentAdminDeleteChecked','cart[]',$obj->comment_srl,'search_target','is_trash','search_keyword','true');
|
||||
$mail_content = "
|
||||
A new comment on the document \"".$oDocument->getTitleText()."\" is waiting for your approval.
|
||||
<br />
|
||||
<br />
|
||||
Author: ".$member_info->nick_name."
|
||||
<br />Author e-mail: ".$member_info->email_address."
|
||||
<br />Comment:
|
||||
<br />\"".$obj->content."\"
|
||||
<br />
|
||||
<br />
|
||||
Approve it: <a href=\"".$url_approve."\">".$url_approve."</a>
|
||||
<br />Trash it: <a href=\"".$url_trash."\">".$url_trash."</a>
|
||||
<br />Currently ".$nr_comments_not_approved." comments on \"".Context::get('mid')."\" module are waiting for approval. Please visit the moderation panel:
|
||||
<br /><a href=\"".getFullUrl('','module','admin','act','dispCommentAdminList','search_target','module','search_keyword',$obj->module_srl)."\">".getFullUrl('','module','admin','act','dispCommentAdminList','search_target','module','search_keyword',$obj->module_srl)."</a>
|
||||
";
|
||||
$oMail->setContent($mail_content);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mail_content = "
|
||||
Author: ".$member_info->nick_name."
|
||||
<br />Author e-mail: ".$member_info->email_address."
|
||||
<br />Comment:
|
||||
<br />\"".$obj->content."\"
|
||||
";
|
||||
$oMail->setContent($mail_content);
|
||||
// get email of thread's author
|
||||
$document_author_email = $oDocument->variables['email_address'];
|
||||
//get admin info
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
//mail to author of thread - START
|
||||
if($document_author_email != $obj->email_address && $logged_info->email_address != $document_author_email) {
|
||||
$oMail->setReceiptor($document_author_email, $document_author_email);
|
||||
$oMail->send();
|
||||
}
|
||||
// mail to author of thread - STOP
|
||||
}
|
||||
|
||||
// get all admins emails
|
||||
$admins_emails = $module_info->admin_mail;
|
||||
$target_mail = explode(',',$admins_emails);
|
||||
|
||||
// send email to all admins - START
|
||||
for($i=0;$i<count($target_mail);$i++)
|
||||
{
|
||||
$email_address = trim($target_mail[$i]);
|
||||
if(!$email_address) continue;
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
// send email to all admins - STOP
|
||||
}
|
||||
|
||||
$comment_srl_list = array(0 => $obj->comment_srl);
|
||||
// call a trigger for calling "send mail to subscribers" (for moment just for forum)
|
||||
ModuleHandler::triggerCall("comment.sendEmailToAdminAfterInsertComment","after",$comment_srl_list);
|
||||
|
||||
/*
|
||||
// send email to author - START
|
||||
$oMail = new Mail();
|
||||
$mail_title = "[XE - ".Context::get('mid')."] your comment on document: \"".$oDocument->getTitleText()."\" have to be approved";
|
||||
$oMail->setTitle($mail_title);
|
||||
//$mail_content = sprintf("From : <a href=\"%s?document_srl=%s&comment_srl=%s#comment_%d\">%s?document_srl=%s&comment_srl=%s#comment_%d</a><br/>\r\n%s ", getFullUrl(''),$comment->document_srl,$comment->comment_srl,$comment->comment_srl, getFullUrl(''),$comment->document_srl,$comment->comment_srl,$comment->comment_srl,$comment>content);
|
||||
$mail_content = "
|
||||
Your comment #".$obj->comment_srl." on document \"".$oDocument->getTitleText()."\" have to be approved by admin of <strong><i>". strtoupper($module_info->mid)."</i></strong> module before to be publish.
|
||||
<br />
|
||||
<br />Comment content:
|
||||
".$obj->content."
|
||||
<br />
|
||||
";
|
||||
$oMail->setContent($mail_content);
|
||||
$oMail->setSender($obj->email_address, $obj->email_address);
|
||||
$oMail->setReceiptor($obj->email_address, $obj->email_address);
|
||||
$oMail->send();
|
||||
// send email to author - START
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief fix the comment
|
||||
**/
|
||||
|
|
@ -403,15 +587,15 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief remove all comment relation log
|
||||
**/
|
||||
function deleteCommentLog()
|
||||
{
|
||||
$this->_deleteDeclaredComments($args);
|
||||
$this->_deleteVotedComments($args);
|
||||
return new Object(0, 'success');
|
||||
}
|
||||
/**
|
||||
* @brief remove all comment relation log
|
||||
**/
|
||||
function deleteCommentLog()
|
||||
{
|
||||
$this->_deleteDeclaredComments($args);
|
||||
$this->_deleteVotedComments($args);
|
||||
return new Object(0, 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief remove all comments of the article
|
||||
|
|
@ -636,7 +820,10 @@
|
|||
|
||||
$comment_config->use_vote_down = Context::get('use_vote_down');
|
||||
if(!$comment_config->use_vote_down) $comment_config->use_vote_down = 'Y';
|
||||
|
||||
|
||||
$comment_config->use_comment_validation = Context::get('use_comment_validation');
|
||||
if(!$comment_config->use_comment_validation) $comment_config->use_comment_validation = 'N';
|
||||
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
|
|
@ -658,35 +845,35 @@
|
|||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get comment all list
|
||||
**/
|
||||
function procCommentGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
$commentSrls = Context::get('comment_srls');
|
||||
if($commentSrls) $commentSrlList = explode(',', $commentSrls);
|
||||
/**
|
||||
* @brief get comment all list
|
||||
**/
|
||||
function procCommentGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
$commentSrls = Context::get('comment_srls');
|
||||
if($commentSrls) $commentSrlList = explode(',', $commentSrls);
|
||||
|
||||
if(count($commentSrlList) > 0) {
|
||||
$oCommentModel = &getModel('comment');
|
||||
$commentList = $oCommentModel->getComments($commentSrlList);
|
||||
if(count($commentSrlList) > 0) {
|
||||
$oCommentModel = &getModel('comment');
|
||||
$commentList = $oCommentModel->getComments($commentSrlList);
|
||||
|
||||
if(is_array($commentList))
|
||||
if(is_array($commentList))
|
||||
{
|
||||
foreach($commentList AS $key=>$value)
|
||||
{
|
||||
foreach($commentList AS $key=>$value)
|
||||
{
|
||||
$value->content = strip_tags($value->content);
|
||||
}
|
||||
$value->content = strip_tags($value->content);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
global $lang;
|
||||
$commentList = array();
|
||||
$this->setMessage($lang->no_documents);
|
||||
}
|
||||
|
||||
$this->add('comment_list', $commentList);
|
||||
}
|
||||
else
|
||||
{
|
||||
global $lang;
|
||||
$commentList = array();
|
||||
$this->setMessage($lang->no_documents);
|
||||
}
|
||||
|
||||
$this->add('comment_list', $commentList);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -183,12 +183,17 @@
|
|||
}
|
||||
// if additional information which can access contents is set
|
||||
if($add_content_info) {
|
||||
$memberSrl = $this->get('member_srl');
|
||||
if($memberSrl < 0)
|
||||
{
|
||||
$memberSrl = 0;
|
||||
}
|
||||
$content = sprintf(
|
||||
'<!--BeforeComment(%d,%d)--><div class="comment_%d_%d xe_content">%s</div><!--AfterComment(%d,%d)-->',
|
||||
$this->comment_srl, $this->get('member_srl'),
|
||||
$this->comment_srl, $this->get('member_srl'),
|
||||
$this->comment_srl, $memberSrl,
|
||||
$this->comment_srl, $memberSrl,
|
||||
$content,
|
||||
$this->comment_srl, $this->get('member_srl')
|
||||
$this->comment_srl, $memberSrl
|
||||
);
|
||||
// xe_content class name should be specified although content access is not necessary.
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@
|
|||
if(is_array($comment_srl_list)) $comment_srls = implode(',',$comment_srl_list);
|
||||
// fetch from a database
|
||||
$args->comment_srls = $comment_srls;
|
||||
$output = executeQuery('comment.getComments', $args, $columnList);
|
||||
$output = executeQuery('comment.getComments', $args, $columnList);
|
||||
if(!$output->toBool()) return;
|
||||
$comment_list = $output->data;
|
||||
if(!$comment_list) return;
|
||||
|
|
@ -143,6 +143,23 @@
|
|||
**/
|
||||
function getCommentCount($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
|
||||
// get the number of comments on the document module
|
||||
$oDocumentModel = &getModel('document');
|
||||
$columnList = array('document_srl', 'module_srl');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, true, $columnList);
|
||||
// return if no doc exists.
|
||||
if(!$oDocument->isExists()) return;
|
||||
// get a list of comments
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
//check if module is using validation system
|
||||
$oCommentController = &getController('comment');
|
||||
$using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
|
||||
if($using_validation)
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
|
||||
$output = executeQuery('comment.getCommentCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
return (int)$total_count;
|
||||
|
|
@ -164,14 +181,52 @@
|
|||
/**
|
||||
* @brief get the total number of comments in corresponding with module_srl.
|
||||
**/
|
||||
function getCommentAllCount($module_srl) {
|
||||
function getCommentAllCount($module_srl,$published=null) {
|
||||
$args->module_srl = $module_srl;
|
||||
|
||||
if(is_null($published))
|
||||
{
|
||||
// check if module is using comment validation system
|
||||
$oCommentController = &getController("comment");
|
||||
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
|
||||
if($is_using_validation)
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($published)
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->status = 0;
|
||||
}
|
||||
}
|
||||
$output = executeQuery('comment.getCommentCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
function getDistinctModules()
|
||||
{
|
||||
$output = executeQuery('comment.getDistinctModules');
|
||||
$module_srls = $output->data;
|
||||
$oModuleModel = &getModel('module');
|
||||
$result = array();
|
||||
if($module_srls)
|
||||
{
|
||||
foreach($module_srls as $module)
|
||||
{
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module->module_srl);
|
||||
$result[$module->module_srl] = $module_info->mid;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get the comment in corresponding with mid.
|
||||
|
|
@ -195,6 +250,17 @@
|
|||
$output = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$output){
|
||||
|
||||
if(strpos($args->module_srl,",")===false)
|
||||
{
|
||||
// check if module is using comment validation system
|
||||
$oCommentController = &getController("comment");
|
||||
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
|
||||
if($is_using_validation)
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
}
|
||||
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
}
|
||||
|
|
@ -255,6 +321,16 @@
|
|||
$args->list_count = $comment_count;
|
||||
$args->page = $page;
|
||||
$args->page_count = 10;
|
||||
|
||||
//check if module is using validation system
|
||||
$oCommentController = &getController('comment');
|
||||
$using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
|
||||
if($using_validation)
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQueryArray('comment.getCommentPageList', $args);
|
||||
// return if an error occurs in the query results
|
||||
if(!$output->toBool()) return;
|
||||
|
|
@ -366,6 +442,15 @@
|
|||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$args->s_module_srl = $obj->module_srl;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
|
||||
// check if module is using comment validation system
|
||||
$oCommentController = &getController("comment");
|
||||
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
|
||||
if ($is_using_validation)
|
||||
{
|
||||
$args->s_is_published = 1;
|
||||
}
|
||||
|
||||
// Search options
|
||||
$search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target'));
|
||||
$search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword'));
|
||||
|
|
@ -408,7 +493,20 @@
|
|||
break;
|
||||
case 'is_secret' :
|
||||
$args->s_is_secret= $search_keyword;
|
||||
break;
|
||||
case 'is_published' :
|
||||
if($search_keyword == 'Y')
|
||||
{
|
||||
$args->s_is_published = 1;
|
||||
}
|
||||
if($search_keyword == 'N')
|
||||
{
|
||||
$args->s_is_published = 0;
|
||||
}
|
||||
break;
|
||||
case 'module':
|
||||
$args->s_module_srl = (int)$search_keyword;
|
||||
break;
|
||||
case 'member_srl' :
|
||||
$args->{"s_".$search_target} = (int)$search_keyword;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<title xml:lang="vi">Bình luận</title>
|
||||
<title xml:lang="es">Commentarios</title>
|
||||
<title xml:lang="ru">Комментарии</title>
|
||||
<title xml:lang="zh-TW">評論</title>
|
||||
<title xml:lang="zh-TW">回覆</title>
|
||||
<title xml:lang="tr">Yorum</title>
|
||||
<description xml:lang="ko">게시판이나 블로그등의 댓글을 관리하는 모듈입니다.</description>
|
||||
<description xml:lang="jp">掲示板やブログなどのコメントを管理するモジュールです。</description>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<description xml:lang="vi">Module quản lý bình luận của bài viết và sổ lưu niệm</description>
|
||||
<description xml:lang="es">Es el módulo para manejar commentarios en blog o boletínes.</description>
|
||||
<description xml:lang="ru">Модуль для управления комментариями форума/блога.</description>
|
||||
<description xml:lang="zh-TW">管理討論板或部落格評論的模組。</description>
|
||||
<description xml:lang="zh-TW">管理討論板或部落格回覆的模組。</description>
|
||||
<description xml:lang="tr">Pano ve blog yorumlarını yönetme modülü</description>
|
||||
<version>0.1</version>
|
||||
<date>2007-02-28</date>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<permissions>
|
||||
<grants />
|
||||
<permissions>
|
||||
<permission action="procCommentAdminAddCart" target="manager" />
|
||||
<permission action="procCommentGetList" target="manager" />
|
||||
</permissions>
|
||||
<actions>
|
||||
<action name="getCommentMenu" type="model" standalone="true" />
|
||||
<action name="dispCommentAdminList" type="view" admin_index="true" standalone="true" menu_name="comment" menu_index="true" />
|
||||
<action name="dispCommentAdminDeclared" type="view" standalone="true" menu_name="comment" />
|
||||
<action name="procCommentVoteUp" type="controller" standalone="true" />
|
||||
<action name="procCommentVoteDown" type="controller" standalone="true" />
|
||||
<action name="procCommentDeclare" type="controller" standalone="true" />
|
||||
<action name="getCommentVotedMemberList" type="model" standalone="true" />
|
||||
<action name="procCommentInsertModuleConfig" type="controller" standalone="true" ruleset="insertCommentModuleConfig" />
|
||||
<action name="procCommentAdminDeleteChecked" type="controller" standalone="true" ruleset="deleteChecked" />
|
||||
<action name="procCommentAdminCancelDeclare" type="controller" standalone="true" />
|
||||
<action name="procCommentAdminAddCart" type="controller" standalone="true" />
|
||||
<action name="procCommentGetList" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</permissions>
|
||||
<actions>
|
||||
<action name="getCommentMenu" type="model" standalone="true" />
|
||||
<action name="dispCommentAdminList" type="view" admin_index="true" standalone="true" menu_name="comment" menu_index="true" />
|
||||
<action name="dispCommentAdminDeclared" type="view" standalone="true" menu_name="comment" />
|
||||
<action name="procCommentVoteUp" type="controller" standalone="true" />
|
||||
<action name="procCommentVoteDown" type="controller" standalone="true" />
|
||||
<action name="procCommentDeclare" type="controller" standalone="true" />
|
||||
<action name="getCommentVotedMemberList" type="model" standalone="true" />
|
||||
<action name="procCommentInsertModuleConfig" type="controller" standalone="true" ruleset="insertCommentModuleConfig" />
|
||||
<action name="procCommentAdminDeleteChecked" type="controller" standalone="true" ruleset="deleteChecked" />
|
||||
<action name="procCommentAdminChangeStatus" type="controller" standalone="true"/>
|
||||
<action name="procCommentAdminChangePublishedStatusChecked" type="controller" standalone="true" />
|
||||
<action name="isModuleUsingPublishValidation" type="controller" standalone="true" />
|
||||
<action name="procCommentAdminCancelDeclare" type="controller" standalone="true" />
|
||||
<action name="procCommentAdminAddCart" type="controller" standalone="true" />
|
||||
<action name="procCommentGetList" type="controller" standalone="true" />
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="comment">
|
||||
<title xml:lang="en">Comment</title>
|
||||
|
|
@ -28,7 +31,7 @@
|
|||
<title xml:lang="es">Comment</title>
|
||||
<title xml:lang="ru">Comment</title>
|
||||
<title xml:lang="fr">Comment</title>
|
||||
<title xml:lang="zh-TW">Comment</title>
|
||||
<title xml:lang="zh-TW">回覆</title>
|
||||
<title xml:lang="vi">Comment</title>
|
||||
<title xml:lang="mn">Comment</title>
|
||||
<title xml:lang="tr">Comment</title>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<value xml:lang="en"><![CDATA[I want to]]></value>
|
||||
<value xml:lang="jp"><![CDATA[このコメントを…]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[将把此评论..]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[將此評論..]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[將此回覆..]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Vous voudriez...]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Эту запись...]]></value>
|
||||
<value xml:lang="es"><![CDATA[Usted ...]]></value>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<value xml:lang="en"><![CDATA[Comments List]]></value>
|
||||
<value xml:lang="jp"><![CDATA[コメントリスト]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[评论列表]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[評論列表]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[回覆列表]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Liste des Commentaires]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Список записей]]></value>
|
||||
<value xml:lang="es"><![CDATA[Comentarios Lista]]></value>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
<value xml:lang="en"><![CDATA[Invert Selection]]></value>
|
||||
<value xml:lang="jp"><![CDATA[選択項目の反転]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[反选]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[反選]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[反向選擇]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Renverser les choisis]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Изменить выбранное]]></value>
|
||||
</item>
|
||||
|
|
@ -49,18 +49,20 @@
|
|||
<value xml:lang="ko"><![CDATA[휴지통]]></value>
|
||||
<value xml:lang="en"><![CDATA[Recycle Bin]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ゴミ箱]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[回收桶]]></value>
|
||||
</item>
|
||||
<item name="cmd_trash">
|
||||
<value xml:lang="ko"><![CDATA[휴지통으로 이동]]></value>
|
||||
<value xml:lang="en"><![CDATA[Move to Recycle Bin]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ゴミ箱へ移動]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[移至回收桶]]></value>
|
||||
</item>
|
||||
<item name="comment_count">
|
||||
<value xml:lang="ko"><![CDATA[댓글 수]]></value>
|
||||
<value xml:lang="en"><![CDATA[Number of Comments]]></value>
|
||||
<value xml:lang="jp"><![CDATA[コメント数]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[每页评论数]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[每頁評論數]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[每頁回覆數]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Limite de Commentaires]]></value>
|
||||
<value xml:lang="de"><![CDATA[Kommentare]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Количество ответов]]></value>
|
||||
|
|
@ -73,7 +75,7 @@
|
|||
<value xml:lang="en"><![CDATA[Display comments and if the number of them is over a specified number, move to the comment list.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[コメントを指定した数だけ表示し、それ以上はリスト化します。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[可以指定要显示的每页评论数。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[可以指定要顯示的每頁評論數。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[可以指定要顯示的每頁回覆數。]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Quand il y a plus de commentaires, ils seront bougés sur le liste.]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Отображается указанное количество ответов, после превышения этого количества производится переход к списку.]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Yorumları, kullanıcının girdiği rakam kadar gösterin. Eğer yorum sayısı belirlenen sayıyı aşarsa, yorum Liste'ye taşınır.]]></value>
|
||||
|
|
@ -84,7 +86,7 @@
|
|||
<value xml:lang="en"><![CDATA[Please select an article to delete.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[削除するコメントを選択してください。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[请选择要删除的评论。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[請選擇要刪除的評論。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[請選擇要刪除的回覆。]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Choisissez un article à supprimer, S.V.P.]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Пожалуйста, выберите записи для удаления.]]></value>
|
||||
<value xml:lang="es"><![CDATA[Selecciona el commentario que desea eliminar]]></value>
|
||||
|
|
@ -96,7 +98,7 @@
|
|||
<value xml:lang="en"><![CDATA[%d comment(s) is(are) successfully deleted.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[%d個のコメントを削除しました。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[已删除%d个评论。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已刪除%d個評論。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已刪除 %d 個回覆。]]></value>
|
||||
<value xml:lang="fr"><![CDATA[%d commentaire(s) est(sont) supprimé(s) avec succés.]]></value>
|
||||
<value xml:lang="ru"><![CDATA[%d записьуспешно удалена]]></value>
|
||||
<value xml:lang="es"><![CDATA[%d comentario eliminado correctamente.]]></value>
|
||||
|
|
@ -211,7 +213,7 @@
|
|||
<value xml:lang="en"><![CDATA[IP Address]]></value>
|
||||
<value xml:lang="jp"><![CDATA[IPアドレス]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[IP 地址]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[IP位址]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[IP 位址]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Adresse IP]]></value>
|
||||
<value xml:lang="ru"><![CDATA[IP-адрес]]></value>
|
||||
<value xml:lang="es"><![CDATA[Dirección IP]]></value>
|
||||
|
|
@ -222,12 +224,14 @@
|
|||
<value xml:lang="ko"><![CDATA[상태]]></value>
|
||||
<value xml:lang="en"><![CDATA[Status]]></value>
|
||||
<value xml:lang="jp"><![CDATA[状態]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[狀態]]></value>
|
||||
</item>
|
||||
</item>
|
||||
<item name="no_text_comment">
|
||||
<value xml:lang="ko"><![CDATA[글자가 없는 댓글입니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[No text in this comment.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[テキストのないコメントです。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[此回覆無內容。]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Bu yorumda herhangi bir metin yok.]]></value>
|
||||
</item>
|
||||
<item name="secret_name_list" type="array">
|
||||
|
|
@ -235,21 +239,48 @@
|
|||
<value xml:lang="ko"><![CDATA[비밀]]></value>
|
||||
<value xml:lang="en"><![CDATA[Secret]]></value>
|
||||
<value xml:lang="jp"><![CDATA[非公開]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[秘密]]></value>
|
||||
</item>
|
||||
<item name="N">
|
||||
<value xml:lang="ko"><![CDATA[공개]]></value>
|
||||
<value xml:lang="en"><![CDATA[Public]]></value>
|
||||
<value xml:lang="jp"><![CDATA[公開]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[公開]]></value>
|
||||
</item>
|
||||
</item>
|
||||
<item name="published_name_list" type="array">
|
||||
<item name="Y">
|
||||
<value xml:lang="en"><![CDATA[Published]]></value>
|
||||
</item>
|
||||
<item name="N">
|
||||
<value xml:lang="en"><![CDATA[Unpublished]]></value>
|
||||
</item>
|
||||
</item>
|
||||
<item name="comment_manager">
|
||||
<value xml:lang="ko"><![CDATA[선택한 댓글 관리]]></value>
|
||||
<value xml:lang="en"><![CDATA[Manage Selected Comment]]></value>
|
||||
<value xml:lang="jp"><![CDATA[選択コメントを管理]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[管理所選回覆]]></value>
|
||||
</item>
|
||||
<item name="selected_comment">
|
||||
<value xml:lang="ko"><![CDATA[선택한 댓글]]></value>
|
||||
<value xml:lang="en"><![CDATA[Selected Comment]]></value>
|
||||
<value xml:lang="jp"><![CDATA[選択したコメント]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已選回覆]]></value>
|
||||
</item>
|
||||
<item name="cmd_comment_validation">
|
||||
<value xml:lang="en"><![CDATA[Use comment validation]]></value>
|
||||
</item>
|
||||
<item name="about_comment_validation">
|
||||
<value xml:lang="en"><![CDATA[If you want to use comment validation before displaying on your module frontend select USE, otherwise select NOT USE.]]></value>
|
||||
</item>
|
||||
<item name="published">
|
||||
<value xml:lang="en"><![CDATA[Publish status]]></value>
|
||||
</item>
|
||||
<item name="cmd_publish">
|
||||
<value xml:lang="en"><![CDATA[Publish]]></value>
|
||||
</item>
|
||||
<item name="cmd_unpublish">
|
||||
<value xml:lang="en"><![CDATA[Unpublish]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
@ -6,7 +6,8 @@
|
|||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" />
|
||||
<condition operation="equal" column="status" var="status" />
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
<condition operation="like_prefix" column="regdate" var="regDate" pipe="and" />
|
||||
</conditions>
|
||||
|
|
|
|||
|
|
@ -8,12 +8,14 @@
|
|||
<column name="comments_list.depth" alias="depth" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comments_list.document_srl" var="document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="comments.status" var="status" pipe="and" />
|
||||
<condition operation="equal" column="comments_list.document_srl" var="document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="comments_list.comment_srl" var="comments.comment_srl" filter="number" pipe="and" />
|
||||
<condition operation="more" column="comments_list.head" default="0" pipe="and" />
|
||||
<condition operation="more" column="comments_list.arrange" default="0" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="list_order" default="comments.status" order="desc" />
|
||||
<index var="list_order" default="comments_list.head" order="asc" />
|
||||
<index var="list_order" default="comments_list.arrange" order="asc" />
|
||||
<list_count var="list_count" default="list_count" />
|
||||
|
|
|
|||
8
modules/comment/queries/getDistinctModules.xml
Normal file
8
modules/comment/queries/getDistinctModules.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="getDistinctModules" action="select">
|
||||
<tables>
|
||||
<table name="comments" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="DISTINCT(module_srl)" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
@ -6,9 +6,11 @@
|
|||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="equal" column="status" var="status" pipe="and" />
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="status" order="desc" />
|
||||
<index var="sort_index" default="list_order" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
</navigation>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<condition operation="in" column="module_srl" var="s_module_srl" />
|
||||
<condition operation="notin" column="module_srl" var="exclude_module_srl" pipe="and" />
|
||||
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="and" />
|
||||
<condition operation="equal" column="status" var="s_is_published" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="content" var="s_content" pipe="or" />
|
||||
<condition operation="like" column="user_name" var="s_user_name" pipe="or" />
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@
|
|||
<column name="user_id" var="user_id" default="" />
|
||||
<column name="user_name" var="user_name" default="" />
|
||||
<column name="member_srl" var="member_srl" default="0" filter="number" />
|
||||
<column name="email_address" var="email_address" filter="email" maxlength="250" />
|
||||
<column name="homepage" var="homepage" filter="homepage" maxlength="250" />
|
||||
<column name="email_address" var="email_address" filter="email" maxlength="250" default="" />
|
||||
<column name="homepage" var="homepage" filter="homepage" maxlength="250" default="" />
|
||||
<column name="uploaded_count" var="uploaded_count" default="0" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="last_update" var="last_update" default="curdate()" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="list_order" var="list_order" default="0" />
|
||||
<column name="status" var="status" notnull="notnull" default="0" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
12
modules/comment/queries/updatePublishedStatus.xml
Normal file
12
modules/comment/queries/updatePublishedStatus.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="updatePublishedStatus" action="update">
|
||||
<tables>
|
||||
<table name="comments" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="status" var="status" notnull="notnull" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="comment_srl" var="comment_srls_list" notnull="notnull" pipe="or" />
|
||||
<condition operation="in" column="parent_srl" var="comment_srls_list" notnull="notnull" pipe="or" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -20,4 +20,5 @@
|
|||
<column name="last_update" type="date" index="idx_last_update" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
<column name="status" type="number" size="1" default="1" notnull="notnull" index="idx_status" />
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<!--#include("header.html")-->
|
||||
<script type="text/javascript">
|
||||
xe.lang.msg_empty_search_target = '{$lang->msg_empty_search_target}';
|
||||
xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
||||
|
|
@ -10,9 +11,21 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<h1 class="h1">{$lang->comment}</h1>
|
||||
<div class="table even">
|
||||
<div class="cnb">
|
||||
<a href="{getUrl('','act','dispCommentAdminList', 'Y')}" <!--@if($search_keyword == '')-->class="active"<!--@end-->>{$lang->all}</a>
|
||||
<a href="{getUrl('search_keyword','','act','dispCommentAdminList', 'Y')}" <!--@if($search_keyword == '')-->class="active"<!--@end-->>{$lang->all}</a>
|
||||
| <a href="{getUrl('search_target','is_secret','search_keyword', 'N')}" <!--@if($search_target == 'is_secret' && $search_keyword == 'N')-->class="active"<!--@end-->>{$secret_name_list['N']}</a>
|
||||
| <a href="{getUrl('search_target','is_secret','search_keyword', 'Y')}" <!--@if($search_target == 'is_secret' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$secret_name_list['Y']}</a>
|
||||
| <a href="{getUrl('search_target','is_published','search_keyword', 'N')}" <!--@if($search_target == 'is_published' && $search_keyword == 'N')-->class="active"<!--@end-->>{$lang->published_name_list['N']}</a>
|
||||
| <a href="{getUrl('search_target','is_published','search_keyword', 'Y')}" <!--@if($search_target == 'is_published' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$lang->published_name_list['Y']}</a>
|
||||
|
||||
<block cond="$modules_list">
|
||||
| <label for="comment_modules" <!--@if($search_target == 'module')-->class="active"<!--@end-->>Select Module:
|
||||
<select id="comment_modules" name="comment_modules" onchange="location.href='{getUrl('search_target','module','search_keyword','')}&search_keyword='+this.value">
|
||||
<option></option>
|
||||
<!--@foreach($modules_list as $key => $node)-->
|
||||
<option value="{$key}"<!--@if($key==$search_keyword)-->selected<!--@end-->>{$node}</option>
|
||||
<!--@end-->
|
||||
</select></label>
|
||||
</block>
|
||||
</div>
|
||||
<table width="100%" border="1" cellspacing="0" id="commentListTable">
|
||||
<caption>
|
||||
|
|
@ -22,6 +35,10 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
{$secret_name_list['N']}
|
||||
<!--@elseif($search_target == 'is_secret' && $search_keyword == 'Y')-->
|
||||
{$secret_name_list['Y']}
|
||||
<!--@elseif($search_target == 'is_published' && $search_keyword == 'N')-->
|
||||
{$published_name_list['N']}
|
||||
<!--@elseif($search_target == 'is_published' && $search_keyword == 'Y')-->
|
||||
{$published_name_list['Y']}
|
||||
<!--@end-->
|
||||
({number_format($total_count)})
|
||||
<div class="side">
|
||||
|
|
@ -31,22 +48,24 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text">{$lang->comment}</th>
|
||||
<th scope="col">{$lang->writer}</th>
|
||||
<th scope="col">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col">{$lang->date}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col">{$lang->status}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col" class="nowr">{$lang->date}</th>
|
||||
<th scope="col" class="nowr">{$lang->ipaddress}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th scope="col" class="text">{$lang->comment}</th>
|
||||
<th scope="col">{$lang->writer}</th>
|
||||
<th scope="col">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col">{$lang->date}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col">{$lang->status}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col" class="nowr">{$lang->date}</th>
|
||||
<th scope="col" class="nowr">{$lang->ipaddress}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
|
@ -55,11 +74,12 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
{@ $comment = cut_str(trim(strip_tags($val->content)), 200, '...')}
|
||||
<tr>
|
||||
<td class="text"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
|
||||
<td><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
||||
<td>0/0</td>
|
||||
<td>{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
|
||||
<td><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
|
||||
<td><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
|
||||
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
||||
<td class="nowr">0/0</td>
|
||||
<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
|
||||
<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
|
||||
<td class="nowr"><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
|
||||
<td class="nowr"><!--@if($val->status)-->{$lang->published_name_list['Y']}<!--@else-->{$lang->published_name_list['N']}<!--@end--></td>
|
||||
<td><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
|
|
@ -76,6 +96,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<input type="hidden" name="act" value="procCommentAdminDeleteChecked" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_trash" value="false" />
|
||||
<input type="hidden" name="will_publish" value="0" />
|
||||
<input type="hidden" name="search_target" value="{$search_target}" />
|
||||
<input type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<h2 class="h2">{$lang->comment_manager}</h2>
|
||||
|
|
@ -87,8 +108,9 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->comment}</th>
|
||||
<th scope="col">{$lang->writer}</th>
|
||||
<th scope="col">{$lang->status}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -97,9 +119,17 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</div>
|
||||
<p class="q"><label for="message">{$lang->message_notice}</label></p>
|
||||
<p>
|
||||
<textarea cols="42" rows="3" name="message_content" id="message" style="width:98%"></textarea>
|
||||
<textarea rows="8" cols="42" name="message_content" id="message" style="width:98%"></textarea>
|
||||
</p>
|
||||
<div class="btnArea">
|
||||
<!--@if ($search_target=='is_published' && $search_keyword=="N")-->
|
||||
<span class="btn"><button type="submit" name="will_publish" value="1" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_publish}</button></span>
|
||||
<!--@elseif ($search_target=='is_published' && $search_keyword=="Y")-->
|
||||
<span class="btn"><button type="submit" name="will_publish" value="0" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_unpublish}</button></span>
|
||||
<!--@else-->
|
||||
<span class="btn"><button type="submit" name="will_publish" value="1" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_publish}</button></span>
|
||||
<span class="btn"><button type="submit" name="will_publish" value="0" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_unpublish}</button></span>
|
||||
<!--@end-->
|
||||
<span class="btn"><button type="submit" name="is_trash" value="true">{$lang->cmd_trash}</button></span>
|
||||
<span class="btn"><button type="submit" name="is_trash" value="false">{$lang->cmd_delete}</button></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,16 @@
|
|||
<option value="N" selected="selected"|cond="$comment_config->use_vote_down=='N'">{$lang->notuse}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="use_comment_validation">{$lang->cmd_comment_validation}</label></th>
|
||||
<td>
|
||||
<select name="use_comment_validation">
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_comment_validation=='N'">{$lang->notuse}</option>
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_comment_validation=='Y'">{$lang->use}</option>
|
||||
</select>
|
||||
<p>{$lang->about_comment_validation}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<h3 class="xeAdmin">{$lang->comment} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<div class="header4 gap1">
|
||||
<div class="header4">
|
||||
<ul class="localNavigation">
|
||||
<li <!--@if($act=='dispCommentAdminList')-->class="on"<!--@end-->><a href="{getUrl('act','dispCommentAdminList')}">{$lang->comment_list}</a></li>
|
||||
<li <!--@if($act=='dispCommentAdminDeclared')-->class="on"<!--@end-->><a href="{getUrl('act','dispCommentAdminDeclared')}">{$lang->cmd_declared_list}</a></li>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeGetCommentList(ret_obj, response_tags)
|
|||
{
|
||||
var htmlListBuffer = '';
|
||||
var statusNameList = {"N":"Public", "Y":"Secret"};
|
||||
|
||||
var publishedStatusList = {0:'Unpublished', 1:'Published'};
|
||||
if(ret_obj['comment_list'] == null)
|
||||
{
|
||||
htmlListBuffer = '<tr>' +
|
||||
|
|
@ -56,8 +56,9 @@ function completeGetCommentList(ret_obj, response_tags)
|
|||
var objComment = comment_list[x];
|
||||
htmlListBuffer += '<tr>' +
|
||||
'<td class="title">'+ objComment.content +'</td>' +
|
||||
'<td>'+ objComment.nick_name +'</td>' +
|
||||
'<td>'+ statusNameList[objComment.is_secret] +'</td>' +
|
||||
'<td class="nowr">'+ objComment.nick_name +'</td>' +
|
||||
'<td class="nowr">'+ statusNameList[objComment.is_secret] +'</td>' +
|
||||
'<td>'+ publishedStatusList[objComment.status] +'</td>' +
|
||||
'</tr>' +
|
||||
'<input type="hidden" name="cart[]" value="'+objComment.comment_srl+'" />';
|
||||
}
|
||||
|
|
@ -66,6 +67,16 @@ function completeGetCommentList(ret_obj, response_tags)
|
|||
jQuery('#commentManageListTable>tbody').html(htmlListBuffer);
|
||||
}
|
||||
|
||||
function doChangePublishedStatus(new_status)
|
||||
{
|
||||
container_div = jQuery("#listManager");
|
||||
var act = container_div.find("input[name=act]");
|
||||
var will_publish = container_div.find("input[name=will_publish]");
|
||||
var action = "procCommentAdminChangePublishedStatusChecked";
|
||||
will_publish.val(new_status);
|
||||
act.val(action);
|
||||
}
|
||||
|
||||
function checkSearch(form)
|
||||
{
|
||||
if(form.search_target.value == '')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue