Posts in the category "Tweaks".

The sound loonies must hear

Quote of the Day

(…) the first mosquito of the new season buzzes blood-thirstily past your ear with that eye-watering hum that always makes you think it’s the sound loonies must hear just before they kill all their kids or close their eyes on the Interstate and put the gas pedal to the floor or tighten their toe on the trigger of the .30-.30 they just jammed into their quackers (…)
— ‘Salem’s Lot by Stephen King

Word of the Day: Discombobulate — to cause to be unclear in mind or intent; confuse

On the search page I added the list of categories a post belongs to. (When a search returns results, that is.)

Some logic to monthly archives

This is wonderful! I just came across a way to get the monthly archives in chronological order while categories and main page are shown in the default way, descending order by date.

Adding &order=ASC to rewrite rules (the one that has index.php?year…) does the trick neatly!

Finland and Canada are skating against each other tonight. World Cup hockey. *fingers crossed* I’m NOT going to stay up and watch it though.

Wiping cold sweat

For a moment I was panicking. The database connection didn’t work on my or my hostess’s site (so the problem was with the server) and it seemed to go on forever. I updated my index page already, telling about problems, but then suddenly everything works. Phew.

Now, what was I supposed to write before I was cruelly denied access.

First of all, my sister spotted a silly sight while playing Splinter Cell:

Screenshot from Splinter Cell

That handsome chap there is Sam Fisher — the one in black. There’s a slaughter house at one point in the game, and one of the soldiers my sister (or Sam Fisher) shot, froze with his hands still holding the gun. Also the grimace is awfully funny but you probably can’t see it well. You can see the other corner of the mouth being darker and thus being drawn downward. (speak of the devil: Splinter Cell music just started playing on Winamp)

I saw two episodes of Dr. Phil this week. He’s supposed to be some really popular tv “shrink” but I don’t know… He sounds exactly like the guidance counsellor, Mr. Mackey, in South Park!! Hoookay? Sorry, it’s more like “m’kay” with Mr. Mackey but “hookay” with Dr. Phil. They sound the same, nevertheless.

I wanted to show the last update on my Booklog, but I’d removed the date of the post from my static pages. Well, running php from a post is not possible on WP. I found a wonderful plugin by Mark.

Also, “installed” Customizable post listings plugin (from Coffee2Code; wonderful site and wonderful name!!) and put a list of 5 most recently updated posts (including static pages, which is actually really good) and 5 most recently commented posts (currently there are only 2 though… :???: ) on the menu.

Kick yer MTs and Bloggers to the curve

I’m always thinking “now, where’s that page that looked like this and this and this” (or any info I need: “what did the text say under the picture on page so-and-so, on the right hand side corner below the title such-and-such” A slight case of photographic memory I guess. Only I don’t always *remember* the things I can see in my mind’s eye.)

WordPress references for me and you:

I installed a Breadcrumb plugin. I was going to add headers on the category pages but remembered this and thought it could be niftier. It doesn’t show on the main page but if you go to different archives or categories it shows where you are. On a single post’s page it shows all the categories the post belongs to in a comma separated list.

I also hacked a forget user info (from Scriptygoddess) option to the comments. I don’t like forms remembering my information and WordPress sets a cookie as a default.

Joined David Copperfield fanlisting. Today there was a “David Copperfield — Greatest escapes” on TV (Gawd, he’s cute! And funny). In 1997 I saw Copperfield in Finland (and he’s coming here again this December). After the show I’d written in my diary that I was feeling very unreal. It was a wonderful performance with his flying and getting-sawn-in-two and others that I can’t remember. In the tv show he said that after some outsider had shouted “move your feet” after the saw had cut Copperfield in two, they had a crew member shout the same thing in every show after that. I can’t remember if that was in the performance I saw.

The tour then was called Dreams and Nightmares and I started my dream diary soon after that. Named it “Dreams and Nightmares”.

Static

Inspired by the idea presented at Digitus, Finger & Co. I installed MooKitty’s Show Categories plugin and modified it with the code in a comment by Paul.

