Categories
Just Shelley

If only parents weren’t so real

If only I had brought the camera – I could have shown you such pictures of last Monday’s storm. The clouds were furious, angry, as if annoyed at having to push against the front facing them. Yet here and there among the clouds, a break would occur and the sun shine through.

At one time I was hit with winds so hard, they knocked me back and the air was cold, even in the middle of a hot, humid day. The sky took on a green cast and I knew that a tornado would form eventually from it, and it did, but on the other side of St. Louis. For me though, it was looking up at the sky as it pushed and pulsed down towards me directly over my head. At that moment, was the closest I’ve come to wanting to believe in God.

Eventually the might of the storm was past, and as I headed back to my car, the other storm watcher in the truck was leaving, stopping first to call out, “Hell of a storm, isn’t it?” I could only agree, both of us smiling like the damn fools we were to sit there in what could be the path of a forming tornodo. You had to be there, though.

I drove home directly back into the storm, amid constant lightning that made it difficult to focus on the driving, because of the incredible crashing sound and the bright glares of light in front and to the sides.

When I got home, I stood at the back door just looking at the sky and the constant lightning. When it turned 9, and my cellphone reached its ‘free minutes’, I called my Mom to share with her the half-formed funnels and the cool fronts, the blow by blow retelling of the story. Does this seem a child-like thing to do? To call one’s mother to share a storm?. She already knew about it anyway, having checked out the weather channel. We both like a good storm.

I call my mother once a week now, or more often when something interesting or special happens. This is contrary to today’s seeming fashion to blame one’s mother or father for whatever demons the person may be battling. Or the converse: making our parents into some form of super heros, as if by having us is comparable to fighting off tigers, inventing cold fusion, or creating world peace.

Some parents are heros, but not because they became parents. And for others whose parents or guardians were anti-heros–who beat or abused or abandoned–the demons are very real.

For many years I nourished a great deal of anger at my mother for events in the past, while making my father into the Man who could do no Wrong. When my Mom would say, “You’re a lot like me”, I’d reject this statement, being nothing like her. I would tell her I found more of my father in me than her, which was a hurtful thing to say.

And I did learn much from my father: honor and responsibility, not to mention inheriting from him my good Irish temper.

As for my mother – the last of the beatniks, the free spirits; the woman who left my father when I was young, and who left I and my brother to the care of dubious caregivers, well, for years I would keep in rare contact with her; a call here, or a letter there. I used to tell my ex-husband the reason I moved so much was so my mother wouldn’t be tempted to move where we were.

But anger unfaced and unresolved is a jail of our own making, and one can’t go through life carrying our parents about like wardens holding the keys to our happiness. I know someone who talks about his narcissic mother, again and again, and all I can think of is: at what time in his life is he going to stop punishing her in his mind, and go on with his life? Or is that the point– not facing life? Sometimes we carry our ‘bad’ parents about as shields as much as iron bars.

I’ve been particularly depressed these last few years, as I watched my glory days fade out about as quickly as the unreal dot-com profits. I’ve even tried an anti-depressant, which only made me very sick; though before I broke out in hives, the medication did clear my depression. However, it also cured much in me that I use in my writing and photography. Remove the bitter from bittersweet and all that I have left is bunnies and kittens and feeling good. Medication works for some, but not all; the rest of us have to find another way to confront our ‘demons’.

Not that I hadn’t tried, especially the demons arising from my mother. In September in 2002 I made the trip back west to confront her over the past, but rather than be cathartic, the event just left me more tired, and dissatisfied. My mother was guilty of the worst form of neglect and I was justified in being angry with her. At the same time, though, I love her, and secretly have to agree with her–I am like her a great deal. Does this, then, make me the monster that I remember from my youth?

It was only after a trip to my brother’s earlier this year, to watch my father while my brother was on Spring break that I came to understand my mother better. My father talked about one time when he had to take my brother and I along with him in the patrol car to an accident, and my brother released the brake on the car and it ended up crashing down a hill– a favorite story. He ended the story as he always did, laughing about telling my Mom that she couldn’t take piano lessons again. That she had to stay home, and take care of us.

