Blog posts tagged "holiday"

This post was inspired by Gryphic's Christmas Stories prompt "What is the true meaning of Christmas? Love, presents, or just plain celebration?*"

As of this, this is not a true story, but actually a fictitious, short story.*

Tamara looked out the window at the billowy, white snow that covered everything the eye could see. Though she and her family were snowed in their house for a few days, tomorrow was Christmas. And the snow hadn't knocked out their Internet connection.

Tamara remembered back to a month ago when she sat, writing her Christmas list. It was full of "wants" and "needs" and "retroactive lollipop machines". She couldn't wait for those things to arrive. At the time, anyway.

Now, however, she thought differently. It wasn't some magical leaf turnover like in A Christmas Carol, but she was actually starting to think that there could be a meaning of Christmas further than material happiness.

The many family reunions they had gone to within the last week had prooved that, if anything. But the thing that had done the magic was the snow. The snow that had trapped her and her family in her house for half a week (according to the weatherman).

Without anywhere to go, she spent most of her time with her family. It was actually fun. Everyone was being joyful and happy, not at all upset that they couldn't go and buy more EggNog.

With Christmas fast approaching tomorrow, she knew that, over the presents, her family would actually mean something this year. And that is the true meaning of Christmas.

Hatkirby on December 23rd, 2008 at 12:30:12pm
πŸ‘ -2 πŸ‘Ž

You must be looking at this post and thinking, "Ok, what?" Yes, probably. I really don't know.

Anyway, this is just a rant. And it's about my iPod. It's a new (well, two months new) Chromatic (yellow and pretty) and works pretty well. However, randomly, during arbitrary songs, the music will suddenly STOP.

And then, you know you have to hurry if you want to keep listening to that song. When that happens, I have to rip the headphones off of my ears and unlock (take out of HOLD) the iPod. At that moment, the iPod will make a very loud noise. So loud, you can hear it quite clearly even without the headphones on. "Oh, goodness," you should think to yourself, "I just saved my eardrums."

Immediatly after I do that, the music starts playing and the pause button doesn't respond for a few seconds so I miss some of the song. :( This is really annoying, and I don't know why it happens. Does anyone know? Knowing Apple, is it a feature or a bug? :)

Anyway, yes, you can say it.

"Ok, what?"

Hatkirby on December 21st, 2008 at 12:32:03pm
πŸ‘ 3 πŸ‘Ž

YAY! People seem to be much more interested in Kirby Week this year! :)

YES! - 6 vote(s)! No. - 3 vote(s)! Maybe.... I haven't decided.... - 2 vote(s)! What on earth is Kirby Week? - 0 vote(s)!

Well, thus ends Kirby Week 2008. I hope you've all had fun! And, yay, I messed up yesterday! Stupid me!

It's nearly Christmas, so don't be sad, only a few more days until we're all glad. (That was a terrible rhyme)

Hatkirby on December 20th, 2008 at 7:47:25am
πŸ‘ 2 πŸ‘Ž

Um.... not really. Just trying out another Nonsense script! Well, I guess it's the teensiest bit relevant because Four Island went down.

Don't blame Linux you peoples! It was actually my fault. Yesterday, frustrated with Debian's.... um.... not-up-to-datedness-with-packages thing, I stupidly added the Ubuntu APT repository to /etc/apt/sources.list.... and tried to sudo apt-get upgrade. Oops.

The upgrade broke halfway done because it tried to install a package that used "Breaks", which Debian's old dpkg couldn't handle. So I was left with a mutant system, half Debian, half Ubuntu, completely unstable. I was afraid that if I turned it off, it'd never turn on again.

Exasperated, I backed up all of the data, downloaded Ubuntu 8.10 Server Edition, installed it and here we are! Four Island is back and better than ever! Ubuntu always used to work for me before I got a dedicated server and it seems to be working fine now.

And yes, I am a lazy person to the extreme. I'm sorry to everyone that I forgot to write the final article of Kirby Week 2008 :(. So instead, I'm just going to redirect you to a previous article.

I wrote an article entitled How To Implement Pingback a while back (in fact, on June 17th 2008, though since I changed time zones it says June 16th) that explains how to implement Pingback on your blog. You should do that because Pingback is a very useful thingy and I'm crazy about it. :)

And to end off, I'm going to include a few more results from that Nonsense script I mentioned:

Tamasys destroyed Color Pencils
W. B. Sarel thinks Wikipinia is thick sticky
The Fourm is taken over by Chofox Hudper
Tamasys wants to have plagurized Smiley
Four Island is parodied by Color Pencils

The last one is disturbing as Gryphic (or Drifty, as she now calls herself) actually has done this. :) However, she's purged all articles on her site before Four Island finished its extended downtime, so I can't link to it. Sorry! :)

