Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ticket/12801] core.functions_posting.load_drafts_draft_list_results #2688

Merged
merged 4 commits into from Aug 1, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions phpBB/includes/functions_posting.php
Expand Up @@ -893,7 +893,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a
function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0)
{
global $user, $db, $template, $auth;
global $phpbb_root_path, $phpEx;
global $phpbb_root_path, $phpbb_dispatcher, $phpEx;

$topic_ids = $forum_ids = $draft_rows = array();

Expand Down Expand Up @@ -936,7 +936,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
$topic_rows = array();
if (sizeof($topic_ids))
{
$sql = 'SELECT topic_id, forum_id, topic_title
$sql = 'SELECT topic_id, forum_id, topic_title, topic_poster
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids));
$result = $db->sql_query($sql);
Expand All @@ -947,6 +947,20 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
}
$db->sql_freeresult($result);
}

/**
* Drafts found and their topics
* Edit $draft_rows in order to add or remove drafts loaded
*
* @event core.load_drafts_draft_list_result
* @var array draft_rows The drafts query result. Includes its forum id and everything about the draft
* @var array topic_ids The list of topics got from the topics table
* @var array topic_rows The topics that draft_rows references
* @since 3.1.0-RC3
*/
$vars = array('draft_rows', 'topic_ids', 'topic_rows');
extract($phpbb_dispatcher->trigger_event('core.load_drafts_draft_list_result', compact($vars)));

unset($topic_ids);

$template->assign_var('S_SHOW_DRAFTS', true);
Expand Down