December 13th, 2009
This came up while working on some code. I want to keep an internal counter within a function, and every time the function is called, return the incremented result. The function ended with return $i++; which, after I typed it, realized may not work as expected.
I wrote this quick test code to figure out what might happen.
<?php
function increment()
{
static $count = 0;
// do stuff
return $count++;
}
for($i=0; $i<4; $i++)
{
echo 'i=' . $i . ' return=' . increment() . "n";
}
?>
I figured one of three things might happen:
Option 1: $count is never incremented because return returns the pre-incremented value and prevents it from incrementing.
i=0 return=0
i=1 return=0
i=2 return=0
i=3 return=0
Option 2: $count is incremented and the incremented value is passed to return.
i=0 return=1
i=1 return=2
i=2 return=3
i=3 return=4
Option 3: The current value of $count is evaluated and passed to the return, $count is incremented, then the function returns.
i=0 return=0
i=1 return=1
i=2 return=2
i=3 return=3
Well it turns out that the function does what I wanted it to do, option 3. Can you explain why the value of $count can be incremented after the function returns?
Tags: php
Posted by aaronpk in Coding | 2 Comments »
November 12th, 2009
While signing up for a new Google Analytics profile, we noticed a change in their new platform. The confirmation screen that gives you the tracking code is now drawn in via AJAX. Being the curious types that we are, we opened up Firebug to take a look at why this might be happening.
The first thing we noticed was that the response from Google looks like a block of PHP code wrapped in what appears to be a Java serialized string.

Cleaning up the response, it looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| <?php
// Copyright 2009 Google Inc. All Rights Reserved.
$GA_ACCOUNT = "MO-11576892-1";
$GA_PIXEL = "ga.php";
function googleAnalyticsGetImageUrl() {
global $GA_ACCOUNT, $GA_PIXEL;
$url = "";
$url .= $GA_PIXEL . "?";
$url .= "utmac=" . $GA_ACCOUNT;
$url .= "&utmn=" . rand(0, 0x7fffffff);
$referer = $_SERVER["HTTP_REFERER"];
$query = $_SERVER["QUERY_STRING"];
$path = $_SERVER["REQUEST_URI"];
if (empty($referer)) {
$referer = "-";
}
$url .= "&utmr=" . urlencode($referer);
if (!empty($path)) {
$url .= "&utmp=" . urlencode($path);
}
$url .= "&guid=ON";
return $url;
}
?>
<?php
$googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
?>
<img src="<?= $googleAnalyticsImageUrl ?>" /> |
It’s definitely PHP, so why does the server return PHP code to a client-side script? It returned a function that builds up an image URL containing our account ID and some other information.
The Tracking Code Troubleshooting page has documentation on what all the query string parameters mean. The image URL that is built up contains only basic information of what would otherwise look like a normal tracking code request. Only the account ID, path, referrer, and a random number are passed. There’s also guid=ON, which is not in the documentation.
The other strange part is that normally the account ID begins with UA-, but in this case begins with MO-. Maybe it’s some sort of initialization request?
Tags: code, Google
Posted by aaronpk in Coding | No Comments »
November 6th, 2009
Our Walkscore widget just got a bit smarter! As mentioned on the company blog, Walkscore just incorporated public transit information to their data! Because we tie in directly to their API, our widget automatically got the new feature.
All of our single property sites come with the Walkscore widget included on the Community page. This means that you can instantly provide public transit data to your clients - with no extra work!
I’d say it’s the easiest upgrade we’ve ever implemented :) Thanks, Walkscore! We can’t wait to see what you guys come up with next!

Posted by torgie in Uncategorized | No Comments »
October 12th, 2009
Well, we certainly have been busy these last few months! Real Design Online has relocated our offices to the bright, sunny Portland, Oregon! Well, maybe it’s bright and sunny a few days of the year.
This is an exciting change of scenery for us, and our new offices are just swell! Bringing everyone closer together means we can get features added faster, get shinier templates, and better support all-around.
If you are in the real estate business and want to grab lunch sometime, give us a ring

Posted by torgie in Uncategorized | No Comments »
July 4th, 2009
With six bold color themes to choose from, and the ability to upload a custom header graphic, this template is our most versatile yet!