Hatkirby on December 19th, 2008 at 5:41:54pm
πŸ‘ 1 πŸ‘Ž

On the fifth day of Kirby Week, Four Island gave to me: An way of making URLs look prettier.

As I promised yesterday, today I'll be showing you how to use prettier URLs to reference your blog posts. We'll be removing the query string.

In this tutorial, I'm assuming you're using the Apache web server with mod_rewrite enabled. Otherwise, you'll probably need to read more elsewhere when we get up to the .htaccess file.

Speaking of the .htaccess file, let's do that now. In your kirbyweek08 folder, create a file called .htaccess and put this in it:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/ read.php?slug=$1 [L]

Well, that's yummy-yay-yay, but the read.php file does not yet accept a slug parameter. Let's add that functionality now with an upgrade to the read.php file. Find the line that says:

$getpost = "SELECT * FROM posts WHERE id = " . $_GET['id'];

Replace it with the following:

if (isset($_GET['id']))
{
 $getpost = "SELECT * FROM posts WHERE id = ";
 $getpost .= $_GET['id'];
} else if (isset($_GET['slug']))
{
 $getpost = "SELECT * FROM posts WHERE slug = \"";
 $getpost .= $_GET['slug'] . "\"";
}

This will allow read.php to parse slugged URLs. Now that Prettiful URL support has been added, you think you're done, right? Wrong. We have to fix the links to read.php in functions.php and rss.php.

Within functions.php, there are two occurances of this partial line of code:

<A HREF="read.php?id=<?php echo($sqlOutput['id']); ?>">

Replace both with:

<A HREF="http://example.org/kirbyweek08/<?php echo($sqlOutput['slug']); ?>/">

Of couse, remember to replace http://example.org/kirbyweek08/ with the path to your blog.

In addition, the following partial line of code appears in rss.php:

/read.php?id=<?php echo($getposts3[$i]['id']); ?></link>

Replace it with:

/<?php echo($getposts3[$i]['slug']); ?>/</link>

And there! You're done! You've added prettiful URL support to your blog! YAY!

Tomorrow we'll be discussing other small improvements you can make to your homebrew blogging system.

Hatkirby on December 18th, 2008 at 12:30:25pm
πŸ‘ 3 πŸ‘Ž

On the fourth day of Kirby Week, Four Island gave to me: An article about implementing RSS.

It's another day of Kirby Week which means another tutorial! Today's post will be short because there's not that much to dynamically creating an RSS feed. What's that, you say? You don't know what RSS is? Le gaspez!

RSS stands for Really Simple Syndication. It provides a list of your latest blog posts (or anything, really, RSS can also be used nicely for things such as comments) in a format computers can read. This way, a computer can more easily tell if you publish a new blog post, for instance, and notify anyone who wishes to be notified.

RSS is an XML specification, so the entire thing is based upon a system of tags. Let's get to writing it!

Create an rss.php file in your kirbyweek08 folder. The root tag is the <rss> tag, with a mandatory attribute (version) that has to be set to 2.0. So, our document current looks like this:

<rss version="2.0">
</rss>

Every RSS feed has to contain a <channel> tag with information about the feed in question. Let's populate it with some default data that you can change:

<rss version="2.0">
 <channel>
  <title>Kirby Week 2008</title>
  <link>http://example.org/kirbyweek08/</link>
  <description>A description! YAY!</description>
 </channel>
</rss>

The fields introduced above should be pretty self-explanatory. The next thing to do is to dynamically introduce the latest 10 blog posts into the <channel> tag. I've done that here: http://other.fourisland.com/kirbyweek08/?source=rss.php. Ensure you replace all instances of http://example.org/kirbyweek08/ in the code with the path to your blog.

So, now you've got a feed. That's great, however, people probably won't know its there. Open up your custom header.php file. Somewhere between your <HEAD> tags, add this snippet of HTML:

<LINK REL="alternate"
      TYPE="application/rss+xml"
      HREF="rss.php" />

Now that you have an RSS feed, there are other options to consider, such as using a service like Feed Burner to "burn" your feed. Feed Burner can track subscribers, links clicked on, suspicious uses and other things, for instance, making your feed look prettier with little widgets at the bottom of each post.

Currently, the URLs we use to access each of your blog posts are kind of ugly (they all contain read.php?id=). Tomorrow we'll focus on removing the query string from the blog post URLs.

Hatkirby on December 17th, 2008 at 12:38:32pm
πŸ‘ 3 πŸ‘Ž

On the third day of Kirby Week, Four Island gave to me: An article about using IntenseDebate.

Welcome back! Yesterday, I promised I'd show you how to add a commenting system to your blog. And I will! But, being the lazy person I am, I'm not going to show you how to write one. Instead, we'll be using Automattic's IntenseDebate.

IntenseDebate is a good commenting system by the makers of Wordpress. Yes. Ok. Anyway, it has lots of prettiful features that it enumerates all over its site so you should go read it.

IntenseDebate is pretty easy to get started with. Simply go to its website, register for an account, and add a blog. When it asks you what type of blog you have, choose "Custom" or "Generic". It'll provide you with two Javascript snippets.

We're nearly done! Already! Take the first snippet and paste it in read.php, after the call to displayPost() but before the inclusion of footer.php. There! You're done! That was easy!

If you want to change your settings, moderate comments or anything, simply log in at the IntenseDebate website and you're dashboard is your friend!

Tomorrow, we'll be adding RSS support to your blog so people can receive notification and other fun stuffses.

Hatkirby on December 16th, 2008 at 12:31:02pm
πŸ‘ -1 πŸ‘Ž

On the second day of Kirby Week, Four Island gave to me: A tutorial on coding an admin panel.

Welcome back to the second day of Kirby Week! As I told you yesterday, today's post is about writing an Admin Panel! Yay! We're going to only create a very basic panel: Single user login and when you get there, all you can do is write posts.

We'll be storing the single user in the database for some deranged reason. Possibly later we'll add multi-user support, I don't know. Anyway, here's the schema for the users table:

CREATE TABLE `users` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 255 ) NOT NULL ,
`password` VARCHAR( 255 ) NOT NULL DEFAULT ''
);

And remember to add a user to the users table!

First, you need a login form. I'll let you handle this as, I assume, if you're writing a blog you probably know something or other about HTML. It should POST to admin.php and contain Username (NAME="username") and Password (NAME="password") fields.

Finish the form? Good. Now, we need to write the back end. Create a file called admin.php and put this in it: http://other.fourisland.com/kirbyweek08/?source=admin.php.

Since I don't want to do all of the work, I'm going to let you design another form! YAY. Between the two comments ([/code]), create a form thatPOSTs toadmin.php?submit=. Create a textbox in itNAMEdtitle, a textareaNAMEdtextand another textboxNAMEdtags`. Obviously, also put in a submit button.

You may want to label the elements so you know what to do while posting. The first is the Title of the post, the second is the content, and the third is the comma-delimited list of tags for the post.

YAYish, I guess. We're done with the Admin panel.... Sort of. The admin panel is currently annoying, you have to type in all of your formatting and such using HTML. We'll fix that with a handy JavaScript editor called TinyMCE.

Download TinyMCE from the aforementioned link, extract it and plop the jscripts/tiny_mce folder into your kirbyweek08 folder. Now, let's add TinyMCE to our admin panel. Append this code above your FORM.

Hurray! If everything went right, your admin panel should now be better looking and easier to use! Remember that this is just a basic model and you should really style it and add more functionality on your own.

Next time, we'll be adding commenting system to your blog so people have the chance to talk about the wonderful things you're blogging about.), create a form thatPOSTs toadmin.php?submit=. Create a textbox in itNAMEdtitle, a textareaNAMEdtextand another textboxNAMEdtags`. Obviously, also put in a submit button.

You may want to label the elements so you know what to do while posting. The first is the Title of the post, the second is the content, and the third is the comma-delimited list of tags for the post.

YAYish, I guess. We're done with the Admin panel.... Sort of. The admin panel is currently annoying, you have to type in all of your formatting and such using HTML. We'll fix that with a handy JavaScript editor called TinyMCE.

Download TinyMCE from the aforementioned link, extract it and plop the jscripts/tiny_mce folder into your kirbyweek08 folder. Now, let's add TinyMCE to our admin panel. Append this code above your FORM.

Hurray! If everything went right, your admin panel should now be better looking and easier to use! Remember that this is just a basic model and you should really style it and add more functionality on your own.

Next time, we'll be adding commenting system to your blog so people have the chance to talk about the wonderful things you're blogging about.

Hatkirby on December 15th, 2008 at 12:31:54pm
πŸ‘ 3 πŸ‘Ž

On the first day of Kirby Week, Four Island gave to me: A tutorial on coding a blogging engine.

Welcome to Kirby Week 2008. As I told you yesterday, I'm going to spend this week teaching you how to write your own blogging engine. As we go along, we'll be adding many enhancements and such, but for now, we'll be starting with the basics. The blog you will be building will be loosely based on the SimpleBlog engine.

To do this tutorial, you, of course, need:

  • A Web Server
  • PHP
  • MySQL

We'll start with creating the base directory structure. In your webroot, create a folder called kirbyweek08. Create a css folder inside that folder.

Next, we need to set up the database. Create a new database called "kirbyweek08" and use this schema to create the tables:

