Archive for February, 2006

 

Another WordPress Error and Fix

Friday, February 24th, 2006

WordPress 2.01 still bugged with errors

Unfortunately WordPress 2.01 still suffers from some anoying bugs. In order to get my nicer archives up and running I ran into an very annoying error. I tried to get a page saved and it produced this error on screen. The socalled WSOD was immently visible. Not a pretty site to see :(

Fatal error: Call to undefined method WP_Rewrite::flush_rules() in X:\yoursite.com\root\wordpress\wp-includes\functions-post.php on line 200

Hmmm, not so good… So a search on WordPress Trac for the solution was done. That’s more difficult then I expected. The exact error message wasn’t there at all. So I searched for hopefully related issues. This is what I came up with. A fix in the file ‘functions-post.php’ (resides in your wp-includes folder). Ah yes, important :!: , this implies only in the full WordPress version.

Remedy

  • The new file functions-post.php you can download here.

But, as always, be careful, make a backup of the ‘old’ file first, for instance by renaming it, then use the new file. After, test your functions in WordPress and test your website. All should be in order.

Conclusion

My first feeling is that saving your posts and/or pages goes faster then before. Could be only a feeling. I can’t verify this on hard evidence. But it certainly gives a reassurring feeling nonetheless. In the WordPress Trac changeset #3525 it states the fix has something todo with time-date manipulation by WordPress. I am interested to know how this can relate to my problem? Anyway I considered it a good idea to keep you informed about this. We aren’t out of the bug-valley yet. But I am very much confident it will be fixed by those magnificent people at WordPress.

The longing for Beauty…

Wednesday, February 22nd, 2006

Visit the Museum

In Bruxelles you can visit the Palace Museum for Fine Arts (“Palais des Beaux Arts“) or ‘Bozar’ from february 17th until may 5th. They will give an expostition of the ‘Wiener Werkstatte‘. A very fine and exclusive collection of Art Nouveau and Impressionists will pass before your eyes.

More than a thousand objects from the MAK in Vienna and from international collections present the utopian vision of the Wiener Werkstätte, the “Viennese Workshop” of the decorative arts, which gave us the Stoclet House here in Brussels. Gesamtkunstwerk ? total work of art, by the score!
In the first decades of the 20th century the Wiener Werkstätte set themselves the objective of reconciling the fine and applied arts, of disseminating art throughout all aspects of life, and of taking the same pains with the simplest objects of everyday life as with works of art.
The leading lights, Josef Hoffmann and Kolo Moser, inspired and led a group of artists that distinguished itself in every creative domain. The exhibition offers an in-depth analysis of the designs and solutions put forward in response to the needs of early 20th-century society. The finest example of a total work of art produced by the Wiener Werkstätte is unquestionably the Palais Stoclet in Brussels, the most remarkable collective work of international art nouveau. So it is only right and proper to place the Palais Stoclet in the foreground of this exhibition. The contemporary artist Heimo Zobernig is creating an exceptional scenography for the exhibition, in dialogue and in harmony with the architecture of the Centre for Fine Arts.

Wiener Werkstatte

WordPress 2.01 bug and fix

Sunday, February 19th, 2006

A bug in WordPress 2.01 detected

Hello everyone! During my ever continueing quest on housekeeping I stumbled on a nasty bug in WordPress. This happened after my risky upgrade to WordPress 2.01.

RSS, XML, FeedBurner feeds

What happened :?: When clicked on the badges on my sidebar I only got ‘comments’ feed. This happened for all the syndicates (XML, RSS). A search on the WP-forum delivered me with this post. I would suggest to all WP 2.01 users to read it and fix it with a few extra pointers from me. The bug report is rather sparse in how to fix this problem.

Fix the Feed Bug in WordPress 2.01

Open up the file “classes.php”. It is in the directory /root/wordpress/wp-includes/. Search for line number approx. 1299. There you see this:

// Comments
$comments_rewrite = $this->generate_rewrite_rules($this->root .
$this->comments_base, true, true, true);
$comments_rewrite = apply_filters(‘comments_rewrite_rules’, $comments_rewrite);
// Search

The problem lies in this line from the part listed above.

$this->comments_base, true, true, true);

It is not complete. Fix:

The FIX

Just edit that line until it reads:

$this->comments_base, true, true, true, false);

Notice the addition of the boolean ‘FALSE‘?
When added and uploaded my problems were over.
I hope it will help your feeds too.

Adding functions to the Wordpress post editor

Saturday, February 18th, 2006

The standard WordPress post editor