He’d told that story a dozen times. Why was this the first time I heard what he had to say?

That started a series of calls to my mother– every weekend. This time not in anger, but in genuine curiousity. I wanted to know more about the woman that was my mother before she was Mom. And the man who is Dad.

She told me that she and her brother were told they’d have to leave home as soon as they were finished with high school–they were no longer welcome. I started to tell her, I wasn’t surprised remembering my grandmother, Atilla the Grandmum. But it wasn’t my grandmother who said they’d have to leave: it was my sweet, quiet grandfather. According to Mom, grandma tried to get my grandpa to reconsider and let them stay.

This shook my world with my memories of my grandmother and her sharp remonstrations on my behavior; all the while I would be spending quiet times walking the orchard with my grandfather while he would cut slices of peach for me with his pocket knife. But then unbidden comes to mind my grandmother’s care when I had the chicken pox; or the time when we women, well we women and one little girl, were canning corn and my grandmother exclaiming, “Lands sake, child! You’re going to be taller than your father someday! And prettier than your mother!”

(Towards the end of her life she would ask about me, but I wouldn’t visit. I didn’t even go to her funeral.)

But back to my Mom. My mother ended up living with her grandmother after she left high school–a woman who was very strict and religious. This was not easy on my mother, who was very outgoing and vivacious and popular with boys and girls alike.

She worked as a waitress in a roadside cafe where she met my Dad, a cop. He was a good looking guy, secure financially, and smitten with Mom, who was a couple of decades younger than he. They married, immediately had my brother, and then, not long after, had me.

We lived on a farm miles outside of town, and my Dad was gone on duty most of the time; leaving behind a young, talented, restless wife who never did have much chance or choice in what she did with her life. There was also a lot of younger good looking guys around who were more than willing to step in and fill in gaps in Mom’s life, though my Mom never cheated on my father. No, she just eventually kicked him out and divorced him. And then she went to town.

My Mom made mistakes during that time, some pretty serious ones. Some folks might even consider some of them unforgivable. I know I did. So unforgivable that I brought them out, again and again, polishing them with recollection until they were worn round and shiny, and wore them around my neck like some kind of fancy pearl necklace.

And I made a martyr out of my Dad – a true hero. After all, he didn’t want to go, and never re-married. He loved my Mother still, and loved us, too. He was always there for us–well, when he wasn’t on duty, but can’t fault a man for not being there when duty calls.

Yet, years later, I can finally see that my Dad made mistakes, too. It’s just his were not as obvious, or as immediate. I guess what I found over that series of calls is that my parents are neither saints nor sinners.

My brother won’t talk to my mother. He’s still angry at her. She won’t visit him and the kids because she’s afraid of flying, and she doesn’t act the proper grandmother role. Of course, he won’t talk to me now, too, because I failed as aunt in my last trip. Rather than nurture my 18 year old nephew, I, among other things, called him a lazy SOB when my 93 year old father carried up a sink worth of dirty dishes from my nephew’s room. My Dad got upset because I yelled at my nephew. He said, that’s what I’m supposed to do–care for the kids. Daughter to one, sister to another, aunt to even a third.

No. No. I think not.

It’s good to spend time with our parents, and find who they are as people. For me, it’s too late to have long talks with my Dad, though. He’s old, very old, and confused much of the time. I give him the love and respect he deserves, and that’s enough; I even lie when I write him now and tell him I have a wonderful job, so he doesn’t worry about me being a writer.

And now, at 49, I have found that I like my mother. I really like my mother. We have become good friends. If only we had talked sooner, we may have reached this place sooner. But then, neither of us was ready for this talk, long ago.

I was chatting with her this weekend about this and that, including the recent discussions about weblogging and women, and I mentioned something about having my Dad’s poor eyesight, as well as his height and temper. Mom said that I had some of her, too, and I replied, yes, I had her beautiful green eyes and a little of her artistic skills. She said more than that – I was a lot like her, in personality.