CREATE TABLE `posts` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL,
  `text` text NOT NULL,
  `slug` varchar(255) NOT NULL,
  `pubDate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `tags` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
);

We need to let your site connect to the database. So, create a db.php in the kirbyweek08 folder, and put this in it:

<?php

$dbwebhost = 'localhost';
$dbwebuser = 'root';
$dbwebpasswd = '';
$dbwebname = 'kirbyweek08';

mysql_connect($dbwebhost, $dbwebuser, $dbwebpasswd);
mysql_select_db($dbwebname);

?>

$dbwebhost and $dbwebname are probably correct for you, but swap in the correct values for $dbwebuser and $dbwebpasswd (a.k.a. username and password of someone with permission to access and modify the kirbyweek08 database). Now that that's done, we can start making the blog.

Create an index.php file in your kirbyweek08 folder, and put this in it:

<?php

require_once('db.php');
require_once('functions.php');
include('header.php');

$getposts = "SELECT * FROM posts LIMIT 0,4";
$getposts2 = mysql_query($getposts);
$i=0;
while ($getposts3[$i] = mysql_fetch_array($getposts2))
{
    displayPost($getposts3[$i],true);

    $i++;
}

include('footer.php');

?>

A little explanation is required here. First, this file connects to the database by loading the db.php file we created before. Second, it loads a file called functions.php that we haven't created yet, and a file called header.php that we also haven't created yet. These files will contain useful functions reused often in your code, and a header to display above every file, respectively.

Next, the file downloads the latest four posts from your database and uses a function called displayPost() to display it. Finally, it loads a non-existent file called footer.php which will contain a footer.

The most important part is the displayPost() function. It will lie in the functions.php file. Instead of posting the code, I'm just going to link to it because it's rather long and it goes off of the side of the post.

Wow! That was a lot. Don't worry, that's the longest code snippet in this application. Whew. I think it's time for testing. However, if we test it now, there'll be nothing to see. First, add a record to the posts database.

The fields are simple. Ignore id and pubDate, they're automatically generated by MySQL. title and text should be self-explanatory. tags is a comma-deliminated list of tags for the post. Now we can test it.

You should see your post, surrounded by tons of errors. Oops. We forgot to make the header and footer! Also, you'll notice that it's saying your post is by "Anonymous". Want to fix that? Notice at the top of functions.php, a variable named $author. Set that to your username and you're set.

Let's create that header. Basically, you can put whatever you like in it. Just remember that it is pasted above the contents of every file, so make sure that a <BODY> tag has been opened by the time the file ends. Use this as an opportunity to theme this new blog with the rest of your site! Follow suit with footer.php as well, it's just a footer.

Nearly done! Now, all we have to do is create the other two files linked to by the displayPost() function. Here's read.php:

<?php

require_once('db.php');
require_once('functions.php');
include('header.php');

$getpost = "SELECT * FROM posts WHERE id = " . $_GET['id'];
$getpost2 = mysql_query($getpost);
$getpost3 = mysql_fetch_array($getpost2);

displayPost($getpost3, false);

include('footer.php');

?>

And tag.php:

<?php

require_once('db.php');
require_once('functions.php');
include('header.php');

$getposts = "SELECT * FROM posts WHERE tags LIKE \"%" . $_GET['tag'] . "%\" LIMIT 0,4";
$getposts2 = mysql_query($getposts);
$i=0;
while ($getposts3[$i] = mysql_fetch_array($getposts2))
{
    displayPost($getposts3[$i],true);

    $i++;
}

include('footer.php');

?>

We'll, we're pretty much done! I know, I know, it's mediocre. Don't worry, during this week we'll really spruce it up. Thank you for surviving that long tutorial, the rest is more fun.

You'll have noticed that there's no way you can post to this blog short of manually editing the database. Tomorrow we'll be looking at creating an admin panel for you to use for your bloggy funness. Enjoy!

Hatkirby on December 14th, 2008 at 12:32:13pm
πŸ‘ 7 πŸ‘Ž

....cries.... This shouldn't have been a solitary occasion.... cries

However, we are all still happy on this day, even though we aren't together. Happy Anniversary, Four Island.

I love this site.

EDIT: Four Island actually was registered on September 22nd, even though the first post, We're up! says "December 31st 2006", that is due to the fact that I did not add dates to my blogging software until October 15th. All of the posts before and including Mailchat say "December 31st 2006" though they were all really various times in late September and early October 2007.

Also, I'd like to say how proud I am of Four Island. It's grown a lot since I created it, and I'm happy to say that there are people who regularly go on it.

EDIT: And I'm so happy for all you Four Island-addicts. I really miss you.

Hatkirby on September 22nd, 2008 at 6:19:07am
πŸ‘ 3 πŸ‘Ž