Forum Name In Portal Announcement
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #11
RE: Forum Name In Portal Announcement
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!

My Blog
02-24-2011 10:25 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #12
RE: Forum Name In Portal Announcement
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.

02-25-2011 07:04 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #13
RE: Forum Name In Portal Announcement
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...

My Blog
02-25-2011 08:34 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #14
RE: Forum Name In Portal Announcement
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 Oops


(This post was last modified: 02-25-2011 10:21 AM by RateU.)
02-25-2011 09:59 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #15
RE: Forum Name In Portal Announcement
Sorry, had a look at the code:

PHP Code:
			$forum['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['name']); // Fix & but allow unicode
			$forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']); // Fix & but allow unicode
			$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.


My Blog
02-26-2011 11:40 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: