Archive for Code

Pulling in RSS to your Website

Chris Coyier of css-tricks.com posted a nice screencast of how to use SimplePie. SimplePie allows you to pull in pretty much any RSS feed from another website and post that info on your site in regular HTML.

I’ve been playing around with the options and abilities this last weekend and I feel it’s the easiest way to get some RSS content onto a website. I know SimpleXML is supposed to be really simple, and perhaps my limited understanding of PHP classes has held me back, but I’ve never gotten SimpleXML to work for me in under 5 minutes. SimplePie literally works about as fast as you can type 20 short lines of code. It’s practically fool proof.

I certainly recommend checking SimplePie out.

Comments

Blog Tutorial with PHP and MySQL – Installation

Installing a server on your local machine

First, I’d like to apologize to the Linux and Mac users, this post will be scewed towards Windows users. I will try to offer the alternatives, but I haven’t actually implemented them myself.

So with that out of the way, what you need to download is WAMP (Windows Apache MySQL PHP). This is truly the simplest way to get a server on your windows machine up and running. You don’t even have to mess around configuring the php.ini file or anything like that. Just double click this installer and you’re ready to go.

Afterwards you’ll see a small icon on your taskbar. You’re basically up and running. If you click on it, you’ll get a small menu. Clicking “www Directory” will take you to the directory you should be putting your new site files. To create a new project, and have an area to store everything, just create a new folder in this “www” directory. Name it “blog”, and that’s where your index.php and other files will reside.

If you click on the wamp server in the taskbar and then choose “Localhost”, it will open your default browser and send you to a page summarizing and providing links that you’ll be using frequently. You’ll also see “blog” under the “your projects” section.

By the way, if you’re looking for a really good text editor that works with a multitude of files, search for Notepad++. It’s my personal favorite.

Comments (1)

Creating Your Own Blog with PHP and MySQL Tutorial

Ever wanted to create a simple blog without needing to do the whole Wordpress deal? Maybe you just want to create something on your local machine for your own personal use. Heck, coding your own blog is also a good way to show a potential employer that you have at least some coding chops.

Well, I’m going to attempt to help the absolute beginner create just that. I myself am no PHP expert, but I’ve managed to learn enough that I think I could help other beginners. I’m sure some of the ways that I’m coding things are not necessarily the best possible method, but I’m open to comments and suggestions. I’m learning too, after all.

So what type of sections will these posts cover? Well as of right now this is my plan (I’m sure it’ll change soon):

  • Installing a server on your local machine
  • Creating your database and tables
  • Connecting your PHP pages to the database
  • Setting Privileges
  • Creating the various pages (front page with loop, individual posts etc.)
  • Creating the forms for content entry
  • Post tagging
  • Integrating Tiny MCE for content entry
  • Allowing simple user comments
  • Creating a tag cloud
  • Working with excerpts (both automatic and custom)
  • Uploading images to your server

Some things I’d like to include but will won’t necessarily includes user logins, admin logins, and security.

I’m going to assume then that you know basic (X)HTML at the very least. Minimal CSS knowledge will also help in a few spots.

I’m hoping this will help other beginners get over some of the bumps and hitches that I’ve experienced more quickly than when I was facing with them.

I have no exact timeline for when these posts will come out, but my plan will be to post at least once a week.

Comments

Firefox 3 Beta 1 Passes the Acid 2 Test!

I was only moderately excited for the new Firefox beta since my current version of Firefox 2 is fairly customized and runs great.

However, as I was reading about the updates to Firefox 3, CSS rendering was supposed to be improved. I decided it was time to have another look at the Acid 2 test. It’s a test to see if the CSS rendering of the browser is standards complaint. Firefox 2 was pretty good, but not perfect. Well, Firefox 3 fixes all of that. Here’s the screenshot I took to prove it.

Firefox 3 Beta 1 rendering of the Acid 2 Test

Congratulations to Mozilla for fixing the last remaining significant argument against Firefox! As a designer, I’m very happy.

Comments (3)

Another Super-Sweet CSS Trick

I’ve never even heard of this ability/technique in CSS. So super handy.

You can use adjacent sibling selectors. An adjacent sibling selector is made up of two simple selectors separated by a plus sign, “+”. Whitespace is allowed around the adjacent sibling combinator. The selector matches an element which is the next sibling to the first element. The elements must have the same parent and the first element must immediately precede the second element.

70 Expert Ideas For Better CSS Coding | Smashing Magazine

Comments

Phenomenal CSS Tip

Being the CSS junkie that I am, I’m always on the lookout for great CSS tips. Well I’ve found an excellent one. Instead of creating a fancy javascript to generate a common navigation bar that shows the user their current location in the site, how about a simple id and class selector. Genius!

You can use the same navigation (X)HTML-code on every page. “Most websites highlight the navigation item of the user’s location in the website. But it can be a pain as you’ll need to tweak the HTML code behind the navigation for each and every page. So can we have the best of both worlds?” [Ten More CSS Tricks you may not know]

70 Expert Ideas For Better CSS Coding | Smashing Magazine

Comments