The standard editor is perfectly adequate for, like it says, standard postings. No problem. But :!: Like many of us we would like our code tidy, valid and as a whole more suitable for search engines to follow, i.e. thus creating more hits or traffic. Lorelle, again Lorelle, has written many postings on all subjects. That is a good thing too. But unfortunately our standard editor lacks quite a bit of extra functionality to help us with that. There are WordPress plugins who can help us with just that. Here is one from a dutch guy Roel Meurders. He made it quite simple for you to add buttons to the quicktags bar in the post editor. Ofcourse you can also use the advanced WordPress editor. Activate the advanced post editor (or TinyMCE) logged in as the site’s administrator under ‘My Account’. It’s is all the way down on your left, a checkbox. There is only one thing with the TinyMCE editor. It can be a nuisance to use when it comes to, there it is again :) , validation and tidying up your code. Okay, I have mentioned a few things about the post editor in general. How about getting our hands dirty?

Let’s go and hack some code

The post editor from WordPress is actually nothing more then a rather extended javascript. You can find it in your WordPress directories under the directory /root/wordpress/wp-includes/js/. The javascript file “quicktags.js” is your target for today!
Just open it up with your “home garden and kitchen” text editor. Looks intimidating :?: …naah just a little bit. It has structure, so a bit of reading should help you understand it quite fast. I have modified mine with quite a few extra’s. Here is a screenie of it.
quicktag wordpress editor
Notice the red circles? The extra’s :!:
Okay, first you can download my quicktags from here. That will certainly get you started in a jiffy. Remember to upload it to the previously mentioned directory or it will not work at all. That is one way to do it. The other, that is right, is “do your own coding“. First things first. Question :?: What extra’s do you want? Write them down or just put a knot in a handkerchief :) For example. Standard, the editor comes with the button look-up. It redirects you to a dictionary site. Fine if you are, like me, a bl..dy foreigner, and wants to write in english. I use it frequently to look things up for it’s grammar. But what if you want to give your visitors some more explanation but you don’t want that in your posting? Well, Wikipedia ofcourse:!: There is an bonus to it aswell. More links in your postings the more likely it becomes that, for instance, a Google sniffer, gets hold of your site and traffic will boom in no time at all. Well, that is the general idea anyway. So I added an extra button on the editor named “Wiki”. Now I just select a word that needs extra explanation and click on my Wiki button. Presto, a search for the selected word is done automatically for your readers. Ain’t that sweet?

Coding recommendations

As I wrote above, adding relevant links to other resources in your postings will get your blog noticed, no doubt. That’s the whole point isn’t it? I will not get in the details in how to increase your traffic. This is done for us in a very extensive and learning way already by Lorelle. So I will leave at that. One thing I will pinpoint is how to modify your WordPress installation with some minor hacks here and there. Mind you I am not responsible for any damage. Do this on your own account. Don’t worry you can always upload the originals if necessary. Back to our subject. Links in your postings and how to add them in a relaxed manner. One thing I mentioned was the ‘Wiki’ button. Others are the <acronym> and the <p> html-tags. Both contribute to more up to standards [x]html. Especially the <acronym> tag is a good example. It is a way of giving a description about certain subjects and or words that you use in your postings. You can even give them a bit of extra CSS adornments, like I did. I will write a posting on that one later on. Paragraphs <p> and <H> tags (mind the lower case for valid XHTML!) are also noticable for search robots like the ones from Google for instance. They search for these tags, that is to say, the contents they have.

Last bit of advice

Use up to standard code. I believe I have mentioned this already somewhere haven’t I? It is of vital interest for your site’s readability, accessibility and validity. And so will increase, given time, your site’s traffic. I am still trying anyway. But fear not, I have my share of validation errors almost everyday too. Ofcourse I always correct them. So can you:!: it’s not difficult. One step at a time they say isn’t it? Till next post, bye.

Look at the birds…

Saturday, February 18th, 2006

FSX will certainly give us a ‘birdseye’ view!

:hi: everyone!

Judging on the preview pictures you can watch on my Flickr space, FSX will be a winner (again) for sure. To watch all of the pictures just click on the button and a slideshow will start for you.Microsoft FSX

Ofcourse the very ins and outs about this new born aren’t known yet but the people at Microsoft have already answered a few interesting questions. See for yourself.

