Categories
Development

Vote My Vote

Vote My VoteI’ve been busy doing some work for a really cool site, Vote My Vote. It’s a really cool community voting site for TV’s most popular shows. You sign up and they go through the hassle of calling in your vote for you. While I rarely watch any of those type of shows, I do have to admit I think it’s a very slick idea.

I primarily assisted with some Joomla development and configuration. Someone had been doing that role before me, so coming into a project that someone had already begun had it’s challenging moments (a white error screen of death for instance). But solving their issues and helping deliver a really cool finished (or very close to being finished) product was very gratifying.

I haven’t met a single member of the team who worked on this site in person, nor even spoke on the phone. It’s really amazing how people from all over can successfully collaborate on a project. I was fortunate to work with an extremely talented bunch of individuals on this project.

The primary tasks I assisted with were:

  • setup and the automatic population of the blog. We used the CorePHP WordPress MU component to help us with this.
  • Community Builder user registration. Ummm, there were moments I despised you Community Builder, but in the end we figured you out and you are doing your job.
  • Pulling in the latest forum posts to their respective areas.
  • Good deal of assist with other Joomla odds and ends. My hands got dirty with much PHP on this project. It was lots of fun.

Check out votemyvote.com, and let anyone you know who’s addicted to those reality shows about it.

Categories
Development

WideImage

Needed to do some server side image manipulation with PHP for a custom Joomla component I was working on. Unfortunately, I was having some initial problems.

Luckily I found WideImage, and open source PHP library for image manipulation. It was great and made the whole process so much more simple for me to implement in my component.

Using it is a cinch, just check out the examples and documentation on their site. Again, this was an excellent library for me, and I highly recommend it.

Categories
Development

PHP multi word search

I was building a search for a site I was working on and needed the search to work on the words a user might type in separately not as one string. For instance, if they typed: “wiffle ball in Louisville”, it would search: wiffle, ball, and Louisville.

Building my SELECT statement was a little tricky at first.

First I had to take my string that’s being passed and store each word in an array. The below is a very simple example, I highly recommend that you clean up the string first!

$searchString = $_POST['who-search'];
$searchArray = explode(" ", $searchString);

This takes our string and uses the explode function to break up our string into an array whenever whitespace is found. Again, this should be refined a bit more in a production level product.

Now that we have an array of the words that were entered, a way to work this array into the SQL statement had to be figured out. Using a couple of loops to go through the array and create OR’s did the job.

$sql = "SELECT DISTINCT * FROM table WHERE ("; 
 
while (list($key,$val) = each($searchArray)) {
	$val = addslashes($val);
	if ($val<>" " and strlen($val) > 0) {
		$sql .= "column1 LIKE '%$val%' OR column2 LIKE '%$val%'  OR column3 LIKE '%$val%') OR";
	}
}
$sql = substr($sql,0,(strLen($sql)-3));//this will eat the last OR
$sql .= ") ORDER BY column1 DESC";

The while loop goes through our array the addslashes function is called to the current value. This escapes apostrophes from throwing off the SQL statement.

If the current value isn’t empty then it’s inserted in the SQL and it’s value compared to the columns you want to compare it against in your SQL. In my example above I’ve used LIKE against 3 columns.

Finally you have to remove the final OR from the SQL statement. A simple substr function is used to remove it from the end.

Categories
Movies

LOST Promo Contest

At work every morning after a new episode of LOST airs we all gather near my desk and discuss what we thought of the previous nights episode of LOST. It’s actually pretty fun, and quite funny just how involved we have all gotten with the show.

Recently we heard of a fan promo contest to create a 35 second commercial for the upcoming finale. So a group of us decided why not?

We reviewed the official rules, and viewed what had already been submitted. I then printed out some storyboards for us to fill out with our ideas. We all had some great ideas, but they all seemed to have one connection, and that was how this show has brought so many different people like our office together.

Working on this was a lot of fun. I got to work with people I never work directly with, but happen to work a few feet from. We spent just a little bit of time on it, but think it turned out pretty nice.

Categories
Adventure

Eating with half a numb face

I had an dental appointment to replace a filling for a crack I had in a molar that was done when I was in high school. Going to the dentist was never too bad for me, and I was pretty much in and out in under 45 minutes (way to go Dr. Josh).

However, what I wasn’t expecting was for half of my face to be numb for 4 hours. I half to admit, it’s a very strange feeling. Eating pizza a little bit afterwards turned into quite the epic adventure.

I’ve been known to be a little too rough at times, so I was extremely cautious to make sure I wasn’t accidentally biting into the right side of my cheek while eating. Small bites that were only being chewed on the left side of my mouth was the recipe for success.

2 slices felt like 4, with only half of my jaw doing any substantial work. All in all the whole numbing thing has turned out to be a pretty interesting experience.

Categories
Adventure Sports

Failed Curling Attempt

After watching the 2006 Winter Olympics the Shepherd and I declared that we wanted to play curling after watching much of it on TV that year. Well apparently we had forgotten our mission until 4 years later when the 2010 Winter Olympics came around.

After some brief research we found that the Philadelphia Curling Club was offering a $5 donation class today. So this had to be attended by us.

The Shepherd actually called me at 9:55 AM this morning ready to go. This may not seem early to most, but by his current standards this was an amazing feat and probably summed up just how excited both of us were to finally experience this grand sport.

The ride over took about an hour and a half. We didn’t take a signal wrong turn, which even with GPS we were both proud of.

Upon arriving, we soon discovered that we weren’t the only ones interested in trying out curling. I’d say there was probably 1500-2000 people waiting in a wrapping line outside in the cold with hopes of getting inside to curl.

We waited a good while, with the line barely moving at all. We later found out that there was no chance that we would have an opportunity to curl on this day. Truly tragic news indeed. With our dreams shattered we then decided to get a bite to eat and do something else nearby.

Apparently there isn’t much else to do nearby the curling place. We also somehow took about 4 hours to get back home due to a GPS device that decided to toy with us the remainder of he afternoon. While it was clearly a failed mission, I’m glad we at least followed through with our original plan 4 years ago and gave it a shot. Who knew curling would be this popular.