Strict Standards: Redefining already defined constructor for class wpdb in /home/bri58020/public_html/mike/wp-includes/wp-db.php on line 52

Deprecated: Assigning the return value of new by reference is deprecated in /home/bri58020/public_html/mike/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/bri58020/public_html/mike/wp-includes/cache.php on line 389

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 556

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /home/bri58020/public_html/mike/wp-includes/classes.php on line 678

Deprecated: Assigning the return value of new by reference is deprecated in /home/bri58020/public_html/mike/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/bri58020/public_html/mike/wp-includes/theme.php on line 508
2006 » July MikeFitz with overflow bit set…

Archive for July, 2006

I’m not worthy! I’m not worthy!

Monday, July 31st, 2006

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bri58020/public_html/mike/wp-includes/formatting.php on line 74

We’re not worthy! We’re not worthy!
— Wayne and Garth bowing down before Alice Cooper, Wayne’s World (1992)

Last month, I was honoured to be included in Frank Arrigo’s list of top 10 referrers. This list contained some august company indeed and I was certainly pleased to be on it.

But ever since then, I have tossed and turned at night, wondering how I managed to refer so much traffic to Frank’s blog. I mean, we’re talking Frank here! The Robert Scoble of Australia! Suggested by many as the Scobleizer’s replacement or Microsoft’s new #1 blogger. He with the stellar LinkedIn stats.

This cannot be right. Am I really worthy of making Frank’s top 10? Has Frank made a blue when compiling his stats? Hmmm…

(more…)

Using CSS and ‘display: none’ to control how your blog prints

Monday, July 24th, 2006

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bri58020/public_html/mike/wp-includes/formatting.php on line 74

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bri58020/public_html/mike/wp-includes/formatting.php on line 81

A topic I’ve often discussed with other developers at user group meetings is the use of CSS to control how web pages print.

As well as content, many web pages also contain extra elements like menus and navigation links that only make sense on screen. Often when we print a web page, we will want to print just the content and leave out menu and navigation elements. This has particularly been an issue for many of my SharePoint Portal Server sites.

A couple of weeks ago, I was asked about this again and I thought “I should really blog this.” Pangs of guilt reminded me that I hadn’t actually cleaned up my own blog to suppress the sidebar when printing. Last night, I finally got around to fixing my blog’s CSS to do this. In your browser, select File, Print Preview to see how this blog page will print. Note that there is no sidebar. If you are viewing just this one post, there are no top navigation links to next and previous posts and no “Leave a Reply” form.

So how is this done? Three techniques which I have used to control how web pages look when printed are:

  1. Link to a separate Print CSS style sheet
  2. Include an “@media print” section in the existing style sheet, and
  3. Include an in-line style in the HTML.

1 Link to a separate Print CSS style sheet

This is the technique I have used on this blog. Have a look at the source of this page (View Source in Internet Explorer) and note that in the <head> there are two <link> tags linking to separate CSS style sheets, one applies when viewing this page on screen (media=”screen”) and the other applies when printing (media=”print”)


<link rel="stylesheet" href="http://brisgeek.com/mike/wp-content/themes/mikefitz/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="http://brisgeek.com/mike/wp-content/themes/mikefitz/styleprint.css" type="text/css" media="print" />

Further down in the <body>, the sidebar and navigation elements are contained in <div> tags. Note that there may be multiple navigation divs so we give them all a class of “navigation”. However, there is only one sidebar, so it can have an id of “sidebar” like so…


<div class="navigation">
    Navigation stuff, eg "Previous Entries" goes here…
</div>

<div id="sidebar">
    <ul>
        <li>Sidebar menu goes here…

Finally, the styleprint.css file contains many of the same styles as the screen version. However there is one important addition…


#sidebar, div.navigation {
    display: none;
    }

It is the display: none; which hides the sidebar and navigation.

Fitzsimon IT Consulting websiteI have used a slight variation on this technique on many websites including the Fitzsimon IT Consulting website at www.fitzsimon.com.au.

Have a look at the source of this website and note the use of two <style> tags to import the separate screen and print stylesheets.

2 Include an “@media print” section in the existing style sheet

This second technique is one I have used on many SharePoint Portal Server sites where I cannot easily modify the HTML to include a second “print” style sheet. Very simply it involves creating an @media section in your existing style sheet as follows…


/* **** SCREEN Section */
/* Top Banner (incorporating Logo) on main Portal Pages */
.ms-bannerframe {
    background-color: #000066;
    border-bottom:1px #000066 solid;
    }
    /* other screen styles go here */

/* **** PRINT Section */
@media print {
    table.ms-bannerframe {
        display : none;
        }
    #SPSWC_NavBar {  /* Top nav bar on Portal pages*/
        display : none;
        }
        /* other print styles go here */

    }

3 Include an in-line style in the HTML.

Fraser Island Luxury Beach House websiteThis third technique is not really recommended, but I have to admit to using it when making a quick change to an existing website such as Fraser Island Luxury Beach House.

View the source of the Fraser Island website and note that I have included the following in-line style in the <head> tag of the HTML page.


<style media="print">
#leftnav, #bottomNav {
    display: none;
    }
</style>

Then do a File, Print Preview and note that the left and bottom navigation menus are not printed.

So there you go. Three techniques to suppress unwanted navigation and menu elements from your printed page leaving maximum room for your all-important content. Happy printing (and happy clients)!

————————————–
Update: 19 August 2006
I see from my stats that I have been getting a lot of hits on this post. Thanks for stopping by and please let me know if you find this information useful. (or not!) — Mike

the engineer hoist by his own petard: in Beirut

Saturday, July 22nd, 2006

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bri58020/public_html/mike/wp-includes/formatting.php on line 74

Nick & Nora Charles alerted me to this deliciously ironic tale of the hardline Muslim cleric, previously barred from Britain for glorifying violence, being turned back as he tried to get on board a British warship to flee Beirut.

I like to think I wouldn’t delight in the misfortune of others but when I finished reading this article in The Australian, my subconscious had planted a huge smirk on my face.

Middle East Peace: We cannot afford to do nothing.

Wednesday, July 19th, 2006

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bri58020/public_html/mike/wp-includes/formatting.php on line 74

Once again, the extremists on both sides have demonstrated that they are masters of provocation and over-reaction. In this conflict, there are no good guys or bad guys, just Perpetrators and Victims.

The blogosphere has an air of despair over the Middle East. Some point out that the peace process is kaput. Some suffer. Most of us gape in horror.

Standard solutions clearly aren’t working; the whole world needs a radical new approach.

Stop asking: Who is to blame?

For starters, we need to stop asking who is to blame for the latest outbreak. The answer to this question will only lead back to the previous outbreak, then to the one before that and so on, past the Six-Day War, past the Holocaust, into antiquity. There is no solution there.

One Lateral Thinking Solution

When Edward de Bono was in Brisbane recently, he offered a radical solution: Let each side vote in each other’s elections. Let Israelis vote in Palestinian elections and let Palestinians vote in Israeli elections. That way, only constructive people would get elected. Extremists on both sides wouldn’t stand a chance.

Admittedly, obstacles to this proposal may be numerous. However, I’ll put it forward as an example of the type of solution that our planet’s leaders need to be exploring.

Who can pull this off?

The world now more than ever needs help from the UN, backed by the European Union, the Arab League, Russia and as many neutral parties as possible. Perhaps it is time to ask even China to help?

OK, I have to say it: “US, Out Now!”

Obviously, it is time for the US to step back from its role as the world’s policeman. Sadly, George Bush’s presidency has sapped any credibility the US had as a broker of peace. Any solution with overt US military involvement will now be inflammatory.

The US still needs to be involved, but financially, not militarily. It needs to fund the construction of schools, hospitals and infrastructure throughout the Middle East. Its taxpayers might ask “What’s in it for us?” But the benefits of peace in the Middle East will clearly flow to the US, and not just by the tanker-load. Plus, it will be cheaper than the current mismanagement of Iraqi construction projects. Not to mention saving the lives of US servicemen. I saw the 2000 crosses on the beach at Santa Monica last October. Have we hit 3000 yet?

We cannot afford to do nothing

We must explore the radical solutions now! Otherwise this conflict will continue to foment global terrorism. We will then waste all of our planet’s resources on warfare and responses to terrorism, bringing closer the day when our species ceases to exist.

—————

Update: I’m pleased to see that my comments on the blog of my local newspaper, the Courier-Mail, were picked up and printed in today’s edition.

Happy New (Financial) Year

Saturday, July 1st, 2006

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bri58020/public_html/mike/wp-includes/formatting.php on line 74

Did everybody have fun last night singing “Should auld accountants be forgot…”?

Or did you have as much fun as I did; getting those last-minute parking receipts in and balancing the petty cash account?