mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Comment 'share' preparation
This commit is contained in:
33
comment.php
33
comment.php
@@ -113,30 +113,35 @@ if(e_AJAX_REQUEST) // TODO improve security
|
||||
if(vartrue($_POST['comment'])) // ajax render comment
|
||||
{
|
||||
$pid = intval(varset($_POST['pid'], 0)); // ID of the specific comment being edited (nested comments - replies)
|
||||
|
||||
$row = array();
|
||||
$clean_authorname = $_POST['author_name'];
|
||||
$clean_comment = $_POST['comment'];
|
||||
$clean_subject = $_POST['subject'];
|
||||
|
||||
$_SESSION['comment_author_name'] = $clean_authorname;
|
||||
|
||||
$newid = e107::getComment()->enter_comment($clean_authorname, $clean_comment, $_POST['table'], intval($_POST['itemid']), $pid, $clean_subject);
|
||||
|
||||
$row['comment_item_id'] = intval($_POST['itemid']);
|
||||
$row['comment_type'] = e107::getComment()->getCommentType($tp->toDB($_POST['table'],true));
|
||||
$row['comment_subject'] = $tp->toDB($_POST['subject']);
|
||||
$row['comment_comment'] = $tp->toDB($_POST['comment']);
|
||||
$row['user_image'] = USERIMAGE;
|
||||
$row['user_id'] = (USERID) ? USERID : 0;
|
||||
$row['user_name'] = USERNAME;
|
||||
$row['comment_author_name'] = $tp->toDB($clean_authorname);
|
||||
$row['comment_datestamp'] = time();
|
||||
$row['comment_blocked'] = (check_class($pref['comments_moderate']) ? 2 : 0);
|
||||
$row['comment_share'] = ($_POST['comment_share']);
|
||||
|
||||
$newid = e107::getComment()->enter_comment($row);
|
||||
|
||||
|
||||
// $newid = e107::getComment()->enter_comment($clean_authorname, $clean_comment, $_POST['table'], intval($_POST['itemid']), $pid, $clean_subject);
|
||||
|
||||
if(is_numeric($newid) && ($_GET['mode'] == 'submit'))
|
||||
{
|
||||
$row = array();
|
||||
$row['comment_id'] = $newid;
|
||||
$row['comment_item_id'] = intval($_POST['itemid']);
|
||||
$row['comment_type'] = e107::getComment()->getCommentType($tp->toDB($_POST['table'],true));
|
||||
$row['comment_subject'] = $tp->toDB($_POST['subject']);
|
||||
$row['comment_comment'] = $tp->toDB($_POST['comment']);
|
||||
$row['user_image'] = USERIMAGE;
|
||||
$row['user_id'] = (USERID) ? USERID : 0;
|
||||
$row['user_name'] = USERNAME;
|
||||
$row['comment_author_name'] = $tp->toDB($clean_authorname);
|
||||
$row['comment_datestamp'] = time();
|
||||
$row['comment_blocked'] = (check_class($pref['comments_moderate']) ? 2 : 0);
|
||||
|
||||
$row['comment_id'] = $newid;
|
||||
$width = ($pid) ? 5 : 0;
|
||||
|
||||
$ret['html'] = "\n<!-- Appended -->\n";
|
||||
|
Reference in New Issue
Block a user