I giggled and said, “You mean flaky, odd, and annoying to men?”

She responded back with, “Well, I was going to say ‘different’. You’ve never been afraid of being different.”

She paused, undecided whether to be affronted or tickled, and said. “Well, flaky will work, too.” And at that we both broke out in laughter.

I guess I and my Mom are more alike than not: we both have the same laugh.

TO BE CONTINUED…

Categories
Technology Weblogging

Talkback as plugin

In my last post on WordPress, Carthik asked about my “Talkback” implementation. I hadn’t included this as part of my WordPress modifications because I’ve had the beastie since Movable Type times and didn’t think of it as a WordPress mod. However, I’ve since converted it into a WordPress plugin; you can access the text of the plugin here. Just copy this into wp-content/plugins/, rename it talkback.php, activate it and you’re good to go.

This particular plugin incorporates my fulltext implementation, so the code does need to be modified if you’re not using this. Look for the comment in the code that begins with “// if you don’t implement multi-page fulltext…” and follow the instructions accordingly.

To invoke the plugin, in a separate page, which I’ve called speakback.php, include the wp-blog-header.php in the beginning of the page, and then just call the function:

talkback();

Formatting is already included in the output.

The simplest approach would be to copy index.php, remove the guts of the main body, and replace it with this function call.

Then in your comments, call the page like so:

Talkback: <a href=”/speakback.php?name=<?php comment_author() ?>”>By name</a> <a href=”/speakback.php?url=<?php comment_author_url() ?>”>By URL</a>

Clicking on the name or URL will then bring up a page of the person’s comments at your site.

Categories
Books Technology Writing

If only

It’s been slow going getting another book deal. The publisher I’m currently talking with about a book on MySQL/PHP wants to include a provision in the contract to bill me if I’m paid royalties on books that eventually get returned from the book stores. Normally, the returns are more than compensated for by new book sales in any given quarter, so this is a non-issue; most publishers don’t ask for this. Nowadays, though – everyone wants a sure thing.

My counter to them is to hold back a percentage of the royalites against return; any of the amount still remaining when the book’s shelf life ends is then sent to me in one lump sum. I don’t like doing this–the royalites we get are so small as it is–but I can’t be looking forward to a royalty check only to get a bill, instead. Hopefully the publisher will accept this counter-proposal.

I need a book, though. More than just the money, I need to get back into working on a book. I’m so eager that I considered, briefly, putting my name into the list of CSS Luminaries that Eric Meyer asked for recently, for work on a new book on CSS. Of course, we all know I’m not a CSS luminary; I’ve spent much of my last few years working the server-side of the development teeter totter. But don’t discount my CSS skills. Rusty they may be, but I’ve been working with CSS as long, or longer than any of the other existing stars in our web design firmament.

For instance, Eric Meyer’s first article on CSS was for the October, 1997 edition of Web Review. I was already writing on CSS, as you can see from a March 28,1997 article from the same publication. Eric stayed with CSS, while I drifted off to other technologies, such as ASP and Java, Linux, and of course, weblogging and RDF.

If only I had stayed with CSS. I think of that now, especially when I’m having a hard time finding a book. If only I had stayed with any one technology – enough to become established as a ‘luminary’ in the field. But like a blackbird, always attracted by some new and shiny thing, I would soon grow bored with technology once mastered, and look for something new and challenging.

However, I have been playing with CSS a bit more recently. I decided to do two new themes for Burningbird – one representing my feminine side, one my masculine.

The Paths: Book of Color theme represents my feminine side– with wide open areas; lack of constraints; a rejection of absolute centering; and the sensuously combined colors of purple and orange, with just a touch of crimson. Notice that the sidebar doesn’t close, either at the top or bottom. Notice, also, the positioning of the content – not completely to the side, but not centered, either. The changing character of this new theme is represented in the backdrop, randomly pulled from my “path” photos.

