mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/12270] Correct post&topic approval msg, no template changes
Following the previous commits, this patch removes the changes done to templates to depend only on code, as suggested by @nickvergessen. All previous modifications have been removed, with another one which checks, in the approve_posts() function, if it is sending a notification for post approval and it is the first one in the topic, send notification indicating that the topic has been approved (and not the post). If not the first post in the topic, do just as before (send a notification about a newly approved post). PHPBB3-12270
This commit is contained in:
parent
7446361ad4
commit
55757ddc65
2 changed files with 9 additions and 6 deletions
11
phpBB/includes/mcp/mcp_queue.php
Normal file → Executable file
11
phpBB/includes/mcp/mcp_queue.php
Normal file → Executable file
|
@ -316,7 +316,6 @@ class mcp_queue
|
||||||
'POST_IP' => $post_info['poster_ip'],
|
'POST_IP' => $post_info['poster_ip'],
|
||||||
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
|
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
|
||||||
'POST_ID' => $post_info['post_id'],
|
'POST_ID' => $post_info['post_id'],
|
||||||
'TOPIC_ID' => $post_info['topic_id'],
|
|
||||||
'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id),
|
'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id),
|
||||||
|
|
||||||
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '',
|
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '',
|
||||||
|
@ -579,6 +578,7 @@ class mcp_queue
|
||||||
$redirect = reapply_sid($redirect);
|
$redirect = reapply_sid($redirect);
|
||||||
$success_msg = $post_url = '';
|
$success_msg = $post_url = '';
|
||||||
$approve_log = array();
|
$approve_log = array();
|
||||||
|
$topic_approve_log = array();
|
||||||
|
|
||||||
$s_hidden_fields = build_hidden_fields(array(
|
$s_hidden_fields = build_hidden_fields(array(
|
||||||
'i' => $id,
|
'i' => $id,
|
||||||
|
@ -687,7 +687,14 @@ class mcp_queue
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_notifications->add_notifications('approve_post', $post_data);
|
if ($topic_info[$post_data['topic_id']]['first_post'])
|
||||||
|
{
|
||||||
|
$phpbb_notifications->add_notifications('approve_topic', $topic_info[$post_data['topic_id']]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$phpbb_notifications->add_notifications('approve_post', $post_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
phpBB/styles/prosilver/template/mcp_post.html
Normal file → Executable file
4
phpBB/styles/prosilver/template/mcp_post.html
Normal file → Executable file
|
@ -75,12 +75,8 @@
|
||||||
<p class="post-notice unapproved">
|
<p class="post-notice unapproved">
|
||||||
<input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" />
|
<input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" />
|
||||||
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
|
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
|
||||||
<!-- IF not S_FIRST_POST -->
|
|
||||||
<input type="hidden" name="mode" value="unapproved_posts" />
|
<input type="hidden" name="mode" value="unapproved_posts" />
|
||||||
<input type="hidden" name="post_id_list[]" value="{POST_ID}" />
|
<input type="hidden" name="post_id_list[]" value="{POST_ID}" />
|
||||||
<!-- ELSE -->
|
|
||||||
<input type="hidden" name="topic_id_list[]" value="{TOPIC_ID}" />
|
|
||||||
<!-- ENDIF -->
|
|
||||||
{S_FORM_TOKEN}
|
{S_FORM_TOKEN}
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Add table
Reference in a new issue