mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch '3.3.x'
This commit is contained in:
commit
e117213827
1 changed files with 12 additions and 7 deletions
|
@ -1086,12 +1086,12 @@ function display_custom_bbcodes()
|
||||||
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
|
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
|
||||||
$num_predefined_bbcodes = NUM_PREDEFINED_BBCODES;
|
$num_predefined_bbcodes = NUM_PREDEFINED_BBCODES;
|
||||||
|
|
||||||
$sql_ary = array(
|
$sql_ary = [
|
||||||
'SELECT' => 'b.bbcode_id, b.bbcode_tag, b.bbcode_helpline',
|
'SELECT' => 'b.bbcode_id, b.bbcode_tag, b.bbcode_helpline, b.bbcode_match',
|
||||||
'FROM' => array(BBCODES_TABLE => 'b'),
|
'FROM' => [BBCODES_TABLE => 'b'],
|
||||||
'WHERE' => 'b.display_on_posting = 1',
|
'WHERE' => 'b.display_on_posting = 1',
|
||||||
'ORDER_BY' => 'b.bbcode_tag',
|
'ORDER_BY' => 'b.bbcode_tag',
|
||||||
);
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event to modify the SQL query before custom bbcode data is queried
|
* Event to modify the SQL query before custom bbcode data is queried
|
||||||
|
@ -1119,13 +1119,18 @@ function display_custom_bbcodes()
|
||||||
// Convert Numeric Character References to UTF-8 chars.
|
// Convert Numeric Character References to UTF-8 chars.
|
||||||
$row['bbcode_helpline'] = utf8_decode_ncr($row['bbcode_helpline']);
|
$row['bbcode_helpline'] = utf8_decode_ncr($row['bbcode_helpline']);
|
||||||
|
|
||||||
$custom_tags = array(
|
// Does the closing bbcode tag exists? If so display it.
|
||||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
$bbcode_close_tag = '%\[\/' . utf8_strtolower($row['bbcode_tag']) . '\]%';
|
||||||
|
$bbcode_match_str = utf8_strtolower($row['bbcode_match']);
|
||||||
|
$bbcode_name_clean = preg_match($bbcode_close_tag, $bbcode_match_str) ? "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'" : "'[{$row['bbcode_tag']}]', ''";
|
||||||
|
|
||||||
|
$custom_tags = [
|
||||||
|
'BBCODE_NAME' => $bbcode_name_clean,
|
||||||
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
|
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
|
||||||
'BBCODE_TAG' => $row['bbcode_tag'],
|
'BBCODE_TAG' => $row['bbcode_tag'],
|
||||||
'BBCODE_TAG_CLEAN' => str_replace('=', '-', $row['bbcode_tag']),
|
'BBCODE_TAG_CLEAN' => str_replace('=', '-', $row['bbcode_tag']),
|
||||||
'BBCODE_HELPLINE' => $row['bbcode_helpline'],
|
'BBCODE_HELPLINE' => $row['bbcode_helpline'],
|
||||||
);
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event to modify the template data block of a custom bbcode
|
* Event to modify the template data block of a custom bbcode
|
||||||
|
|
Loading…
Add table
Reference in a new issue