My new masculine theme is Route 66, and I do think it’s quite nice. The colors are rich, and subtle, and even quite adventurous. It’s also been the most difficult to create because it forces all parts of the page into a centered box, with no open spaces between the components–and this isn’t easy, as many of you know. It is precise, constrained, centered, and very controlled.

Feminine open, and masculine controlled. This doesn’t necessarily reflect common viewpoints of male and female. But I’ve always seen my femininity tied to that part of me which longs for new roads to travel; that burns with a desire to knock down arbitrary and unnecessary walls. It is the practical side of me, but also the passionate–the part of me that tilts at windmills and dragons with equal enthusiasm. My masculinity, though, is that part of me that wants to control and constrain. It is bound with my sense of honor and duty, and desire for finding order in chaos. It’s the side that says to me, “But what about the bills”. My masculine side wants to lead, while my feminine side just wants to do its thing. The only emotion both sides share is a dislike of maudlin sentimentality – the masculine because it’s contrived, the feminine because it’s cheap.

Of course, for others, the reflections of their masculine and feminine sides are as unique as the people. Some may see their feminine side as controlling or ordered, while their masculinity is loose, and unrestrained. Isn’t it funny how the same terms can mean something so completely different to each of us?

“I won’t have eleven children,” she asserted; “I won’t have the eyes of an old woman. She looks at one up and down, up and down, as if one were a horse.”

“We must have a son and we must have a daughter,” said Terence, putting down the letters, “because, let alone the inestimable advantage of being our children, they’d be so well brought up.” They went on to sketch an outline of the ideal education– how their daughter should be required from infancy to gaze at a large square of cardboard painted blue, to suggest thoughts of infinity, for women were grown too practical; and their son–he should be taught to laugh at great men, that is, at distinguished successful men, at men who wore ribands and rose to the tops of their trees. He should in no way resemble (Rachel added) St. John Hirst.

At this Terence professed the greatest admiration for St. John Hirst. Dwelling upon his good qualities he became seriously convinced of them; he had a mind like a torpedo, he declared, aimed at falsehood. Where should we all be without him and his like? Choked in weeds; Christians, bigots,–why, Rachel herself, would be a slave with a fan to sing songs to men when they felt drowsy.

“But you’ll never see it!” he exclaimed; “because with all your virtues you don’t, and you never will, care with every fibre of your being for the pursuit of truth! You’ve no respect for facts, Rachel; you’re essentially feminine.” She did not trouble to deny it, nor did she think good to produce the one unanswerable argument against the merits which Terence admired. St. John Hirst said that she was in love with him; she would never forgive that; but the argument was not one to appeal to a man.

Virginia Woolf’s “The Voyage Out”

I was thinking on this last week when that great storm brewed up on Monday. I could see the clouds when I left the house for my walk, and almost turned back for my camera. It was late, though, and I kept going.

At Powder, after finishing my walk, I could see through the lower layers of mist to this tall cloud, tall, tall, reaching up to the sky as far as the eye could see. I knew then that this storm was going to be something special. I took off in the car to find a place to watch it, but couldn’t find a place to even pull over; not until I turned into the parking lot of a medical center to turn around and found that the back of the lot opened up to a completely clear view of the entire valley. And the storm, that magnificent storm.

I parked not far from a truck also pulled over to watch the storm and several car lengths away from two cars with four young guys. The guys had been skate boarding down the hill next to the medical center; when I pulled in, though, they were all looking at the sky and one of them saw me and started shouting something about the storm, pointing up to the sky.

I walked over to them, as we watched one funnel cloud form and then break apart. And then another. And another. The front of the storm was huge, and the clouds were actually rolled under, as if they had been turned about by forces unseen. One of the guys yelled out, “Let’s get out of here! That’s a tornado that’s forming!” I yelled back, “Why leave? This is incredible!

“You only live once!”, I shouted at him.

“Yeah! Live! That’s what I want to continue doing!”

They piled into their cars and took off, as I stood in the lot looking up at the clouds as the boiled above me, thinking what an odd thing for that young man to say: being afraid of a storm after spending who knows how long riding a skate board down a very dangerous hill. Understandable though: it’s the degree of control. You control what you do on a skateboard; you have control over your life. But a storm – no man or woman controls a storm. They had chosen the masculine path. I had not.

TO BE CONTINUED…

Categories
Diversity Political Weblogging

Women blogging the Convention?

Recovered from the Wayback Machine.

Since I’m on a roll about women’s apparent invisibility in weblogging circles, well except when we’re naked or shoving our titties in front of the faces of the boys, I am curious: which women bloggers have been credentialed by the Democratic party to cover the Convention?

We’ve already heard that a person infamous for indiscriminate and malicious comments about women has been given access. I’d like to think there might be a woman or two among the fifty or so men who will be going, so that the Convention goers don’t think weblogging is a boys only club.

Not that we think it is.

Of course not.

We all be equal here, we be.

update

At least it’s nice to know that we women don’t suffer blogger burnout like the guys.

Categories
Burningbird Technology Weblogging

WordPress modifications

Recovered from the Wayback Machine.

Rather than cover each modification I’ve made to WordPress 1.2 to run my site just so, I’m including them all here with links to downloadable source for those interested in implementing one or more of the changes.

Very few of these changes fit into the criteria of ‘Wordpress plugin’, primarily because most require at least a small code change to the existing application. The code changes within the application can be minor–such as adding a link in the menu for a new application page within the WP administration. Other changes, though, while not necessarily extensive, can be more challenging because of knowing where to make the code change; adding in the ‘moderated’ and ‘insert’ options into administrative edit page fits this second type of change. Regardless of the extensive nature of the change, upgrading to the next version of WordPress will overwrite these changes. My plan is to port whatever of these modifications haven’t been implemented in WP over to the next couple of releases, and then we’ll see what happens from there.

Hopefully, though, the WordPress team will consider incorporating some of these changes, such as the per-post moderation and full-page preview, the static generation of the syndication feeds, full text for broken up documents, and something like the self-policing comments. These are the toughest to incorporate by non-developers, primarily because it’s difficult to see where to add the code. However, these changes have made a real difference to me and from what I’ve read of others’ interest, they could make the difference for other folks, too.

Cleanup

First thing to do after installing WordPress is get rid of files you’re not going to use. Create a separate directory somewhere and move the unwanted files there, in case you discover you do want them at some future time.

For my installation, I’m only supporting Atom and RDF/RSS (RSS 1.0) syndication feeds, so I got rid of wp-rss2.php, wp-rss.php, and wp-commentsrss2.php. I also don’t support site registration or use OPML, and eliminated wp-register.php and wp-links-opml.php. In addition, I dropped the readme.html file, and wp-layout.css since I don’t need the former and I have my own stylesheets.

Within wp-admin, once everything was installed and imported, I dumped the import*.php and install*.php pages. The only ones showing in my source code downloads are those for my own modifications.

Since I’m not using sidebar links, I could also get rid of the link related pages, such as link-add.php and others, but I may come up with a purpose for this technology at some point, so I’ll leave them for now.

The reason you want to keep your site as clean as possible is that every PHP page is a doorway into your site. The door may be locked tight, and seem impossible to force – but why keep a functional page around when you’re not using it? Especially with the import and install applications: running them again may not hurt anything, but why keep them around for someone to run again?

Having said that, though, don’t delete the pages; just move them of the server, or to an area where they can’t be accessed via the web.

Creating separate category and individual files

At this time, all requests for category, individual, or archived posts go to the same file that serves the main page: index.php. However, I prefer a different look and feel with my category and individual displays, so the first modification I made with the WP installation was add these separate files.

I copied index.php to new files called individual.php and category.php. Aside from the modifications to the appearance of each page, I made the following code changes to individual.php:

1. I added in the “next-main-previous” navigation links at the top of the page, above the date. Checking out the source, this is lines 52-56, including the enclosing DIV tags. The actual code is on line 54. Note that this code has to be within The Loop as the WordPress development team refers to the post processing loop, beginning at line 38.

2. I kept some things in the individual page that I removed from the main index.php page. For instance, I kept the trackback autodiscovery function call at line 75, and the call to the embedded code to handle comments, wp-comments.php, at line 82. These aren’t useful in the main page, so why keep them around cluttering up the code?

3. Instead of a note about a post not being found, I redirect all missing posts to my main Missing Page. The reason for this is that it looks a lot better than the message; and it returns a permanent redirection status code to the calling page. A better option might be to return a 410 status code so that webbots know the resource is gone. Perhaps a future change.

I made the following changes to the category.php page:

1. I removed the RDF trackback function call and the wp-comments.php reference in category.php, as these aren’t useful in a category context. I also removed any other function call that wasn’t needed. I’ll probably do even more cleanup in this and the other pages.

2. I replaced the full post content function call from the main page (the function called ‘the_content’) with an excerpt at line 55. I prefer just showing excerpts on my category listing page.

Once the individual.php and category.php pages have been created, then it’s just a matter of redirecting requests to them rather than to the index.php. This occurs in the .htaccess page.

I used the following custom template tag structure for my Practical RDF entries:

/archives/%year%/%monthnum%/%postname%

With this, my individual items can be accessed using what we’ve come to know as ‘cruft-free’ URLS, consisting of the date and either post title or post slug (abbreviated title).

When I added this custom URL, WordPress generated text I added to my .htaccess file. It’s this text that I needed to modify to use my new pages. I’ve included my copy of .htaccess in the download, but the lines that are pertinent now are the following:

I changed this:

RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA]

To this:

RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?([0-9]+)?/?$ /individual.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA]

And I changed this:

RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]

To this:

RewriteRule ^archives/category/?(.*) /category.php?category_name=$1 [QSA]

Now, instead of index.php getting requests for all the pages, individual post requests are directed to individual.php, and category pages are directed to category.php.

I also removed some of the other WordPress generated .htaccess entries, such as those for syndication feeds of my categories and comments. I would prefer being given the choice whether these are syndicated or not, so have removed them for now.

Fullpage Preview

What I found frustrating with most of the weblogging tools I’ve used in the past is there is no way to preview a post in context. In other words, no way to preview a post, as it would show once published, within the same page constraints and look and feel as govern the post once it’s live.

One of the first tweaks I made to WordPress was to provide full page preview. Even when WordPress 1.2 came out with a preview item at the bottom of the edit page, I opted for my approach, which was a separate preview page and a link in the edit form to open it.

(I’ve since removed the code for the in-page preview from the edit form as it plays havoc with the larger essays.)

To create the preview page, I first copied my individual page, individual.php, to a new file, calling it preview.php. Since the header file in both only shows posts that are published, I also needed to make a copy of wp-blog-header.php, calling this new page wp-blog-draft-header.php. The new header page is exactly like the old one except that in the source, I changed the code at line 312 to access posts with status of ‘draft’ rather than ‘publish’. I then replaced the call to wp-blog-header.php with wp-blog-draft-header.php in preview. php, as shown in the source at line 14.

To call this preview page from the application, I added a hypertext link to the page in my edit-form-advanced.php page, at line 162, passing in the post identifier.

Now, when editing a post, clicking on the “Preview” link opens that post for preview exactly as it would look in the individual posting page.

On demand by post comment moderation

The second major modification was to add post-by-post moderation. At this time, WordPress only supports moderation for the entire site, but I want moderation of specific posts. This additional functionality required changes in the code in a couple of different places, and also required a minor database change.

First, there is no comment_status enumerated value of ‘moderated’ in the WordPress database posts table. (An enumerated value is one where options can be accessed as numbers, or as named values, which are easier to remember. )

I used PHPMYAdmin to add ‘moderated’ to the end of the list of other enumerated values. To do this directly in the MySQL command line, use the following:

ALTER TABLE `rdf_posts` CHANGE `comment_status` `comment_status` ENUM( ‘open’, ‘closed’, ‘registered_only’, ‘moderated’ ) DEFAULT ‘open’ NOT NULL

