Kalervo

Journal 4: StartPage()

I started this journal entry a few hours ago, so when I went and hit “post to forum,” Moodle logged me out and I lost what I had been typing. Absolutely enraging. Here’s the chunk that I copied and pasted into Word about halfway through. I’ll come back and retype the rest of my annotations later, once my blood stops boiling.

I’m just going to go ahead and present my annotations the same way Amelie has: the code will be in regular text, while my notes will be in italics. I chose to annotate the StartPage() function because I’ve done a bunch of goofing around and experimenting with it on my own. Consequently, it should be mentioned that I’ll be annotating my own version of the StartPage() function (not that there are any significant changes):

function StartPage() {

This declares the function and opens its description with the { symbol.

$LeftNav = “$LeftNav = ”
<tr><td colspan=1><a href=ecgtext.php?form=newtext>View Texts by Date Created</a></td></tr>
<tr><td colspan=1><a href=ecgtext.php?form=newtexteditor>View Texts by Editor</a></td></tr>
<tr><td colspan=1><a href=ecgtext.php?form=newtexttype>View Texts by Type</a></td></tr>
<tr><td colspan=1><a href=ecgtext.php?form=newtexttype>View Texts Alphabetically</a></td></tr>
<tr><td>&nbsp;</td></tr>
“;

This is a basic display for what will be seen on the left side of the page (hence $LeftNav, meaning the variable for the left navigation of the page).
means, I believe, the opening of a new table row, while <td colspan=1> means the opening of a table division spanning one column.

I believe that <a href=ecgtext.php?form=newtext> means the opening of a line that will refer to the hypertext protocol that takes the user to the new text page; users that click on the line that includes “View Texts by Date Created” will be taken there. However, because I haven’t actually created functions yet for listing texts by editor, type, or alphabetically, clicking on any of those lines will redirect to a blank page. In any event, </a></td></tr> means the closing of the a class, table division, and table row. &nbsp indicates that following these lines, there will be a non-breaking white space just before the overall box is closed. The semi-colon wraps things up.

$Text = “<html>
<head>
<title>editing interface: test</title>
<meta http-equiv=\”Content-Type\” content=\”text/html; charset=iso-8859-1\”>
<link href=ecgtext.css rel=stylesheet type=text/css>
</head>

<!– BEGIN HTML BODY –>

$Text = “<html> indicates the Text variable that opens up standard html coding on the page. After this, though, I get a little lost. I know that <head> opens up the definition of the heading of the page (as in what it says at the top of the browser) and <title>editing interface: test</title> is what the page will actually be called. However, the next confuses me. Is it indicating a meta http equivalent content type and setting out the typeset and font?

The following line, <link href=ecgtext.css rel=stylesheet type=text/css>, performs a hypertext reference to the ecgtext style sheet.

</head>, of course, closes our heading. We are now ready to begin the main body of our HTML page layout.

<body leftmargin=20 rightmargin=10 topmargin=10 bottommargin=0>

This line lays out the dimensions of the main box containing the body of the page. The margin numbers indicate character cell spaces.

<table width=100% border=0 cellspacing=0 cellpadding=6>
<tr>
<td valign=top align=center width=245 cellpadding=20>

This now lays out the dimensions of the table on the left. Note that the width, border, cell spacing, and cell padding are set out such that the table will always retain its size.

<!– BEGIN LEFT NAVIGATION –>

<table width=100%>
<tr><td align=center><a href=ecgtext.php class=homelink><img src=town.gif border=0 vspace=20 hspace=30></a></td></tr>
“.$LeftNav.”
</table><div align=right><img src=villein2.gif hspace=35 vspace=140></div>

<!– END LEFT NAVIGATION –>

</td>

I found this interesting. It creates a hypertext reference to return to the home page before actually placing within the linking object. In this case, the linking object is sourced from the town.gif image, called up with img src. v(ertical)space and h(orizontal)space ensure that the image will never be closed upon by the box, while border=0 makes sure that it is a floating image (I think). The hypertext reference is closed with </a>, and followed by the closing of the table division and row.

$LeftNav calls up the earlier defined value that creates our view text options (even though the additional ones I created don’t actually navigate anywhere yet). The table is then closed, but a never division is opened below it, aligned to the right side of our left navigation. Again, img src is used to plop down our happy reader guy.
<td valign=top width=100%>
<table width=100% bgcolor=990000 cellspacing=0 cellpadding=0>
<tr><td width=100% bgcolor=ffffff valign=top align=center>

Now we start a new table division, this time aligned to the top of the page with dimensions that ensure the box will expand and contract with the browser window. I’m fairly certain that bgcolor is our background colour, but I’m confused by what follows. I understand that ffffff sets our background colour within the box as white (try changing it to gggggg and it turns black!), but I can’t figure out what 990000 does (changing it to another value doesn’t seem to do anything). I also don’t know what means exactly, though I assume it just names this class of object.

<!– BEGIN FORM –>

“;

return $Text;

}

We’ve approached the end. What’s most interesting here is that we have only just finished defining the value $Text (hence the line holding just the close of the quotation marks and the semicolon), and then we immediately use return to call it all up. So this means that $LeftNav is a value we’ve nested inside of $Text. The entire function needed to be defined just so at its end we could call it up. I kind of end up thinking about it as building a whole bunch of circuitry that finally has a button placed on top of it. The only thing needed to make all that circuitry work is to push the button. That having been done, we close things out with a curled parenthesis.

And there we are. In some aspects, I’m happier with the little redux my technical hiccup has called for; in others, I’m still quite upset. Learn from my mistakes, guys: always copy and paste into a word processor before trying to submit what you’ve typed to the forum.

This week, my main goal is try to get one of the empty links I created to do something, even if that something isn’t what it’s really meant to do.

Advertisements

One response to “Kalervo

  1. What I found interesting is when I was pasting your journal entry in here, the code was translated to actually DO stuff and I had to go back and separate the lines so that it would not. But I still can’t get rid of those weird boxes in the end!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s