Blog posts tagged "special"

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
πŸ‘ -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
πŸ‘ 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
πŸ‘ 7 πŸ‘Ž

I'm glad to see many "I LOVE ITs" for TGS, because it's such a great project. For you who don't know what it is, see this: The Greatest Story.

I LOVE IT. - 9 vote(s)! It's an interesting idea. - 0 vote(s)! What the negative is it? - 2 vote(s)! **** - 0 vote(s)!

I'm sure you all know, Kirby Week 2008 starts today! For those who don't know, Kirby Week is the third week of advent, when the candle is pink. Yes, I know, that wasn't funny. :)

I started the strange idea of Kirby Week in December 2006, a year before Four Island even existed. Since then, each Kirby Week has been a week of fun, joy and excitement at the holiday to come. Starting this year, I'd also like to do something for Four Island during Kirby Week.

I've decided that during Kirby Week, I shall post a weekly special (like VisitorGrid Week) on a set topic. Sound like fun? I hope it does!

This year's topic is how to code your own blog. TimTam has been nagging me to do this anyway, so I might as well use it for Kirby Week!

And also, I've decided to do use last year's Kirby Week poll for this year as well. So, all in all, I hope you all enjoy Kirby Week 2008!

Hatkirby on
πŸ‘ 0 πŸ‘Ž

This post is the sixth and final day of VisitorGrid Week. For more information, read the post linked to right there.

This week seems to have gone pretty well. I'm going to end it off with a yummy tutorial. This time it's about MPD, the Music Player Daemon. MPD is a program you can use to play music from your computer without any interface, which is why it is usable even on the command line. MPD usually interacts with a client, which range from MPC, a command line client to GMPC, a GNOME-based graphical client. There are quite a few clients, however, that allow you to interact with MPD wirelessly, via some type of remote control.

I browsed through these and found none that I could to immediately without running out to the store and buying some type of accessory. But, then I found mousempc, a bare-bones client controlled by a mouse. That's right, that includes wireless mice. And, I just happen to have a wireless mouse lying about.

First, I'll tell you how to install MPD, then I'll tell you how to setup mousempc. MPD is easily installed, due to the amount of distributations it's been ported and packaged to, but mousempc is quite a challenge.

Ok, installing MPD. MPD can be found in most Linux distribution's packaging system under the name "mpd". So, for instance, on Debian/Ubuntu, you'd run this command to install MPD:

sudo apt-get install mpd

That wasn't too difficult, was it? The only other thing you really have to do is to import your music into MPD's library.

On Debian, this library resides at /var/lib/mpd/music/ by default. You can find the location of your library in your /etc/mpd.conf MPD configuration file under the name "music_directory". Copy your songs into that folder. Note that you may need root privileges to access that folder, so add sudo to the front of each cp command you run.

After copying in your files, you need to have MPD re-create it's database. You can do this by running the commands:

sudo mpd --create-db
sudo /etc/init.d/mpd restart

The first command re-creates the database and the second restarts MPD. Note that the second command may be different depending on your distribution.

Well, there you have it. Your music files are safe and snug in MPD's database. Now you need to install mousempc. This, as I said before, is the difficult part.

  1. Begin by downloading the Makefile and mousempc.c from its Subversion repository.
  2. You need GCC (the GNU C Compiler) to compile mousempc, but it's normally pre-installed on most Linux systems. In case it isn't, however, try installing it with your packaging system using the package name "gcc"
  3. You also require Make to parse the Makefile. Same post-text as above applies.
  4. Finally, you require a small package called runit.
  5. Run the following commands:
make
mkdir ~/mousempc
cp mousempc ~/mousempc/
cd ~/mousempc
mkdir env log
cat > run << EOF
<\$EVENTFILE exec chpst -u mousempc -e ./env ./mousempc
EOF
chmod a+x run
> env/MPD_HOST
> env/MPD_PORT
OLD_UMASK=$(umask)
umask 077
> env/MPD_PASSWORD
umask $OLD_UMASK
cat > repeat << EOF
./run
./repeat
EOF
chmod a+x repeat
  1. The last thing you need to do is find out which event device your mouse is. Enter this line into the top of the run file created in the previous step:
EVENTFILE=/dev/input/event2

Then, run run:

sudo ./run

Try right clicking with your wireless mouse. If nothing happens, try /dev/input/event3 in run. If that fails as well, /dev/input/event4 and so on. 7. When you find the correct device, all you need to do to start mousempc is run repeat:

sudo ./repeat

There are two problems you can have with this. One is that, after running repeat, you get some error about not having enough permissions to do whatever. This is resolved by looking in the /etc/mpd.conf file mentioned earlier, finding the value entitled "password", and placing that into the MPD_PASSWORD file inside of the env folder.

The other problem you can have is that after a while, mousempc stops working. This may be due to the fact that your wireless mouse reciever may have changed event devices. If this happens, simply retry going through /dev/input/event2 and so on.

Finally, that long tutorial is over! Well, I hope you've enjoyed this tutorial, and I hope you've enjoyed VisitorGrid week!

Hatkirby on
πŸ‘ 0 πŸ‘Ž

This post is the fifth day of VisitorGrid Week. For more information, read the post linked to right there.

Continuing along with the blogging theme, now that you know why you should blog and you have a blog, I'm going to make a little reward-type-thing.

You must write a post on you blog relating to the number four. Not just any post, not a spam post, a good post. No wait, a great post. If you do, post a link to it in this post's comments, I'll look over it, and if it's good, I'll pingback it.

So, there are the terms. You write a good post relating to the number four, I'll pingback your blog, providing you with more traffic. I'll generally post the Pingbacks on Saturday along with the weekly poll.

