diff --git a/sections/forums/takeedit.php b/sections/forums/takeedit.php
index 4a0751c6..91bc2f72 100644
--- a/sections/forums/takeedit.php
+++ b/sections/forums/takeedit.php
@@ -30,6 +30,7 @@
$PostID = $_POST['post'];
$Key = $_POST['key'];
$SQLTime = sqltime();
+$DoPM = isset($_POST['pm']) ? $_POST['pm'] : 0;
// Mainly
$DB->query("SELECT
@@ -65,6 +66,15 @@
error(404,true);
}
+// Send a PM to the user to notify them of the edit
+if($UserID != $AuthorID && $DoPM) {
+ $PMSubject = 'Your post #'.$PostID.' has been edited';
+ $PMurl = 'https://'.NONSSL_SITE_URL.'/forums.php?action=viewthread&postid='.$PostID.'#post'.$PostID;
+ $ProfLink = '[url=https://'.NONSSL_SITE_URL.'/user.php?id='.$UserID.']'.$LoggedUser['Username'].'[/url]';
+ $PMBody = 'One of your posts has been edited by '.$ProfLink.': [url]'.$PMurl.'[/url]';
+ Misc::send_pm($AuthorID,0,$PMSubject,$PMBody,$ConvID='');
+}
+
// Perform the update
$DB->query("UPDATE forums_posts SET
Body = '$Body',
diff --git a/sections/tools/index.php b/sections/tools/index.php
index d6243f19..b72fce46 100644
--- a/sections/tools/index.php
+++ b/sections/tools/index.php
@@ -101,6 +101,10 @@
case 'eb_alter':
include('managers/eb_alter.php');
break;
+
+ case 'eb_search':
+ include('managers/eb_search.php');
+ break;
case 'dnu':
include('managers/dnu_list.php');
diff --git a/sections/tools/managers/eb.php b/sections/tools/managers/eb.php
index b568d820..2a8f9993 100644
--- a/sections/tools/managers/eb.php
+++ b/sections/tools/managers/eb.php
@@ -3,7 +3,7 @@
if (!check_perms('users_view_email')) {
error(403);
}
-list($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE);
+list ($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE);
View::show_header('Manage email blacklist');
$DB->query("SELECT
@@ -17,69 +17,61 @@
ORDER BY eb.Time DESC LIMIT $Limit");
$Results = $DB->to_array(false, MYSQLI_ASSOC, false);
$DB->query("SELECT FOUND_ROWS()");
-list($NumResults) = $DB->next_record();
+list ($NumResults) = $DB->next_record();
?>
-
- Email |
- Comment |
- Added |
- Submit |
-
-
- Add Email or Domain to Blacklist |
-
-
-
-
- foreach($Results as $Result) {
- ?>
+
+ Email |
+ Comment |
+ Added |
+ Submit |
+
+
+ Add Email or Domain to Blacklist |
+
+
+
+
+
+
+ foreach ($Results as $Result) {
+ ?>
-
-
+
+
}?>
View::show_footer(); ?>
diff --git a/sections/tools/managers/eb_search.php b/sections/tools/managers/eb_search.php
new file mode 100644
index 00000000..62ef5217
--- /dev/null
+++ b/sections/tools/managers/eb_search.php
@@ -0,0 +1,41 @@
+
+$Search = db_string($_GET['email']);
+$JSON = array();
+if (!check_perms('users_view_email') || empty($Search)) {
+ $JSON['status'] = "error";
+ echo json_encode($JSON);
+ exit();
+}
+else {
+ $JSON['status'] = "success";
+}
+
+$DB->query("SELECT
+ eb.ID,
+ eb.UserID,
+ eb.Time,
+ eb.Email,
+ eb.Comment
+ FROM email_blacklist AS eb
+ WHERE eb.Email LIKE '%$Search%'");
+
+$EmailResults = $DB->to_array(false, MYSQLI_ASSOC, false);
+
+$Results = array();
+$Count = $DB->record_count();
+$Results['count'] = $Count;
+
+$Emails = array();
+
+if ($Count > 0) {
+ foreach ($EmailResults as $Email) {
+ $Emails[] = array("id" => (int) $Email['ID'], "email" => $Email['Email'],
+ "comment" => $Email['Comment'], "userid" => (int) $Email['UserID'],
+ "time" => $Email['Time']);
+ }
+}
+$Results['emails'] = $Emails;
+$JSON['results'] = $Results;
+
+echo json_encode($JSON);
+exit();
\ No newline at end of file
diff --git a/static/functions/comments.js b/static/functions/comments.js
index 0f68a154..799eb749 100644
--- a/static/functions/comments.js
+++ b/static/functions/comments.js
@@ -39,10 +39,16 @@ function Edit_Form(post,key) {
} else {
boxWidth="80";
}
+ postuserid = jQuery('#post' + postid + ' strong a').attr('href').split('=')[1];
+ if (postuserid != userid) {
+ pmbox = 'PM user on edit? ';
+ } else {
+ pmbox = '';
+ };
$('#bar' + postid).raw().cancel = $('#content' + postid).raw().innerHTML;
$('#bar' + postid).raw().oldbar = $('#bar' + postid).raw().innerHTML;
- $('#content' + postid).raw().innerHTML = "";
- $('#bar' + postid).raw().innerHTML = "";
+ $('#content' + postid).raw().innerHTML = "";
+ $('#bar' + postid).raw().innerHTML = '';
ajax.get("?action=get_post&post=" + postid, function(response){
$('#editbox' + postid).raw().value = html_entity_decode(response);
resize('editbox' + postid);
@@ -76,6 +82,7 @@ function Save_Edit(postid) {
$('#bar' + postid).raw().innerHTML = "[Report] ↑";
$('#preview' + postid).raw().innerHTML = response;
$('#editbox' + postid).hide();
+ $('#pmbox' + postid).hide();
});
} else if (location.href.match(/collages?\.php/)) {
ajax.post("collages.php?action=takeedit_comment","form" + postid, function (response) {