Posts Tagged ‘PHP’

How developers order lunch

Thursday, May 26th, 2011

Today the Dev team at Zoom Creates is having a meeting were we are getting Chinese food brought in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
function lunchOrder($rice = "Fried Rice", $entre = "General Tso") {
    return $entre." with ".$rice;
}
 
$developers = array("Justin" ,"Kris", "Kurtis", "Nick");
 
$order = array();
 
for ($i = 0; $i < count($developers); $i++) {
    $order[$i] = $developers[$i]." would like to order ";
 
    if ($developers[$i] == "Kurtis" or $developers[$i] == "Justin") {
        $order[$i] .= lunchOrder("Steamed Rice");
    } else {
        $order[$i] .= lunchOrder();
    }
}
 
foreach ($order as $whatEachDeveloperWantsToEat) {
    print $whatEachDeveloperWantsToEat."<br />\n";
}
 
?>


Custom Icons with the Google Maps API V3

Tuesday, November 16th, 2010

Putting a map on your website is pretty easy. The easiest way is to go to Google Maps and find the location you want, click embed, then copy and paste the code onto your site. This creates an iFrame on your site, which isn’t bad, but isn’t the most flexible either.

If you are feeling brave, you can put a map on your website with the API that Google provides. It’s all javascript code that works on every modern browser. The API is extremely well documented, so I won’t get down to the complete process of setting up a map, because this blog post is about using custom icons for your markers.

Click through to read how.
(more…)


MODx Update: Fantastic new administration panel

Wednesday, October 27th, 2010

We here at the Zoom Creates Nerd Herd (the development team) have always loved the modX CMS tool. It’s extremely flexible, has a great system for templates and code chunks, and is limited only by your imagination. We’ve been using it for sites since before the code base was at a stable 1.0 release, probably since around late 0.8 beta releases. There are many great plugins that help with breadcrumbs, dynamic navigation and menus, AJAX requests, search engine friendly URLs and more. Today I’d like to point out some of the features and changes of their latest release, Revolution 2.0.4.
(more…)


Ruby on Rails

Monday, October 4th, 2010

For anyone that has been following my blog posts, this week I was supposed to post my findings switching from the Rokon Android library to the AndEngine library. Things are progressing, but not as quickly as I would have liked, so I’m instead focusing this post on a small intro to Ruby on Rails.

We have been looking closely at different modular platforms that are easily expandable. Two that initially came to mind are Ruby on Rails and Django (because I love python). Last week I installed Ruby on my local Ubuntu machine and set up rails 3.0.0. Then I set up Passenger with my local host Apache and a virtual host set up on port 8080 to my new rails environment.

The first thing that I noticed when diving into Rails is that everything seems a bit more structured. The Ruby on Rails community has things set up in a very particular way, making some important decisions for you. I’ve run through a few different small demo projects and I have to admit that Rails does some pretty awesome stuff. For example, when naming your database names/tables, main classes and methods, Rails will take care of database inserts for you. I’ve gotten pretty quick at writing php functions that do the database functions, so it’s not that big of a deal, but it’s still nice to have all of that covered by default.

If you are looking into Ruby on Rails and come from a php environment, I highly recommend the book that I have been going through, Rails for PHP Developers. They introduce you to the whole MVC setup that many different software development platforms use, and can be confusing to PHP developers that don’t separate their style and functionality code. Once you have that book, the site www.railsforphp.com/ will become a pretty great reference tool.


Do spam bots use mice?

Tuesday, June 22nd, 2010

The typical solution to avoiding spam bots from abusing your online forms is to use a CAPTCHA test. You know – the hard to read, wavy text that you must type in correctly to prove to the web page that you are human and capable of making sense out of the non-sense. Well, spammers have used OCR (optical character recognition) algorithms to have their bots read the messy text and complete the test. Since then, there have been lots of alternatives to the text CAPTCHA test. Some involve selecting an image from a list given its name or description, or answering simple math problems. However, I didn’t find one that I really liked. So we started to build our own on the assumption that spam bots don’t use mice.
(more…)


Database access with a Chumby

Thursday, May 6th, 2010

Chumby, Database AccessIn my earlier posts, I’ve writen about writing a Chumby widget, writing a configuration widget, and accessing the accelerometer. Now we’ll look at accessing a database from a Chumby widget.

First, you’ll need to set up a database. I’ll assume you have access to a web server and know how to create a database, tables, and code to access it. I use MySQL and PHP.

You’ll also need a Chumby widget.

And to connect the two, you’ll need a crossdomain.xml file.
(more…)


Basic MODx Template Tutorial

Wednesday, April 7th, 2010

We here at Zoom Creates love giving people the option to maintain their own websites once we are done building them. One of our favorite CMS platforms is MODx. It’s based on PHP, is open source, and is extremely flexible. Today I’m going to talk to you about the basics of building a HTML based template.

(more…)


Building your first Twitter application with PHP

Monday, February 22nd, 2010

I’ve written before about how great it is to work with a service that has a great API. Twitter was one of the tools that I talked about in that post and today I’m going to show you the basics of working with their API.

PHP is a great language for web applications, and it’s available with just about any web host. If you aren’t familiar with how PHP works, this tutorial will probably be a poor place to start. Today we are going to talk about how to work with the Twitter API and PHP, and you’ll need to know a few things about how PHP works to keep up. For a good refresher course on PHP, click here.

Click through and let’s get started!
(more…)


Flash Camera

Monday, December 14th, 2009

On a recent project (which will be revealed later this week) we needed to save an image created in a Flash application, using AS3 and PHP. It turned out to be really easy. Here’s how we did it…

(more…)


Back to the Basics

Wednesday, December 9th, 2009

iStock_000005624791XSmallWe have an intern coming in next week to hang out with us nerds. He’s a highschool student that would like to see what the day to day tasks of a web programmer are. I’ve talked to him about what he will be doing and what to brush up on. Here are a list of sites that I recommended him click through to brush up on some of the basics of the tools that we use. These are in no particular order.

  • HTML Goodies – This site was one of the first that I used to help me understand HTML and JavaScript. A little outdated, but still great for fundamental learning.
  • Tizag PHP Tutorial – Basics of PHP. This website does an amazing job of putting complex concepts into words that everyone can understand.
  • MySQL Introduction – From the MySQL website, an introduction.
  • W3Schools – Straight from the people who make the standards we love and use, you can learn a bunch on their site about the RIGHT way to do things. Topics in PHP, MySQL, JavaScript, jQuery, CSS and XHTML are where you can learn the tools we use.
  • PHP Screncasts – Some good free video screencasts that show you some of the basic aspects of PHP. Buy it for the advanced videos.

There are more places online that can teach you our toolset. Google is great if you know what you are searching for. The internet is a great thing, and can teach you just about anything you want, especially if it relates to computers and programming.