[Update2] Admin email for send errant post link back to user for fix ???
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #1
Question [Update2] Admin email for send errant post link back to user for fix ???
Way to email user from admin login, after checking post at moderation queue, a notice to fix errors in a post ?

Modified some email text and links at messages.lang.php and member.php, for email message and post link language to user with 'Send this Thread to a Friend' (SPTAF), but there seems no other way for user to go back to the post and fix... only way seems to be user needs to create a new post, and admin needs to delete old errant post ?

Is there another way, from admin login, to email users about errant posts and a way they may go back and edit accordingly... maybe approve post for limited time frame 4 fix ?

Would also like to keep a copy of the email, possibly by creating a way to bcc: to admin archive email... or maybe way to put multiple email addresses (to archive@domain.name) in SPTAF ?

Thoughts on where to look, or how to do ?

Ps:
Modified 'Template: sendthread' for second email address field, but doesnt get sent to addressees... any idea if way to modify member.php to make that work ?

Ps2:
Forgot to include sendthread.php in file list above.
Maybe could somehow, at least, add second email addressee at ?...

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
if($mybb->input['action'] == "do_sendtofriend" && $mybb->request_method == "post")
{
	// Verify incoming POST request
	verify_post_check($mybb->input['my_post_key']);

	$plugins->run_hooks("sendthread_do_sendtofriend_start");
	
	if(!validate_email_format($mybb->input['email']))
	{
		$errors[] = $lang->error_invalidemail;
	}
	
	if(empty($mybb->input['subject']))
	{
		$errors[] = $lang->error_nosubject;
	}	
	
	if(empty($mybb->input['message']))
	{
		$errors[] = $lang->error_nomessage;
	}

	// No errors detected
	if(count($errors) == 0)
	{
		if($mybb->settings['mail_handler'] == 'smtp')
		{
			$from = $mybb->user['email'];
		}
		else
		{
			$from = "{$mybb->user['username']} <{$mybb->user['email']}>";
		}
		
		$threadlink = get_thread_link($thread['tid']);
		
		$message = $lang->sprintf($lang->email_sendtofriend, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']."/".$threadlink, $mybb->input['message']);
		
		// Send the actual message
		my_mail($mybb->input['email'], $mybb->input['subject'], $message, $from, "", "", false, "text", "", $mybb->user['email']);
		
		if($mybb->settings['mail_logging'] > 0)
		{
			// Log the message
			$log_entry = array(
				"subject" => $db->escape_string($mybb->input['subject']),
				"message" => $db->escape_string($message),
				"dateline" => TIME_NOW,
				"fromuid" => $mybb->user['uid'],
				"fromemail" => $db->escape_string($mybb->user['email']),
				"touid" => 0,
				"toemail" => $db->escape_string($mybb->input['email']),
				"tid" => $thread['tid'],
				"ipaddress" => $db->escape_string($session->ipaddress)
			);
			$db->insert_query("maillogs", $log_entry);
		}

		$plugins->run_hooks("sendthread_do_sendtofriend_end");
		redirect(get_thread_link($thread['tid']), $lang->redirect_emailsent);
	}
	else
	{
		$mybb->input['action'] = '';
	}
}

if(!$mybb->input['action'])
{
	$plugins->run_hooks("sendthread_start");

	// Do we have some errors?
	if(count($errors) >= 1)
	{
		$errors = inline_error($errors);
		$email = htmlspecialchars_uni($mybb->input['email']);
		$subject = htmlspecialchars_uni($mybb->input['subject']);
		$message = htmlspecialchars_uni($mybb->input['message']);
	}
	else
	{
		$errors = '';
		$email = '';
		$subject = $lang->sprintf($lang->emailsubject_sendtofriend, $mybb->settings['bbname']);
		$message = '';
	}
	
	$plugins->run_hooks("sendthread_end");

	eval("\$sendtofriend = \"".$templates->get("sendthread")."\";");
	output_page($sendtofriend);
}

...guess, if possible, little T&E, and some luck ?


Thanks again for your help !
(This post was last modified: 03-02-2012 05:17 AM by akm.)
02-27-2012 05:41 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: [Updated2] Admin email for send errant post link back to user for fix ???
MyBB won't show unapproved posts to their authors.  This is a MyBB limitation.

My Blog
02-27-2012 03:41 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #3
RE: [Updated2] Admin email for send errant post link back to user for fix ???
This is something I have pondered on for a long time - a process I thought of for mysite which has upload submissions (though I have no idea how to implement it) is as below:

1) Define a forum as the "upload forum" - users can see only their own posts, staff/moderators can see all
2) On submit - the post is approved and auto-moved to another forum - staff only.
3) Post is reviewed: if ok, it is moved to the correct forum - user gets a PM on move.
4) Post is reviewed: if NOT ok, it is moved back to the upload forum - user gets a PM on move
5) User edits - resubmits - back to point 2

This process really would not work at all if ever in a discussions forum. (IMO)


[Image: leelink.gif]
MYBB1.6 & XThreads
02-28-2012 01:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: