Cookies Conquered

Added ‘Control Panel‘, using cookies to control appearance of the web page.

Learned that setcookie command must be used before any html tag, even before the head tag. Cookies set on a page cannot be used on that page, since the page has already been rendered. However, if you use a variable to set the cookie, you can use the variable on the current page.

Modification for Opera Compatability

Moved the navigation menu under the content for compatibility with Opera Browser which faithfully layered the sub-menu under the content, making the sub-menu inaccessible. Seems to be the only browser that obeys layers!

A little clean up

Created a header.htm include file which contains common style sheet references and HTML <head> code. Updated all php files to ‘include’ the header.htm, replacing most of the <head> information in each file. All php files are now devoid of repetitive content to the greatest extent possible.

Renamed footer.php to footer.htm for consistency and updated all php files calling it.

Gallery2 visual integration revisited

The good news is that I figured out how to include a file in the Gallery template files.

{g->theme include=”Main_Menu.htm”}

The bad news is that I have not figured out how to include a file outside the Gallery directories. Therefore, I cannot use the same files for the banner, nav, and footer that I use in the rest of the site. To change any of these, I would need to edit 2 files instead of one.

Re-Do Visual Integration of WordPress

Performed complete re-do of the visual integration of WordPress starting from a fresh classic theme. On the first attempt, I could not integrate the main site’s global style sheet because my understanding of CSS was not deep enough. The first attempt consisted of substantial modification of the WordPress style sheet, making global updates impossible.

The second visual integration starts with the same global style-sheet used by the rest of the site. Relatively modest changes to the WordPress style-sheet were needed to finish the job.

Altered Banner.php, index.php, and footer.php to imitate the positioning of the rest of the site.

Had a hard time getting the side-bar to float. Had to move it from the footer.php into the index.php. Had to make ‘position’ of side-bar ‘static’ rather than ‘absolute’. It would not float while absolute. Had to eliminate the ‘clear’ declaration from the comment id. This prevented the side-bar from floating next to the comment.

For future reference, the Glen’s World footer is needed to extend the star background of the container beyond the header to the bottom of the page.

3/13/2013 Update: To clarify for future reference:

  • Header.php in the WordPress themes folder 1) references the site style sheets, 2) opens the site container div, and 3) includes the site banner div;
  • Footer.php in the WordPress themes folder 1) closes the site container div and 2) includes the site footer div.

As of this writing, the theme folder is themes/Experimental2Classic which is a copy of the themes/classic folder.

Website Publishing: What You Need

This is the first of two essays on the subject of website publishing. The second is What you Need to Know.

Introduction

You may not need to publish a website to accomplish what you want. If what you really want is a blog, for example, you can set one up for free at WordPress.com. Google offers lots of free on-line collaboration tools. At some point, you may feel limited by these free tools. If you don’t have the money to hire a professional to create a website, you may want to take the plunge and run your own website. Think of it as an adventure!

Here are some things I wish I knew when I first started.

Continue reading

Posted: Tuesday, May 18th, 2010
Category: Essays

Style Sheets for Printing

Modified the paralegal internet research page, to display answers to the lab problems after a code is given in a form. Used a php header statement to redirect to the print page if the correct code was given.

I freaked out a little. After doing a lot of work to get this page to work correctly, I tried to print the hand out. The print-out looked nothing like what displayed on screen. The answers were not indented, the font color was missing, the automatic numbers were gone.

Turns out, it was a problem with my stylesheet reference. I had been using

<link rel=”stylesheet” type=”text/css” href=”http://www.glenpritchard.com/css/global-styles.css” media=”screen”>

The problem was ‘media=”screen”‘. I did not know that you can specify different style sheets for printing and on-screen viewing. Specifying ‘media=”screen”‘ means that the style sheet will be used for what is displayed on the screen and not what prints.  Using ‘media=”print”‘ will work for printing, but not anything else. To use the same style sheet for all purposes, ‘media=”all”‘ may be used.

W3C has a nice reference about style sheets. It also has a reference about media types.

Update: Because the style sheets are cascading, there was no need to redirect the research page to a separate print template. The same page can be used for screen and print! For future reference, the redirect code, which must go at the top before the <html> tag,  looks like this:

<?php
if($_GET[“code”]==”reject4053″) {
header(“Location:http://www.glenpritchard.com/paralegal/print.php”);
}
?>

WordPress Secure Mail Form Plug-in

I tried to install the fast and secure contact form plug-in and experienced an error message after entering the captcha code. Said that it could not set the cookie’s. I found this page on the subject regarding the same error in a comment captcha plug-in by the same author.

Oddly, I was able to send one message from the form when I switched themes back to the classic theme, added one comment to a random post. But then when I switched back to the custom theme, I got the same error message.

This is vaguely similar to the problem that CoffeeCup HTML editor has in uploading a file to a new folder. It cannot write to the new folder until at least one file has been created there. After the first file is created, it uploads fine.

In any event, I could not get it to work, so I uninstalled it.