| Author |
Message |
Guardian
Site Admin


Joined: Jan 06, 2006
Posts: 4469
Location: Vsetin, Czech Republic
|
Posted:
Sun Jan 08, 2012 12:16 pm |
 
|
When Nuke Sentinel is disabled or the site itself is disabled or in test mode, NS generates and message visible only to admins.
Unfortunately, this message breaks W3C validation because the message is output before the BODY tag starts.
Since I run this site with NS disabled, this is something of a P.I.T.A so a quick fix is to simple move the call the function themeheader.php in header.php from this
Code:
global $ab_config;
if ($ab_config['site_switch'] == 1 && isset($_COOKIE['admin']) && is_admin($_COOKIE['admin'])) {
echo '<div><img></div><br>';
}
if ($ab_config['disable_switch'] == 1 && isset($_COOKIE['admin']) && is_admin($_COOKIE['admin'])) {
echo '<div><img></div><br>';
}
if ($ab_config['test_switch'] == 1 && isset($_COOKIE['admin']) && is_admin($_COOKIE['admin'])) {
echo '<div><img></div><br>';
}
themeheader();
|
to this
Code:
themeheader();
global $ab_config;
if ($ab_config['site_switch'] == 1 && isset($_COOKIE['admin']) && is_admin($_COOKIE['admin'])) {
echo '<div><img></div><br>';
}
if ($ab_config['disable_switch'] == 1 && isset($_COOKIE['admin']) && is_admin($_COOKIE['admin'])) {
echo '<div><img></div><br>';
}
if ($ab_config['test_switch'] == 1 && isset($_COOKIE['admin']) && is_admin($_COOKIE['admin'])) {
echo '<div><img></div><br>';
}
|
It does push the center blocks down a few pixels as you would expect but it means the site now validates. |
_________________ TPD |
|
|
 |
montego
Site Admin


Joined: Jan 06, 2006
Posts: 311
|
Posted:
Sun Jan 08, 2012 2:42 pm |
 
|
And, really, no reason why CSS couldn't be used to bring more attention to the message if that were a concern with moving it down.
This is why it is so important to have well thought out structure AND presentation, yet keep them separate in implementation.
This message is similar to the *nuke public message. Each one of these should have good solid semantic structure around it - especially for accessibility reasons - while at the same time the ability to style using CSS.
What I hate seeing is this:
[code]
<div>Some Important Message</div>
[/span]
Ok, so I have exaggerated a bit to make a point. A better approach might be something more like this:
[code]
<div>Some Important Message</div>
[/code]
My choice of DIV vs. SPAN is arbitrary my only thinking "box" rather than "in-line", but even some of this can be changed now on the fly. Again, the structure should be looked at holistically and the right elements used (often several options exist).
My primary point really is good quality HTML/CSS design is not, IMO, just adding a ton of classes to cover individual styling attributes - like what you see in my first example - but rather to focus on the true "meaning" behind that particular part of the page structure and allowing the presentation side proper access to styling it however is needed.
In the first example, how could one possibly style the public message? IMPOSSIBLE as it would more than likely hose up many other site areas also using this very poor CSS implementation method.
I really wish I had the time to blog on stuff like this as I am just so frustrated with the mess I see at times with the lack of experience or understanding in how to really code with good proper separation in mind. <sigh> So, I just decided to lay out a few thoughts here... hopefully you don't mind. |
_________________ Where Do YOU Stand?
HTML Newsletter :: ShortLinks :: DynamicTitles :: Approved Membership Lite :: And more... |
|
|
 |
Guardian
Site Admin


Joined: Jan 06, 2006
Posts: 4469
Location: Vsetin, Czech Republic
|
Posted:
Sun Jan 08, 2012 5:14 pm |
 
|
Looks like the forum stripped out a lot of the code you posted but yes I know what your saying
And do I mind you venting? hell no! |
_________________ TPD |
|
|
 |
montego
Site Admin


Joined: Jan 06, 2006
Posts: 311
|
Posted:
Mon Jan 09, 2012 11:01 am |
 
|
|
|
 |
Guardian
Site Admin


Joined: Jan 06, 2006
Posts: 4469
Location: Vsetin, Czech Republic
|
Posted:
Mon Jan 09, 2012 11:10 am |
 
|
I better try and check if anything has changed then as this site is using RN 2.5 at the moment. I did add a couple more HTML tag exceptions to the forum config settting so I better check that in case it's gone nutz.. |
_________________ TPD |
|
|
 |
montego
Site Admin


Joined: Jan 06, 2006
Posts: 311
|
Posted:
Tue Jan 10, 2012 1:02 pm |
 
|
|
|
 |
spasticdonkey
Newbie


Joined: May 12, 2009
Posts: 74
Location: TX
|
Posted:
Tue Jan 10, 2012 10:09 pm |
 
|
I believe the tag removal happens because html is enabled in the forums config. Check the "disable html" box if you are posting code examples and it should work ok
I have a mantis issue for "Cleanup public_message function" but it was pushed out of the 2.5 release due to time constraints. Expect to see that horrible formatting removed in a future release  |
Last edited by spasticdonkey on Tue Jan 10, 2012 10:20 pm; edited 1 time in total |
|
|
 |
Guardian
Site Admin


Joined: Jan 06, 2006
Posts: 4469
Location: Vsetin, Czech Republic
|
Posted:
Tue Jan 10, 2012 10:19 pm |
 
|
Thanks, I'll turn that off and see what happens. I don't recall turning it on though but it was on when I just checked. |
_________________ TPD |
|
|
 |
|
|