Create URL Shortener For Twitter Using PHP1 Comment »

 

Hello, today I am going to go through how to build a custom URL shortener. Why have your own? Because then you are advertising yourself not another service like tinyurl.

A URL shortener is a nice way to send incredibly long links. It also helps when writing Tweets on Twitter (something I do a lot).

I decided that this system will have the following:

  1. Option to need a login or not
  2. API Key login
  3. Generate a new API key
  4. Click count
  5. Add/remove links when logged in
  6. Most recent IP tracking (always useful)
  7. Not to include bots on your clicks
  8. A nice admin backend
  9. Maybe: A JS button to login, and past the current URL into the textbox
  10. Maybe: Not looked how it fully works yet but be able to get a short URL with the Tweetie app for iPhone from Atebits. (I have nothing to do with them, just like their products.

Read more »

 

Really Simple Model/View Seperation With PHP6 Comments »

 

I think I speak for a number of developers when I say that I strive to have my code readable and easy to maintain. This is way easier said than done as many of you know. The most familiar way of doing this is using the Model View Controller (MVC) concept.

While I see the point in the above, I do sometimes struggle with its practicality. For example, do I really need to use CakePHP, Symfony, CodeIgniter for a simple PHP based site? I agree that frameworks can be handy for larger sites, but the majority of my sites are on the smaller side.

This is the reason that I will teach you a simple way to separate your models/views with very little OO logic, and not using a framework.

Read more »

 

CDNs: Do They Affect Google Rankings?0 Comments »

 

CDNs just a little while ago seemed like such a complicated topic that only large fortune 500 companies could use. Today they are better understood and more affordable for small businesses.

I was lucky enough to be contacted by MaxCDN who was willing to sponsor my website. I was thrilled as they mentioned they sponsor many well known blogs such as Web Designer Depot, and Mashable. Anytime I get mentioned with those blogs it is a nice compliment.

I suggest heading over there and seeing what they can do for you!

Read more »

 

Fix table-cell and max-width bug in IE83 Comments »

 

I find I like documenting IE bug fixes that I come across in my daily work. It is just as much for myself to go back to as it is for you the reader.

Well the other day I came across a real puzzling bug. Lets describe the circumstance first:

The Cause

Lets say you have a table that lists of bunch of suppliers that a company has. It includes an image and the company name.

Something like the following:

<table id="suppliers">
    <tr>
    	<td><img src="images/suppliers/airflex.jpg" alt="" /></td>
        <td><img src="images/suppliers/wallace.jpg" alt="" /></td>
        <td><img src="images/suppliers/lunde.jpg" alt="" /></td>
        <td><img src="images/suppliers/hutchens.jpg" alt="" /></td>
    </tr>
    <tr>
    	<td>Airflex</td>
        <td>Wallace Forge Company</td>
        <td>Lunde Lift Systems</td>
        <td>Hutchens Industries</td>
    </tr>
</table>

Now let’s say that each image is a different size… and you want to control this. You use the following CSS rule:

table#suppliers img {
	max-height: 107px;
	max-width: 159px;
}

This now keeps the height and width reasonable. Now if you look in Firefox it looks great… IE8 has its table stretch out to the sides…. and IE7 looks perfect.

This had me stumped… why does IE8 show worse than IE7. It made no sense. Below is the solution I found.

The Solution

The simple solution is to specify a direct width for the table, as well as set the table-layout to fixed:

table#suppliers {
	table-layout: fixed;
	width: 726px;
}

Happy Bug Fixing!

Find Out More Over at Bytes.com

 

Firebug 1.5 Inspector Stuck (FireQuery Fix)1 Comment »

 

The other day I upgraded my Firebug to the newest version. Shortly after I was required to debug some CSS and was going to use my favorite too Firebug when it seemed to have a glitch.

I would attempt to inspect an element as I normally do. I would click on an anchor tag, but the HTML tab would not go to the appropriate place in the code.

I first dismissed the problem as a temporary bug, and restarted the browser to try again to only have the same problem.

Update Firebug Extensions

I then found the solution on the firebug blog. It turns out your extensions had to be updated.

I then went to my addons dialog in Firefox and clicked find updates, only to find out they were all updated (or so it seemed).

I then read the blog a little more and found out “FireQuery” doesn’t auto update properly, so you have to download the newest version manually.

Solution: Download Newest FireQuery

Download Version 0.5 Here and it should solve your problems!

Any other bugs with Firebug 1.5… let me know in the comments.

 

« Older Entries

 
connect with me!