February 23rd, 2008
This is just a quick PHP tip I’d like to share. It’s called the Tertiary Operator. It’s basically a way to simplify simple(and complex) if statements into one liners!
Say for example you have a conditional statement like:
<?php if (5 > 10) { echo 'The world is ending.'; } else { echo 'Yes, I am still sane!'; } ?>
You can reduce this statement into the following using tertiary operators:
<?php echo (5 > 10) ? 'The world is ending.' : 'Yes, I am still sane!'; ?>
What it basically does is
(if this statement is true) ? (we should do this to it) : (else goes here in an if statement)
This can come in real use when you don’t want to stick in an if statement in the middle of an echo statement for example. You can even nest them! Here is a more complex one I used in one of my scripts(sorry about the code wrapping!):
(($query_count_result['count'] > 1) ? (($query_count_result['count'] == 1) ? $query_count_result['count'].' Song' : $query_count_result['count'].' Songs') : 'No Songs')
Can you figure out what that statement is doing? I might be able to actually simplify this statement but I didn’t really give it much thought at the time of making it. I just wanted to get it to work and wasn’t really thinking about what was the most optimal way to do it. Hope this tip was useful!
February 20th, 2008
Magento - Open Source eCommerce Solution
Magento is an open source eCommerce solution built on the Zend Framework. I came across Magento when a client wanted to create an eCommerce solution to his brick and mortar herbal store that he had here in Toronto.
I knew that building an eCommerce website from scratch was not a real viable solution as eCommerce websites are complicated things. You have to take into account security, transaction processing, admin usability, and a slew of other things related to the storage and retrieval of information in databases. osCommerce was the first open source solution that came to mind but I’ve heard many things about osCommerce. Many not so good things about osCommerce that basically eliminated it as a solution for this client. This was when someone from the SitePoint forums referred me to Magento.
When I went to look at Magento, I was blown away. The beautiful, yet simplistic design of the Magento homepage was the first thing that caught my eye. Delving deeper into the application itself, I find myself confronted with a feature rich- yet clean eCommerce package. The admin control panel is also quite a thing of beauty as well! It doesn’t present you with a million of options, instead there is a nice navigation system at the top that breaks down the management of your eCommerce website into small and manageable bits. You can have a look at the demo of the admin backend right over here: http://demo-admin.magentocommerce.com/index.php/admin/
I had to ask myself, this thing can’t really be free can it? Open-source free? This will probably confirm it. Indeed Magento is free as in open-source free!
PS. I must’ve had a freudian slip writing this, as after proof-reading this entry, I noticed I spelt Magento as Magneto the entire time. But again that might just happen when your name is too close to a famous Marvel comic villain.
February 19th, 2008
Well it’s always great to set goals, it gives you something to reach for, something to achieve, and something to give you a sense of achievement.
I’m not going to make and list all my elaborate goals. Instead, I want to keep this one simple for now and take it one step at a time. I’ve always have trouble keeping up with this blog so my goal for this month and beyond is to at least hit 2 digit figures in terms of blog entries.
This might seem like a small and stupid goal but looking at my archive of blog entries by month, you can see this seems to be a trivial goal for me to reach. March 2007 was the only month I’ve reached double digit blog entry figures! That seems quite pathetic, so hopefully I’ll make my way to break this trend.
Wish me luck! :)
February 17th, 2008
Well it’s been quite awhile since my last post, midterm season for University students is quickly approaching once again and it’s an awfully busy time of the year. Here’s whats been going on with my latest projects and ventures.
mp3Upload.ca
mp3Upload is a website that allows users to upload mp3 files and share them freely with their friends. The idea spurred out of my mind one night and about 3 days later the design was made, domain registered, and backend created! The goal was to create a simple and intuitive user interface that quickly allowed users to do what they came to the site to do, upload mp3 files.
Many people who I’ve talked to after using the website can attest to the ease of the user interface, so I’m happy that I was able to achieve that. The site has a no frills upload form and once the mp3 has been uploaded, he or she is redirected to a page where they can share the links to allow their friends to listen or download the mp3 file they just uploaded.
Right now the site is only monetized through Google AdSense, making minimal coin here and there. As always though, it’s always recommended that you don’t rely on just one source of income. The beauty of the site is it has a lot of room for expansion. My plan in the future is to implement a premium membership system which will allow users to keep playlists of mp3 files, view mp3 files they have uploaded, search our database of mp3 files (by genre, title, artist), and also freely browse through the latest mp3 files that are uploaded onto the site. This premium membership will be subscription based most likely broken down 1 month, 6 months, 12 months, and “lifetime”.
Of course, the service will still be available for free, you just won’t be to access the extra features. This will hopefully introduce this second source of income from the site, making the revenue from it less reliant on just one source.
SiteProxy.org
SiteProxy.org is a free anonymous web proxy that I purchased off the DigitalPoint forums for $150USD. Actually it was a network of about 8 other proxies! You can view all the other sites by looking at the “Try these other proxies” box on the right. I basically revamped the design of all of the sites I purchased to use this new standard format for all of the proxies. They are all managed through a single set of files which allows me to easily add sponsored links or new proxies across the entire network when needed.
The idea of having a network of proxies is so if one is blocked, your users can go to your other one. Also having the network allows you to easily share traffic across the network of proxies you own. So by promoting one proxy to get a lot of traffic, you can push some traffic around to your other networked proxies as well. I’m hoping to hold onto this for awhile and try to get some more traffic to the network and eventually resell it for a nifty profit!
In terms of expansion, the only real expansion that I see useful here would be to add more sites to the network as traffic grows. This gives you more web properties which is more attractive to a buyer who might be looking to buy a proxy network.
Those are the major things that’s been going on with my online investments. I’ll keep you updated with the progress of these sites as they come!
February 1st, 2008
Well January 2008 has come to a close, first month of the year and with the renewal of this blog. Here is the monthly report for January 2008’s investments!
Nothing too exciting. My Canadian Money Market made $4.17 and goes from $1,210.82 to $1,214.99 and my US Money market made $1.12 and goes from $1400 to $1,401.12. The beauty of investments is that now the money I made from these, gets reinvested back so that next month the idea is to make a little bit more and a little bit more.
Online wise in January, the highlight of RapidWire and ProfileRenew sales for $2300 was the big thing and also my Google AdSense payment came in at about $150. This will probably be the last of payments I get from AdSense for awhile since RapidWire was what drove my AdSense earnings. No matters. I have also worked and completed my newest site! But that is for another post. :)
January 29th, 2008
$1400USD Purchase of US Money Market Fund from RBC Financial
So my first investment with the $2300 I earned from selling RapidWire and ProfileRenew is the purchase of a US Money Market Fund offered by RBC Financial. I walked into the bank a day or two after I sold the websites and invested $1400 of the $2300 I earned into the money market fund, leaving me with $900 left from the sale of the websites.
This is a pretty standard investment, I also have a chunk of my savings from my Canadian funds invested in a Canadian Money Market Fund. I find it easy to just move some money into these investments when I have no real use for the money because instead of getting little to no interest from the bank, investing in the fund at least gives you decent return on your money every month. I get around $3-4 a month from the $1000 I had initially invested in the Canadian money market which otherwise would’ve gotten like $0.01 if I just left it in the bank. Every little bit counts!
Money market funds are usually comprised of investments in different categories. This is what makes them relatively stable investments. The US money market fund I purchased had a minimum of $500 investment which is pretty much standard for most of these more simple type of investments. Looking at the informational PDF gives me some information like the current yield of this US money market fund is 4.35%(Canadian money market fund is at 4.15%) and that since the fund’s inception it has a trailing return of 3.42%(Canadian money market fund is at 4.99%). Good enough for me! What it will do is, at the end of every month, the return that is made from the investment will be reinvested into the fund automatically without me having to do anything. So this is a great way to get extra change from the money that lays in your account.
To give you an idea of how much I’ve gotten back from my Canadian money market fund investment, I initially invested $1200 into the fund in October. In October I got a return of $3.53, November $3.42, and December $3.87 bringing the total to $10.82. Not a lot but like I’ve said before, this is from money that would otherwise be doing nothing sitting in the bank.