“Static pages” are posts but hidden from the index page, archives, and category listing. They can be found by search, however. I “staticised” my booklog and the page about me already but I still have some more work to do. I decided to keep commenting on for the static pages. I removed “lots” of things, though. It’s easy: Just add

<?php if ($cat != x) { ?> HIDDEN STUFF HERE <?php } ?>

around the bits you want to hide (x being the ID number of the category you are hiding). That bit of code means “if the category number does NOT equal x, show the bit between { and }”.
I hid the date, time posted, and word count.

The breadcrumb code is located outside the WP loop so at first I didn’t know how to get the category info for if-clauses (for hiding the breadcrumb from static pages). I found a function in_category(x) where x is the number of the category. It returns true or false. So, I put a

<?php if ( !in_category(x) ) { ?> HIDDEN STUFF HERE <?php } ?>

around the breadcrumb code and now it’s gone from the static pages just as I like it.

Making static (or more like non-entry) pages this way makes it easier for them to keep up with the modifications I make to the index page. I used to have the static pages as php pages where I had copied the “header” and “footer” of each page.

Getting closer to the Dark Tower

I bought Dark Tower VI: Song of Susannah today. Unfortunately I could only find Hodder & Stoughton’s copy. My sister got me the Grant copy of DT V for Christmas so I would’ve wanted to get a similar looking book. Oh well, H&S’s version is more beautiful (and it’s the same series than my DT I-IV box set).

That means I updated TGWLSK: there’s a picture of the spine of SoS in the Bookshelf.

Tomorrow is the enrolling to computer studies courses. I have to wake up before 9 am for that. Luckily I have to go no further than my computer because the enrolling is done via their website. Also, on Monday I have to enrol to Monako (translation stuff) courses and that too is computerized nowadays.

This autumn is very bad course-wise. There’s really not much to take. The spring however is packed and I probably have to give up on some of the courses I’m drooling over now. Oh well, I’ll do some book exams, and a silly computer course (mandatory) at home.

I don’t understand why there has to be so many courses to be done by book exams. I don’t want to read books and answer questions about them, I want to attend lectures!! That’s why I am at the university — for the lectures!

Last night (after being scared s***less by a moth that bumped into my bed lamp and flew crazily around only to be crushed between my sheet (ewww) and a magazine) I finished reading Douglas Adams’s The Ultimate Hitchhiker’s Guide. I started it gawd knows how long ago so I’ll probably read the Finnish version soon. The Ultimate guide includes the Hitchhiker trilogy (The Hitchhiker’s Guide to the Galaxy + The Restaurant at the End of the Universe + Life, the Universe, and Everything) and three other stories (So Long, and Thanks for All the Fish + Young Zaphod Plays It Safe + Mostly Harmless). I enjoyed the book because of it’s crazy humour (nutty names) and of course the wonderful, and surprising, playing with language. I don’t know how on earth the Finnish translator has been able to transport the word plays to the translation — but I will find out soon.

I had removed the month abbreviation from the calendar (template-functions-general.php, line 385 fwd) but now it turned out that the long word ‘September’ causes the arrows (») to go to the next line. So, I put the abbreviation back. I still will have ‘June’ and ‘July’ in their full form cause I’m just used to it. Why abbreviate words that are so short already? (A bit like b for ‘be’, u for ‘you’, 4 for ‘for’ etc. etc. etc.)

Yesterday I noticed that my hostess Shirasade had changed from Movable Type to WordPress. YAY! :mrgreen:

Subcategories away

I was trying to get rid of subcategories in a parent category (annoying when a post is NOT assigned to the parent category but still shows in it) with the help of a post by Andrew Hall. No luck. I studied the code and dared to comment out another bit that looked “right” and now it seems to work:
in wp-blog-header.php (found in the WP root folder) around line 293 (under “Category stuff for nice URIs”), comment out (= add /* before the code and */ after it) the line

$whichcat .= get_category_children($cat, " OR category_id = ");

Also, updated wpPaginate plugin (by Scriptygoddess) to .1.1.