the questionaire…

  1. Q: When will “Microsoft Flight Simulator X” be available?
    A: We are working hard to deliver “Flight Simulator X” in the holiday 2006 timeframe.
  2. Q: What’s new in “Microsoft Flight Simulator X”?
    A: Many of the new features in “Flight Simulator X” are based on requests from our loyal community who have provided creative input into our decision process. Therefore, we are excited to bring our fans the most revolutionary addition to the “Flight Simulator” franchise yet. We take full advantage of Windows Vista and the latest Windows gaming hardware to create a beautifully rich and immersive 3D world for aviation fans, young and old, to explore and experience. The new enhancements extend beyond the look and feel of the planet—the advances in graphics will benefit the aircraft as well, and fans will be amazed at the new level of detail in the models and the realistic effects like sun glint off the glass and chrome, reflective paint, and even shaded rivets on the fuselage. For the more gameplay-minded, we are adding a new mission-based element to give fans a more objective driven experience with a sense of progression and skill development. We are also improving the multiplayer technology to allow the community to connect in new ways. This is just the beginning and, in the coming months, we look forward to sharing more information about “Flight Simulator X” as we lead up to launch at the end of the year.
  3. Q: Will “Flight Simulator X” require Windows Vista?
    A: No. While “Flight Simulator X” will not require Windows Vista, it will be optimized for the latest in Windows gaming hardware and fans will get the best experience by running on Windows Vista.
  4. Q: What type of computer hardware will I need to run “Flight Simulator X”?
    A: While we are still determining exact hardware requirements, we do know that it will run on a wide range of configurations because we want to make “Flight Simulator X” accessible to a wide range of fans.
  5. Q: Will “Flight Simulator X” ship on DVD only?
    A: Yes, for the first time “Flight Simulator” will ship on DVD only in order to provide the highest level of detail and realism for the product and we do not plan to offer a CD-based version.
  6. Q: Will aircraft from FS2004 be compatible with “Flight Simulator X”?
    A: Backward compatibly with existing 3rd party content is and has always been a priority for us, and we attempt to test as many add-ons as possible in order to provide the greatest level of compatibility.
  7. Q: What are the types of aircraft featured in “Flight Simulator X”?
    A: We will offer a range of aircraft to support a wide variety of flying experiences and many of the aircraft will be tied to specific mission-based experiences. Our basic fleet is merely the starting point because we are going to make it easier to download additional aircraft created by the many accomplished add-on developers in the community.
  8. Q: How many airports are included in “Flight Simulator X?”
    A: We have included more than 24,000 airports in “Flight Simulator X” and the coverage extends to every continent. We also focused a select number of high-detail airports and added a new level of “interactivity” that the add-on community will certainly expand upon.
  9. Q: What new partners or endorsements will “Flight Simulator X” carry?
    A: We are not quite ready to shine the spotlight on our new partners and endorsements, but they will be taking center stage in the months leading up to our launch.

Tim playing…

Thursday, February 16th, 2006
tim playing soccer


soccer…

All about Tim

This is Tim, my son, doing what he likes best of all. Play soccer or european football.

This posting is published directly through Flickr.com itself. I didn’t even know about it’s existence until now. Very nice features there on Flickr.com. You should try it it’s real fun to do.

 

Validating XHTML

Wednesday, February 15th, 2006

Housekeeping my xhtml

Call me a purist. I just like to have my code valid. It is also far better for your feeds aswell. They rely on valid code. Lorelle has dug herself into this aswell a while ago and she came up with some tips and hints which might interest you too. Offcourse you should look at WordPress too for they wrote some good stuff on the subject too.

HandsOn experiences with validation

I decided today to do some housekeeping on my postings and pages in general. Guess what… Errors at the validating service from W3C. One very specific error I wasn’t aware of is that you just can’t put <p> everywere. They need to be at the beginning of the lines but not, this was my mistake, nested around an <ul> or an <ol> listing. This just is not up to standards. Just look at a quotation from Elliot Back’s site:

Incorrect nesting of lists. Please do not place lists inside a paragraph tag. The w3c reports this error as “document type does not allow element “ul” here; missing one of “object”, “applet”, “map”, “iframe”, “button”, “ins”, “del” start-tag.

I found this piece of extra learning at this site here from Elliot Back. He describes, in good to understand language, what the basics are for valid XHTML. I can sincerely recommend it to you.

WordPress Plugin