Start with Orange, Strawberry, Lime, Forest, Blueberry or Eggplant, then customize the header with your logo or a photo of the property. With six colors to choose from, you’re sure to find one to complement your custom header.
Tags: Design, Templates
Posted by aaronpk in Release Notes, Templates | No Comments »
June 24th, 2009
Today we launched a new feature (requested by one of our clients) which allows you to upload custom graphics into the header of certain templates!
The “Flow” template by default looks like this:

With the custom header, the template can match the property:
The ability to upload graphics like this opens up endless possibilities for you to customize our templates to exactly your liking.
We hope you enjoy this new feature, and encourage you to suggest new ideas you might have!
Posted by aaronpk in Release Notes | 1 Comment »
June 19th, 2009
We are proud to announce a new feature - visitor statistics for your property sites! This page provides, at a quick glance, lots of useful information about how many times your sites are being viewed. If you really want to impress your seller, print this page and show them just how much exposure their property is getting!
The top of the page has an overall traffic graph showing number of page views per day, overlayed with number of craigslist views. You can also see a breakdown of the most popular days of the week and hours of the day.

At the bottom is a list of referring websites people were on when they clicked a link to your site, and shows you which ones are bringing in the most hits. Your craigslist postings will appear here, as well as any other websites that link to your posting. Additionally, search terms people enter into search engines will be highlighted in bold so you can see what key words people are using to find your site.
We hope you enjoy this new feature as much as we enjoyed creating it!
Posted by aaronpk in Release Notes | No Comments »
June 19th, 2009
That pricing page… I don’t think any other page in our application, front-end or back-end, has received the same level of attention. It’s extremely important that we communicate our pricing perfectly to our potential (and existing!) customers.
Previously, we charged a tiny fee up-front for publishing sites, and then on top of it a monthly fee which represented our hosting, and other bundled services.
Now, we’ve done away with this multi-level billing system, and simply combined both of those charges into a single (and slightly cheaper!) monthly payment. The new pricing page should explain how everything works… and there’s even a built-in freebie site now!
We also have a lovely new template making an appearance in the gallery page - everyone say hello to Noteworthy, please!
Noteworthy only has one variant right now, called “parchment”… but this is a calm, classic template for anybody selling a home with a musical history. More variants are in the works.
Oh, and speaking of things which are in the works, we’ll have a huge new feature coming through concerning templates - It was recommended to us by a client of ours, and we listened! You can get the full details here soon when the patch is made.
That about wraps it up for this Friday. If you have any comments or questions about the new pricing, just leave a note here and we’ll make sure to help you out as best we can!
Posted by torgie in Business, Templates | No Comments »
June 10th, 2009
We’ve been hard at work to bring you some new designs to use for your sites! Today we’re releasing “Flow” and “Carbon,” two new graphical templates that we’ve enjoyed creating.
“Flow” offers a smooth design with bold colors, and comes in two variants: “citrus” and “breeze.” The template offers an organic feel while still being sleek and modern.
“Carbon” comes in three variants, “warm,” “fresh” and “cool.” The main graphic in the template is a photo of translucent leaves. The leaves break out of their containing box and become slightly blurred at the parts that stick out. This template would be suited well to a house surrounded by nature.
Remember, you can always test out a new template by changing your site’s template. Your published site won’t be affected until you click “Publish.”
Tags: Design, Templates
Posted by aaronpk in Release Notes, Templates | No Comments »
June 8th, 2009
Hello and good Monday!
Were here at RDO have been very busy. First up is a re-design of our Pricing Page - it should now be perfectly clear exactly how much the different account types cost. The page can be found right over here. If you have any thoughts or suggestions about how to make that information even clearer, we’d love to hear them!
Oh, and you may have noticed that flipping through the different account types yields some fairly attractive scrolling action. If you’re going to be a long-time reader of this blog, then you’ll probably just have to get used to me saying the following: jQuery rocks my world! If you do any serious web development, you absolutely must give jQuery a shot.
Next I’d like to extend a big thank-you to Marcia Edwards! She was kind enough to meet with us on Friday morning and discuss marketing, strategy, and positioning. We will be making a large effort to reach a wider audience very soon - helping agents across the country sell homes faster.
Hey maybe our slogan should be “Real Design Online - saving the country’s economy one Property Site at a time!”
Tags: jQuery
Posted by torgie in Business | No Comments »