Next, I added the ‘moderated’ option to the list of other options within the WordPress edit page, as can be seen in the source in line 98. Now when the Edit page opens, ‘moderated’ is one of the comment options.

In the front end pages, in wp-comments.php, I added a note about moderation, and the reasons that it’s turned on, in lines 78 and 84 through 87. In wp-comments-post.php, I added code starting at line 110 to turn on moderated comment handling.

One last change I made fairly recently was to automatically set a post comment_status to moderated if it’s currently open, but over 20 days old. I added this within wp-comments-post.php, from lines 76 through 85.

That’s it for comment moderation. Now, I can set a specific post to be moderated as soon as I publish it. Or I can turn comment moderation on for several posts based on date or some other factor, by running a SQL update directly against the database and setting the posts’ comment_status to ‘moderated’. Finally, a post sets itself to be moderated when a person adds a comment to the post and it’s over 20 days old.

I may pull some of this code into a separate function just to clean up the page, but the functionality will remain the same.

Comment formatting and comment/trackback split

A change I made back in WordPress 1.02, was to split the display of comments in the individual page between trackback/pingbacks and comments. I also added formatting for the comments, by wrapping the comment area in a DIV element with a specific CSS class, and by providing my own author formatting.

I created two plugins to support these modifications. The first, get-comment-type.php has one function that returns the type of comment after examining the comment contents. The second, get-comment-author.php does all sorts of formatting on the author, using the same technology I used when I formatted the author while running an MT weblog.

In wp-comments.php, the comments are looped, and each is checked for type. If the type is trackback or pingback, the item is printed out, as shown in lines 45-57. Note in the code in line 48 the call to get_comment_type to get the comment type. Also note in line 54 the call to get_comment_author.

The same look and processing is also used with comments, in lines 59-71.

Formatting is added around the comment_text function call in lines 52 and 66. The CSS styling can then be controlled with each stylesheet.

Spam Control

Control for spam is mainly handled by setting older posts to be moderated, but to stop a ‘crapflood’ or a whole of lot of spam comments being added at once, I use a modification of the code that Jacques Distler originated, I believe: only allow so many comment postings within the same time period.

The code to help prevent flooding can be found in lines 87-101. First it checks to ensure that the same person hasn’t posted a comment within the last ten seconds–code provided from the WordPress development team. My addition is the code following, which checks to make sure there have been no more than 50 comments in the last day–any comments beyond that are automatically moderated. I’m no political pundit to get a lot of comments during the day, and 50 seemed sufficient.

Static page generation

Comment flooding just isn’t as much of a problem for WordPress as it is for Movable Type because a comment in WP is not much more than an insertion of a new row in the database. With MT, re-building of pages is happening, and that’s intensive.

If you think about it, mid-range web sites that provide database activity usually get several thousand database accesses or updates in an hour, much less a day. Few webloggers will meet or exceed this. But page rebuilding using a template language library is a very CPU hungry process. It’s because of this that I don’t generate static versions of all the pages when I re-build (more on static pages later). It’s more efficient to dynamically serve the pages, then rebuild when they’re new, or have been newly commented.

However, syndication feeds are different. The only time these should be changed is when entries in these pages are added or modified. However, the little buggers get accessed frequently – much more frequently than our main pages now. It makes sense to provide static versions of these pages.

The code I use to create static pages from dynamic content is fairly well known code. First, you grab a copy of the page in memory. Then you write it out to a filem usually located in the /tmp directory in Linux. Finally, when the file has been completely written out, you copy the page from /tmp to its permanent location.

You can see this code here . This function, which has been created as a WordPress 1.2 plugin, takes two paramters: The URL for the source, and the target file name. When installed, the person using the plugin needs to modify both the static HTML directory and the name of the temp file. The function call at the end – unlink – deletes the file.

