You probably don't need to htmlspecialchars it since forum names allow HTML.
So you can probably grab it from the forumcache without a query modification. Need to confirm, but I never thought about that before.
Nice idea!
I've tested it with Latest Announcement and Latest Discussion/Threads blocks. It seems works for me, Yumi. I only need to replace the & to & using Template Conditional or PHP In Template plugin directly in template.
But don't you need to do that in the forum name already? From memory, MyBB doesn't htmlspecialchar forum titles on the forum list anyway...
Do you mean in Forum Title textbox in Edit or Create forum page, Yumi?
If I put the
& directly in Forum Name in Edit/Create forum page, in forum list and other default area like navigation and forumdisplay, it will return
&, not
&.
For example:
Forum Title: News & Announcements.
In forum list, it will return: News & Announcements.
In source page, it will return:
HTML Code
News & Announcements.
|
But, when I put:
Forum Title: News & Announcements.
In forum list, it will return: News & Announcements.
In source page, it will return:
HTML Code
News & Announcements.
|
I think it is because MyBB replaces the & to & in some files.
So, I think I need to replace it manually if I want to display forum name in other page using different variable, because I can't use & in Forum Title in Edit / Create forum page.
I'm sorry if I misunderstood what you mean, Yumi 
Sorry, had a look at the code:
PHP Code:
$forum['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['name']); $forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']); $forum['name'] = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $forum['name']);
$forum['description'] = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $forum['description']);
|
So it does replace & but not tags. Weird.
Other places:
PHP Code:
$foruminfo['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $foruminfo['name']);
|
Way to go for inconsistency...
Anyway, sorry about that. I see your point.