Code Authors: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Code Authors Forum Index -> phpNuke Hints, Tips and Tweaks
Author Message
Guardian
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 4465
Location: Vsetin, Czech Republic

PostPosted: Sun Jan 08, 2012 12:16 pm Share on Linked InShare on FacebookShare on Twitter Reply with quote

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 
View user's profile Send private message Send e-mail Visit poster's website
montego
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 308

PostPosted: Sun Jan 08, 2012 2:42 pm Share on Linked InShare on FacebookShare on Twitter Reply with quote

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... 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 4465
Location: Vsetin, Czech Republic

PostPosted: Sun Jan 08, 2012 5:14 pm Share on Linked InShare on FacebookShare on Twitter Reply with quote

Looks like the forum stripped out a lot of the code you posted but yes I know what your saying Smile
And do I mind you venting? hell no!

_________________
TPD 
View user's profile Send private message Send e-mail Visit poster's website
montego
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 308

PostPosted: Mon Jan 09, 2012 11:01 am Share on Linked InShare on FacebookShare on Twitter Reply with quote

Uuuggghhhhh... why would the forum strip that out? Bummer. I don't recall the core RN forums doing this as they have their own filtering system (well, actually, more like escaping upon output).

_________________
Where Do YOU Stand?
HTML Newsletter :: ShortLinks :: DynamicTitles :: Approved Membership Lite :: And more... 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 4465
Location: Vsetin, Czech Republic

PostPosted: Mon Jan 09, 2012 11:10 am Share on Linked InShare on FacebookShare on Twitter Reply with quote

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 
View user's profile Send private message Send e-mail Visit poster's website
montego
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 308

PostPosted: Tue Jan 10, 2012 1:02 pm Share on Linked InShare on FacebookShare on Twitter Reply with quote

Yeah, I don't think we need to worry about tag removal in the forums as it is already using its own form os htmlspecialchars() output "encoding".

_________________
Where Do YOU Stand?
HTML Newsletter :: ShortLinks :: DynamicTitles :: Approved Membership Lite :: And more... 
View user's profile Send private message Visit poster's website
spasticdonkey
Newbie
Newbie



Joined: May 12, 2009
Posts: 74
Location: TX

PostPosted: Tue Jan 10, 2012 10:09 pm Share on Linked InShare on FacebookShare on Twitter Reply with quote

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 Wink

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 Very Happy


Last edited by spasticdonkey on Tue Jan 10, 2012 10:20 pm; edited 1 time in total 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jan 06, 2006
Posts: 4465
Location: Vsetin, Czech Republic

PostPosted: Tue Jan 10, 2012 10:19 pm Share on Linked InShare on FacebookShare on Twitter Reply with quote

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 
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Code Authors Forum Index -> phpNuke Hints, Tips and Tweaks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

 
Forums ©
linear-bunchlinear-bunch
linear-bunch