So, like the idea? Well, good. Now get blogging. This offer does not expire.

Hatkirby on
πŸ‘ -1 πŸ‘Ž

This post is the fourth day of VisitorGrid Week. For more information, read the post linked to right there.

Now that you know why you should blog, here's a handy tutorial on how to start a blog just in case you decide that blogging interests you.

The first thing you need are some ideas. Like, for instance, what are you going to name your blog? Or, what's it going to be about? Your life? Blogging?

Once you've handled that stage, you need a host. There are many free blogging hosts on the internet (myself included, I'm already hosting two), so this one isn't difficult. We'll assume that you're using Wordpress.com, a hosting service that runs off of the popular Wordpress blogging software. It's fairly easy to create an account on Wordpress.com. It has a large "Sign up" button on the home page, and the forms are easy to navigate.

Now that you have a blog, you should write an introduction post. Explain what your blog is there for, why people should read it. This, and some more self-promoting information should also be inserted into an "About" page.

Finally, you need to come up with a blogging schedule. How often are you going to blog? Are you going to do special things on certain days of the week? Think about this, because when people start to enjoy your blog, want to keep reading some good content, they'll be disappointed when you fail to post.

Hatkirby on
πŸ‘ 3 πŸ‘Ž

This post is the second day of VisitorGrid Week. For more information, read the post linked to right there.

Many people on the internet have blogs. Many people have more than one blog. But do you have one?

There are many good reasons for you to have a blog. That's why I've decided to make a list! YAY! This is probably going to be terrible (as it's my first blog post list), but anyways, here we go!

  1. Blogging is fun
  2. Blogging is a method of telling people of the outside world your feelings
  3. Blogging is a way to connect to people you don't know
  4. Blogging is a good way to vent your feelings
  5. Blogging is a good way to get feedback from your visitors
  6. Blogging is a good way to have daily content on your site
  7. Blogging makes it easier to have a reason to make a site
  8. A blog can be an online diary
  9. Blogging can be a way to speak your feelings to the world without revealing your true identity
  10. People on the internet who have blogs can sometimes look more professional
  11. Having a blog can be a good way to direct traffic to your site
  12. A blog doesn't always have to be an updates archive. You can use it as a type of game
  13. A blog can keep your visitors updated to the most recent events on your site
  14. Blogging can be a way to keep yourself from being bored
  15. Um.... insert more good reasons here

Ok, that was terrible. But I hope you enjoyed it!

By the way, if you have any ideas that you think would do well on this list, please comment!

NOTE: Verify blognomic.net, make sure it's not a different TLD

Hatkirby on
πŸ‘ 2 πŸ‘Ž

This post is the second day of VisitorGrid Week. For more information, read the post linked to right there.

Today I thought I'd vent some more of my anger towards Apple. It's time to be angry at the iPhone.

The iPhone.... GAH. It's so terrible, only an idiot would like it. So, naturally, I got an idiot to come in for an interview.

Hello Douglas, that is your name isn't it?

Hatkirby

Yes

Douglas

Ok. So, Douglas, why do you like the iPhone?

Hatkirby

Because it has a touch screen.

Douglas

But Douglas, the DS you are playing right now also has a touch screen.

Hatkirby

And I like it! So I like things with Touch Screens. It's also the only iPod with a Touch Screen so far.

Douglas

Um, Douglas. That's not exactly true. Ever heard of the iTouch?

Hatkirby

They're made at the same time. They're the same thing except the iPhone has a phone.

Douglas

Um.... ok. Any other reason you think the iPhone's good?

Hatkirby

It's awesome.

Douglas

That didn't exactly answer my question, Douglas.

Hatkirby

It's a phone. It's the first iPod thing that's a phone. It's very new.

Douglas

Um, that's quite apparent from looking at it. Well, iPod's are IPODs, not cellular phones. Why do you need an MP3 players with a phone in it?

Hatkirby

Because then you don't need to buy a phone and an iPod. Then you just have an iPhone.

Douglas

Well, that's a thingy. Anyway, thanks for coming today Douglas.

Hatkirby

Your welcome.

Douglas

Um.... that wasn't quite the answer I was expecting.

Hatkirby

You scare me.

Douglas

....Ok, this interview's over.

Hatkirby

Well, as you can see, the idiot has some good reasons for himself to want an iPhone. Which means, that if you have these reasons.... well.... um.... runs away

NOTE: If anyone was offended by this post, I am sorry. I am just expressing my immense dislike of Apple. No idiots were harmed in the making of this post.

Hatkirby on
πŸ‘ -3 πŸ‘Ž

This post is the first day of VisitorGrid Week. For more information, read the post linked to right there.

Thumbnail2A few weeks ago, I was cleaning my room up, preparing for the move back to America. I looked up on top of my bookshelf and found a big stack of papers I had completely forgotten about. They were old papers, stories and drawings I had created years and years ago. One that I found I particularly felt I had to share with you:

I drew that picture a verrrrry long time ago. Yes, quite a long time ago. That's right, it is a four. In fact, it's the original Fourie.

I had named it Fourie back when I had created it, but I had thought that I had lost it ages ago. But, now it's found again.

The interesting thing is to compare it with the modern Fourie. The original Fourie had a more angular body, while the modern Fourie has a curved one. (Actually, I have a strange way of writing the glyph 4 that other people seem to think is a U, a 9 or an h) Also, the original Fourie had dots for eyes while the modern one has vertical lines.

All in all, I'm happy to have found this old relic again, as well as the rest of the sentimental junk I found in that pile upon my bookshelf.

Hatkirby on
πŸ‘ 1 πŸ‘Ž