Files
Testing/comments.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

137 lines
4.6 KiB
PHP

<?php
$page = "general";
include "header.php";
$time=time();
if($_POST["task"]=="comment_delete1"){
$database->database_query("DELETE FROM ".$database->database_real_escape_string($_POST["object"])." WHERE id='".$_POST["comment_id"]."'");
}
elseif($_POST["task"]=="comment_edit")
{
$comment_body=$_POST["comment_edit"];
$comment_body = cleanHTML(censor($comment_body), $setting['setting_comment_html'], Array("style"));
$comment_body = preg_replace('/(\r\n?)/', "\n", $comment_body);
$comment_body = str_replace("\n", "<br>", $comment_body);
$comment_body = preg_replace('/(<br>){3,}/is', '<br><br>', $comment_body);
//$comment_body = str_replace("'", "\'", $comment_body);
if( !trim($comment_body) )
{
exit;
$comment_body = "";
}
$comment_body=json_encode(htmlentities($comment_body, ENT_QUOTES));
$database->database_query("UPDATE ".$database->database_real_escape_string($_POST["object"])." SET body='".$database->database_real_escape_string($comment_body)."' WHERE id='".$_POST["comment_id"]."'");
}
elseif(trim($_POST["comment"])!=""){
$comment_body=$_POST["comment"];
$comment_body = cleanHTML(censor($comment_body), $setting['setting_comment_html'], Array("style"));
$comment_body = preg_replace('/(\r\n?)/', "\n", $comment_body);
$comment_body = str_replace("\n", "<br>", $comment_body);
$comment_body = preg_replace('/(<br>){3,}/is', '<br><br>', $comment_body);
//$comment_body = str_replace("'", "\'", $comment_body);
if( !trim($comment_body) )
{
exit;
$comment_body = "";
}
$comment_body=json_encode(htmlentities($comment_body, ENT_QUOTES));
$database->database_query("INSERT INTO ".$database->database_real_escape_string($_POST["object"])." SET object_id='".$database->database_real_escape_string($_POST["object_id"])."', authoruser_id='".$database->database_real_escape_string($_POST["user"])."', date='".$time."', body='".$database->database_real_escape_string($comment_body)."'");
$lastid=$database->database_insert_id();
$owner=new SEUser(Array($_POST["user"]));
if($_POST["object"]=="batortrainingcomments"){
$query=$database->database_query("SELECT * FROM bateworldcom_zips.bator_training WHERE id=".$database->database_real_escape_string($_POST["object_id"])." ");
$row=$database->database_fetch_array($query);
$actions->actions_add($user, "btscomment", array(
$user->user_info['user_username'],
$user->user_displayname,
$row["title"],
$_POST["object_id"],
$comment_body
//$this->poll_owner->user_info['user_username'],
//$this->poll_info['poll_id'],
//$poll_title
), Array(), 0, false, "btscomment", $_POST["object_id"], 31, $lastid);
//Add in database then add text to admin (%s) then add stuff to here and homestorage/activityfeed.php
}
elseif($_POST["object"]=="bate_videocomments"){
$query=$database->database_query("SELECT * FROM bate_videos WHERE id=".$database->database_real_escape_string($_POST["object_id"])." ");
$row=$database->database_fetch_array($query);
$actions->actions_add($user, "bate_videocomments", array(
$user->user_info['user_username'],
$user->user_displayname,
$row["title"],
$_POST["object_id"],
$comment_body
//$this->poll_owner->user_info['user_username'],
//$this->poll_info['poll_id'],
//$poll_title
), Array(), 0, false, "bate_videocomments", $_POST["object_id"], 31, $lastid);
//Add in database then add text to admin (%s) then add stuff to here and homestorage/activityfeed.php
}
?>
<div style="margin-top: 10px; margin-bottom: 20px;"><div style="float: left; text-align: center; width: 90px;"><a href="<?=$url->url_create('profile', $owner->user_info["user_username"])?>">
<!--<img src="<?=$owner->user_photo("./images/nophoto.png")?>" class="photo" width="75" border="0">
--><?php $profilepicture=$owner->user_photo("./images/nophoto.png");
echo $owner->userprofiledot($profilepicture, "75px");?>
</a></div><div style="overflow: hidden;"><div class="profile_comment_author"><a href="<?=$url->url_create('profile', $owner->user_info["user_username"])?>"><b><?=$owner->user_displayname?></b></a></div><div class="profile_comment_date"><?=date('n/j/Y g:i A', $time)?></div><div class="profile_comment_body" id="profile_comment_body_14612"><? echo $comment_body;?></div><div class="profile_comment_links"><a data-toggle="modal" data-target="#myModal" href="user_messages_new.php?to_user=<?=$owner->user_info["user_username"]?>&to_id=<?=$owner->user_info["user_username"]?>">Message</a>&nbsp;</div></div></div>
<?
}
exit;
function general(){}
include "footer.php";