I thought it might be a good idea to have look around for a suitable plugin that would ease the pain of those errors a bit. It just happens to be that both the standard WordPress editor and the advanced TinyMCE editor aren’t that great at valid coding. What’s more both WP and the editors are sometimes a teeny bit illusive. I just can not always fathom why a piece of [x]html is coded that way or another. I am used to that hands-on feeling with it. So to take matters in my own hand I activated this plugin from Jamie Talbot. It is called ‘XValid’ and as far as I can tell does the job very good. It even tells you what, if any, errors have been corrected. You have full control over what happens to your coding. What is important is that you deactivate WordPress’s own XHTML correction. You can find it under Administration-panel->Options->Writing. Just uncheck the validator from WP where it says “WordPress should correct invalidly nested XHTML automatically”. What is also important for your site’s validations to Xhtml (be it transitional or strict) is the way XValid can email you as the administrator on comments being added that aren’t valid. Or have errors in them. This way you can correct those errors and still have a very clean site.

Validation Resources

These resources will help you validate your web pages and code and can help you understand a little more about how validation works.

HTML – Validation

Upgraded Wordpress 2.01

Monday, February 13th, 2006

Stepping list

So I took an awfull risk this evening in upgrading to Wordpress 2.01. I forgot to deactivate my plugins. I forgot to backup my mysql database. And to my surprise… It worked like a charm. Database is upgraded aswell. WP asked about that. Just one tiny step and we were up and running again.

Please please I urge you

Do not do this at home!
Read this first when you are upgrading from a previous version! Or this publication if you are a newbie. Print it out if you have to because I was on the brink for a total melt-down here. Fortunately nothing shocking happened. Pffff.

At first glance

To be frank I do not notice a bit of difference. But as they say… Over 114 issues are solved. Gone, history! Congratulations go to the WP-team! Hear, hear!

You can download the new offspring here.

Alterations

  • I adjusted a thingy or 2 in “wp-comments-post.php”. Look for this line;
    if ( get_settings(‘require_name_email’) && !$user_ID ) {

    It bothered me when someone could (by accident) hit the button and got an error announcement without a proper link-back. So I added some in the error-trap here. Like so:

    if ( get_settings(‘require_name_email’) && !$user_ID ) {
    if ( 6 > strlen($comment_author_email) || ” == $comment_author )
     
    die( __(‘<span style="font-family: verdana;font-size: medium;color:
    #808080;">Error: please fill the required fields (name, email).</span>
    <form><input type="button" onclick="history.go(-1)" class="button" name="back"
    value="&laquo; back" /></form>’) );
    elseif ( !is_email($comment_author_email))
    die( __(‘<span style="font-family: verdana;font-size: medium;color:
    #808080;">Error: please enter a valid email address.</span></span> <form><input
    type="button" onclick="history.go(-1)" class="button" name="back" value="&laquo;
    back" /></form>’) );
    }
    if ( ” == $comment_content )
    die( __(‘<span style="font-family: verdana;font-size: medium;color:
    #808080;">Error: please type a comment.</span> <form><input type="button"
    onclick="history.go(-1)" class="button" name="back" value="&laquo; back"
    /></form>’) );

    You can find the code between lines 39 and 48 approx. But watch out! Make a copy (i.e. backup) first, then edit.

  • Do you find the textarea also quite small? Edit file “edit-form-advanced.php” in the wp-admin directory. Look for these lines:
    <?php
    $rows = get_settings(‘default_post_edit_rows’);
    if (($rows < 3) || ($rows > 100)) {
    $rows = 30;
    }
    ?>

    At line 160 approx. You can alter the $rows value to 30 like I did. If this doesn’t work for you can also alter the next line were it says

    rows="<?php echo $rows; ?>"

    and edit it into this:

    rows="30"

    Nice huh?

  • Something I missed in the standard editor aswell was an extra button for putting in paragraphs. So I added a button. Open up “quicktags.js” in the wp-includes/js directory. Somewere between lines 44 and 50 you see this (it really doesn’t matter all that much were as long as the sections remain intact)
    edButtons[edButtons.length] =
    new edButton(‘ed_em’
    ,’i’
    ,’<em>’
    ,’</em>’
    ,’i’
    );

    Add another section with this

    // Added by Me
    edButtons[edButtons.length] =
    new edButton(‘ed_par’
    ,’&#182;’
    ,’<p>’
    ,’</p>’
    ,’y’
    );
    // end editing

    So that it looks like this

    edButtons[edButtons.length] =
    new edButton(‘ed_em’
    ,’i’
    ,’<em>’
    ,’</em>’
    ,’i’
    );
    // Added by Mart
    edButtons[edButtons.length] =
    new edButton(‘ed_par’
    ,’&#182;’
    ,’<p>’
    ,’</p>’
    ,’y’
    );
    // end editing

    And you are done!

Cheers until next time!