phpBB

Code Changes

File: includes/functions_posting.php

  Unmodified   Added   Modified   Removed
Line 52Line 52

page_header($user->lang['SMILIES']);



page_header($user->lang['SMILIES']);


		$sql = 'SELECT COUNT(smiley_id) AS item_count
FROM ' . SMILIES_TABLE . '
GROUP BY smiley_url';





















		$sql_ary = [
'SELECT' => 'COUNT(s.smiley_id) AS item_count',
'FROM' => [
SMILIES_TABLE => 's',
],
'GROUP_BY' => 's.smiley_url',
];

/**
* Modify SQL query that fetches the total number of smilies in window mode
*
* @event core.generate_smilies_count_sql_before
* @var int forum_id Forum where smilies are generated
* @var array sql_ary Array with the SQL query
* @since 3.2.9-RC1
*/
$vars = [
'forum_id',
'sql_ary',
];
extract($phpbb_dispatcher->trigger_event('core.generate_smilies_count_sql_before', compact($vars)));

$sql = $db->sql_build_query('SELECT', $sql_ary);

		$result = $db->sql_query($sql, 3600);

$smiley_count = 0;

		$result = $db->sql_query($sql, 3600);

$smiley_count = 0;

Line 113Line 133
		}
}
$db->sql_freeresult($result);

		}
}
$db->sql_freeresult($result);

 

/**
* Modify smilies before they are assigned to the template
*
* @event core.generate_smilies_modify_rowset
* @var string mode Smiley mode, either window or inline
* @var int forum_id Forum where smilies are generated
* @var array smilies Smiley rows fetched from the database
* @since 3.2.9-RC1
*/
$vars = [
'mode',
'forum_id',
'smilies',
];
extract($phpbb_dispatcher->trigger_event('core.generate_smilies_modify_rowset', compact($vars)));


if (count($smilies))
{


if (count($smilies))
{

Line 202Line 238

if (count($ids) == 1)
{


if (count($ids) == 1)
{

		$sql = 'SELECT MAX(p.post_id) as last_post_id

		$sql = 'SELECT p.post_id as last_post_id

			FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition

			FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition

				AND p.post_visibility = " . ITEM_APPROVED;



				AND p.post_visibility = " . ITEM_APPROVED . "
ORDER BY p.post_id DESC";
$result = $db->sql_query_limit($sql, 1);

	}
else
{

	}
else
{

Line 216Line 254
				$topic_condition
AND p.post_visibility = " . ITEM_APPROVED . "
GROUP BY p.{$type}_id";

				$topic_condition
AND p.post_visibility = " . ITEM_APPROVED . "
GROUP BY p.{$type}_id";

	}

 
	$result = $db->sql_query($sql);

	$result = $db->sql_query($sql);

 
	}


$last_post_ids = array();
while ($row = $db->sql_fetchrow($result))


$last_post_ids = array();
while ($row = $db->sql_fetchrow($result))

Line 975Line 1013
		'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
AND u.user_id = p.poster_id',
);

		'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
AND u.user_id = p.poster_id',
);

 

/**
* Event to modify the SQL query for topic reviews
*
* @event core.topic_review_modify_sql_ary
* @var int topic_id The topic ID that is being reviewed
* @var int forum_id The topic's forum ID
* @var string mode The topic review mode
* @var int cur_post_id Post offset ID
* @var bool show_quote_button Flag indicating if the quote button should be displayed
* @var array post_list Array with the post IDs
* @var array sql_ary Array with the SQL query
* @since 3.2.8-RC1
*/
$vars = array(
'topic_id',
'forum_id',
'mode',
'cur_post_id',
'show_quote_button',
'post_list',
'sql_ary',
);
extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_sql_ary', compact($vars)));


$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);


$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);

Line 1282Line 1344
				delete_topics('topic_id', array($topic_id), false);

$phpbb_content_visibility->remove_topic_from_statistic($data, $sql_data);

				delete_topics('topic_id', array($topic_id), false);

$phpbb_content_visibility->remove_topic_from_statistic($data, $sql_data);

 
				$config->increment('num_posts', -1, false);


$update_sql = update_post_information('forum', $forum_id, true);
if (count($update_sql))


$update_sql = update_post_information('forum', $forum_id, true);
if (count($update_sql))

Line 2050Line 2113
			if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']]))
{
continue;

			if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']]))
{
continue;

 
			}

if (preg_match('/[\x{10000}-\x{10FFFF}]/u', $attach_row['attach_comment']))
{
trigger_error('ATTACH_COMMENT_NO_EMOJIS');

			}

if (!$attach_row['is_orphan'])

			}

if (!$attach_row['is_orphan'])