Skip to content

Commit fc23389

Browse files
discovered an interesting bug, naturally fixed it with javascript
Signed-off-by: Diego Andrés <diegoandres_cortes@outlook.com>
1 parent aeee594 commit fc23389

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Sources/PostPrefix/PostPrefix.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,11 @@ public static function display_message_list(&$messages, &$posters)
215215
foreach ($context['topicinfo']['prefix'] as $prefix)
216216
$context['topicinfo']['prefix'][$prefix] = $context['topicinfo']['postprefix_'.$prefix];
217217

218-
// Add the prefix to the title
219-
$context['subject'] = self::format($context['topicinfo']['prefix']) . ' ' . $context['topicinfo']['subject'];
218+
// Add the prefix to the title without harming any other vital usage of this information
219+
addInlineJavaScript('
220+
var pp_subject = document.getElementById("top_subject");
221+
pp_subject.innerHTML = \''.self::format($context['topicinfo']['prefix']).'\' + " " + \'' . $context['topicinfo']['subject'] . '\';
222+
', true);
220223

221224
// Add the prefix to the linktree
222225
$context['linktree'][count($context['linktree'])-1]['extra_before'] = self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;');

package-info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
44
<id>smftricks:postprefix</id>
55
<name>SMF Post Prefix</name>
6-
<version>3.2</version>
6+
<version>3.2.1</version>
77
<type>modification</type>
88
<install for="2.1 - 2.1.99, 2.1 Beta 1 - 3">
99
<!-- Mod Readme -->

0 commit comments

Comments
 (0)