UPDATE
On WP1.5. this is found in wp-includes/classes.php, on line 413. Comment out

$whichcat .= get_category_children($q[‘cat’], ” OR category_id = “);

UPDATE
On WP1.5.1.(1) these are found in wp-includes/classes.php on lines 393, 396, 420; below Category Stuff and Category Stuff for Nice URIs. Comment out the lines starting with $whichcat .= get_category_children

Hack-hackety-hack

Note to self: Adding a nicer search function a la Raena. I removed the counting of search results because I use pagination so if there are 10+ results it would show “There are 10 results…” even though there were more. Also, I changed the length ($excerpt_length) of “the_exceprt_rss” function in template-functions-post.php, line 194.

Added a Statistics hack for my own fun. Note to self: Doesn’t show private messages.

An observation: I don’t understand what the word count really counts… it always seems to be missing a few words. E.g. it claimed there was 18 words before this note here, and I counted 19…

I downloaded a lot of goldie oldie games from Pelit [Games] magazine’s site (you need to be a subscriber and registered to download): New Adventures of Zak McKracken, Maniac Mansion Deluxe, and Mario Forever. I also downloaded Codename Gordon, a 2D game with a Halflife motif. I was looking for Space Quest: Replicated, a fan-made game, but didn’t find it.

*insert proper curse word here* I’m going crazy with these mad insects flying around. They’re attracted to my desk lamp. If only I could whack ’em.

Count my words

I just installed a WordCount plugin I found at False Hopes. I’m tempted to put the total words in posts somewhere but that would require lots of queries to the database, I think, and I don’t want that. [edit]Oooh! It doesn’t add loading time nor queries considerably! I added it to the menu there, under Blog Archives[/edit]

On Tuesday I’m going to my aunt’s for the rest of the week. Had to change my WP configuration or I would’ve ended up with a blank index page by the end of the week. I had the setting “show posts from previous 7 days” and it’s not a smart one like on Greymatter but it’s actual, “physical” 7 days. I noticed that when I had only 4-5 entries on the front page (I’d been a lazy blogger!) and it seemed really short. Anyway, now I set it at “7 previous posts“. My behind’s covered. :laugh:

I also deactivated the Condensed Content plugin after getting tired of having to view each post’s individual page when looking for quotes to decorate with a nice left hand side dotted line. Now it’s still paginated but posts are shown in full.

Thought of the Da…Night Every post categorised as something else than Miscellany is yet another victory!

Hacking-hacking

Oooh. I’m so proud of myself. You see those picture texts in the menu? Well, not all of them were easy to get showing. For the link list (all things me, other sections) and calendar I had to “hack” a bit. I’ll show you:
in links.php (found in wp-includes folder) around line 563 you get

echo ' <li id="'.sanitize_title($cat['cat_name']).'">' . stripslashes($cat['cat_name']) . "\n\t<ul>\n";

which echoes (i.e. outputs) the link title in a neat unordered list. I wanted to assign an image to each link category title so I modified it to say:

echo ' <li id="'.sanitize_title($cat['cat_name']).'"><img src="'.stripslashes($cat['cat_name']).'.gif">'."\n\t<ul>\n";

instead. I changed the category names to one-word names so they won’t cause any problems as image names. Also, the image source path has to be absolute (http://…) which I don’t understand why, because you never leave the index page you just choose different content. Oh well.

The same thing — slightly simpler — has to be done to the calendar. In template-functions-general.php, line 366 (about) you find <caption> tags (following an echo) which is the caption, or title, of the table… obviously:
[edit Sep 15, 2004] I made it XHTML compliant by adding the end tag to the img tags [/edit]

<caption>' . $month[zeroise($thismonth, 2)] . ' ' . date('Y', $unixmonth) . '</caption>

I changed to

<caption><img src="'.$month[zeroise($thismonth, 2)].'.gif" /><img src="'.date('Y', $unixmonth).'.gif" /></caption>

Naturally, I have to remember to make an image for each month (I already made one for August cause it’s so soon) and year as needed.

:cool:

Now, I can go to bed.