Archive for the ‘Web Development’ Category

New Site – DynaPoll.net – Complete with WordPress Plugin!

I’ve just put live a new site called DynaPoll.net. It’s for what I believe is a unique approach to online polls. These polls are dynamic as the answers to the poll question evolve as people participate.. They evolve because the participants get to choose the poll answers!

Anyway.. so the site is up and running and a friend told me I should create a Wordpress Plugin for it.. Which I’m incredibly pleased to say I was able to do over the course of the last couple of nights! I think it works… And this post is the test subject for my plugin!

I’ve removed a heap of rubbish from this site recently too and so I had these three boxes on home page which didn’t have a purpose! Now they do – they contain a poll from DynaPoll! Below is a random poll generated by the Wordpress plugin. It shows a different poll randomly as the page is loaded.

Poll Question: What do you think of Our Biggest Loser - really interested in knowing what you don't like, what you do like and what you wish was there but isn't! I will take action on the top 2 results!

You can vote for current most popular:


You can vote for current alternative answers:


  • Don't agree with any of the answers above? Type your answer below.
  • Enter a number between forty three and 48:
  •   

My Blog is boring

I pretty much haven’t made a blog post since I posted about my new exciting project idea. Well that’s because I’ve been working on it every spare hour I have for the last 4 or so months. The site has gone live now but not going to advertise or mention it just yet. Currently the front page is blank except for a customer login. I have one customer that is currently using my software and providing fantastic feedback on issues and/or ideas for improvement.

So I’m currently spending my time working on those new ideas but also all the other things I have planned for the software. Quite mysterious I guess?

The site is for Online hosted theatre ticket management. My software enables theatres to manage the sale of their tickets to their performances for their productions. It’s in the early stages as I mentioned but I do have a customer using it right now to manage their ticket sales and it’s going really well. I have heaps of ideas for the product and I’m not afraid of the competitors (which to be honest i have only recently discovered properly! meh!).

I’ll do a big reveal when the time is right – it’s only 60% of what it can be so far and no front marketing page so I’m Mum’s the word for now. :)

I’ve got a new project!

I have finally found a new project to work on! I’m very excited about this one! I didn’t think of the idea myself but instead I was asked if I could create a web application for a “place” and I thought “Wow what an excellent application”.. They may pay me up to $5k for it which would be reasonable for what it is but I think they might end up with it a little cheaper than that! I’ve decided to create a hosted version of this and provide it to lots of other “places” in Australia and .. why not… all over the world!

The worst thing about this stage of developing something new is the fact that I can’t get enough done in one day! I want it to be a reality right now but instead I have to spend all this time developing it.

As usual I have started with the aspects that I am most afraid of.. and these have worked out brilliantly! I’ve been working on this for 3 days now and I am very happy with how it is going but unfortunately it will be at least another 60 odd days before I might be anywhere near finished. The more I think about this the more I realise there is to do! But I’m really excited and hopeful that it’s finally going to be my cracker web application that I might actually make some cash off! :)

What’s more… I’m doing video diaries every night on my progress which I think will make interesting viewing.

Automatically remove Google Analytics code snippet while developing

I’m not in the mood to record any more video tutorials at the moment so I thought I would post some development tips. I’ll start with a really basic one which I think is pretty useful and I use in one way or another whether it be a WordPress site or a CodeIgniter site. Originally I did this in CodeIgniter.

So you are developing a new site and you are in the final stages – you’ve already deployed a good working version of the site to the net but you find that you are still needing to make code changes to fix a few little things or enhance etc. So if you are anything like me you are working on a WAMP server on your PC and the site is something like http://localhost/site-name.

In the footer section of your site though you have already deployed the Google Analytics code snippet. Since I understand (and I might be wrong) that Google doesn’t filter out localhost visitors from the stats – you are ruining your stats! Your options are to manually remember to use an alternate footer.php file or manually edit the footer.php file while you are working. I did this once and then realised after a week that the last upload was the alternative footer file and didn’t include the google code. I wasn’t happy at the time as I was trying to see how my marketing efforts were going on my brand new site!

The CodeIgniter Solution

  1. Create a new view file called something like “google_analytics.php” and paste in just your google analytics code for your site
  2. In your basecontroller (recommend you create a basecontroller and extend this for your other controllers) or in your controller(s), put the following code:
    // Check if we want to include google analytics code - ie; if this is production or localhost
    $this->view_data['include_google_analytics'] = TRUE;
    if (strlen(strstr(base_url(), 'localhost')) > 0)
    {
    // this is development - don't put in the google analytics code
    $this->view_data['include_google_analytics'] = FALSE;
    }
  3. In your footer.php view file – or whatever you have called yours put in the following code:
  4. <?php
    // check if to include google analytics code
    if ($include_google_analytics)
    {
    include 'system/application/views/google_analytics.php';
    }
    ?>
  5. Now this footer.php file can go back and forth from development to production and you never have to worry about removing or disabling the Google Analytics code because it will only ever activate when you are not working on localhost :)

The WordPress Solution

  1. Create a new view file called something like “google_analytics.php” and paste in just your google analytics code for your site. Put this file in your template directory.
  2. In your footer.php WordPress theme file, paste the following (this needs to go just before the </body> tag):
    <?php
    $base_url = $_SERVER['HTTP_HOST'];
    if (strlen(strstr($base_url, 'localhost')) == 0)
    {
    // this isn't development - put in the google analytics code
    include( TEMPLATEPATH . '/google_analytics.php' );
    }
    ?>

Of course I probably could have just done the same thing in CodeIgniter but I came up with the CodeIgniter solution many moons ago – well and truly before I ever looked at WordPress.