The Unix /tmp directory is nothing more than a temporary directory where most users on a machine can write intermediate results, just as I am with this code. By writing the file to the TMP directory until finished, I don’t overwrite any existing version of the file, in case a problem happens and my write isn’t complete. If the program crashes in mid-write, there are mechanisms that keep /tmp clean so breaking program cleanup is not an issue. No bits of have burnt files to worry about.

Now that a static generation function exists, I can use it in two different ways: to generate static content based on an action, or on demand.

A second plugin, gen-static-main.php generates a static version of my RDF/RSS 1.0 file and my Atom syndication file. Through the use of the WordPress plugin architecture, this function is called any time the publish_post or edit_post action is initiated. Since I am following the requirements of the architecture, my function will be past the post identifier, which I have to return.

Now, any time I edit or publish a post, my static syndication feeds are created. I then use soft links to link these to my main directory:

ln -s /home/shelley/www/weblog/static_html/index.rdf index.rdf

For creating static versions of any page, I created a new WordPress administration form, get-static.php that takes a source URL and a target file name and generates the static version of whatever I give it. It can be my weblog entries, or others – it works equally well with any web page.

To add the new form to the administrative panel, I added an entry into the menu.php file at line 26.

Simple, and a sweet addition to the application.

(Note in menu.php that I’ve also removed the link to templates and links, since I don’t currently use either of these pages at this time.)

Fulltext

I like the use of WordPress’ nextpage functionality. With this, people can link specifically to individual items rather than the document as a whole. And it helps cut down on the page length for larger articles, such as this one.

However, two valid concerns about the implementation are: there is no way of overriding the page breakups for those who want to print the page, or not scroll; and comments repeat on every page and this can be confusing. Enter my Fulltext implementation.

The function responsible for splitting content into pages in WordPress 1.2 is start_wp. I created a plugin that has my own implementation of this function, fulltext-plugin.php that does everything the original does, but replaces nextpage with spaces instead of conceptual page breaks, as seen in lines 46-48.

Next, I copied individual.php to a new file called fulltext.php. This page is exactly the same as individual.php, except that it calls start_my_wp instead of the original function, in line 39.

To add a link to this page from my weblog pages, I modified index.php to check to see if the post is a multi-page and if so, provided a link to fulltext.php. This code can be seen on line 54. I also added code into the individual.php page to add this link, but also to prevent comments from showing in any page but the last page of the post, as seen in lines 78-83.

Now, any post that is split into multiple pages, like this one, also provides the facility to view it in its entirety.

Inserted pages

I’ve found over the years that at times I want to create pages in the weblogging tool, but not have them as part of the overall page navigation; I don’t want them to show on the front page, or be part of the archival lists. To support this concept in WordPress, I created a new post status called ‘insert’.

First, just like with the previously mentioned comment_status change, I added a new enumerated type of ‘insert’ to the post_status column in the database, using the same technique described with the ‘moderated’ change.

Next, I added this new type to edit-form-advanced.php, at the end of line 92. When this option is picked, the post won’t be displayed in the category, individual, fulltext, or main weblog pages.

To display this page, I copied the preview.php and wp-blog-header.php pages. The new header page, wp-blog-all-header.php has one change, to allow any posts other than those designated as ‘private’, at line 313. This new header is called in the new individual page, insert.php. Other changes to insert.php are to remove comments, as I don’t want comments in my inserted pages.

These new pages can be used as inserts for weblog posts, or to create about pages or other information pages that need to be publicly accessible, but not archived, syndicated, or posted on the front page.

Documented elsewhere

I discussed the Pithy Bar/Linklog implementation here. My multi-weblog support was discussed here. Note that with the release of 1.2, only the wp-content and wp-images subdirectories can be shared.

The technology for live comment preview at my sites was provided by Chris Davis and it has worked out to be a marvelous addition.

Other changes and the implementation of Steve Levy’s wonderful file upload enhancement are detailed here. My initial discussion on installing WordPress is here. Implementing the category image hack and other information is detailed in this post.

You can download a copy of the files I need to run my site, in G’zipped format or in a Zipped file, and I will update the documentation pages whenever I make a change.