YouTube: Creating and Using Playlists

I discovered something great the other day, and I figured I would pass it along for any of you that don’t know about it. YouTube is loaded with music. You can usually find the song you are looking for. So, instead of buying music to listen to at home or work, you can create playlists in YouTube if you have created an account.

When you have created a playlist, you can then to go your playlists, select one, and click “Play All”, and it will cycle through the entire playlist without you having to touch anything. So, open up a new tab in your browser, create a playlist, add a bunch of songs to it, click “Play All”, and you’ll have some nice listening without touching a thing!

Magento: Find Which Class Is Responsible For The Template

Just found out a really quick and easy way to figure out which Magento PHP Class is responsible for putting together everything that is needed for any given template. It’s as easy as dropping in one simple line of code. Just place the following into any .phtml template files:

<?php echo 'This Template\'s Class: '.get_class($this); ?>

Magento: Category Importer 1.0 (Beta) Launched

After finally figuring out the Magento API, I figured I’d start first with creating a simple category importer. So, if you have a Magento site out on the web and you want to try it out, please have at it! It requires that you create a web services user on your Magento installation, and you have to host your own CSV.

Just follow the CSV format that I laid out, and you’ll be ready to import. Remember though, this hasn’t been tested very much. I’ve done tests here and it seems to be working great. It does have it’s limitations. You have to provide the CSV with the name of the parent category that you want the imported category to fall under. If you have multiple categories with the same name, the importer will not work properly yet. It does, however, refresh the category tree ever time a category is imported, allowing you to give parent categories that you just imported in the CSV.

So, please try it out, let me know of any bugs you find, or any ideas for improvement. I put a Paypal donation link on the import page - if you wish to show your appreciation, or give towards helping me improve it.

Enough talk - Magento Category Importer.

PHP: Enable SOAP with PHP5 on Media Temple’s DV 3.5

I started trying to learn Magento’s API today, which requires the use of SOAP. I know that SOAP is a part of PHP5, however, I guess it doesn’t often come enabled on a lot of servers. I have a DV with Media Temple, and after running phpinfo(), I saw that SOAP definitely wasn’t configured.

The following instructions will guide you through adding the SOAP to your previous installation of PHP. In my case, I had PHP 5.2.6 installed, so - note that when you are downloading the PHP source files - you should probably try and stick with the version you currently have.

Install Media Temple’s Developer Tools

You will need the developer tools installed to compile PHP. So, login to your Media Temple account center, select your primary domain, find the “Root Access & Developer Tools”. Install the developer tools if you haven’t already. It may take up to 5-10 minutes, so be patient.

Make sure you have enabled root access as well, as you will need this to be able to compile the PHP

Download & Compile PHP

Open your terminal, and ssh into your server using root.

  1. Navigate to a relatively unimportant directory. I chose /home/
    cd /home/
  2. Download PHP
    wget http://www.php.net/get/php-5.2.6.tar.gz/from/us.php.net/mirror
  3. Unpack the PHP file
    tar -zxf php-5.2.6.tar.gz
  4. Configure the new PHP to enable SOAP (will take a few minutes) (before enable is two dashes)
    cd php-5.2.6
    ./configure –enable-soap=shared
  5. Rebuild PHP (this will also take a while)
    make
  6. Copy just the SOAP module into your existing installation of PHP
    cp modules/soap.so /usr/lib/php/modules/
  7. Add the new SOAP configuration to your existing configuration
    echo "extension=soap.so" > /etc/php.d/soap.ini
  8. Restart Apache
    /etc/init.d/httpd restart
  9. Optional: You can now delete /home/php-5.2.6/ if you’d like, as you won’t need it any longer.
    rm -rf /home/php-5.2.6/
  10. Check phpinfo() to confirm that SOAP is now enabled.
  11.  

    This should not effect Media Temple’s update option program, in the case where you would like to up update your server later on.

    Special thanks to dotjay for initially pointing this all out.

Basecamp API: PHP Class - Version 1.0 Launched

The time has come to launch version 1.0 of my Basecamp PHP Class. It’s by no means complete, but it does a majority of the main core features. So, instead of sitting on it for a while, I figured that it was best to launch it early and keep building upon it (hoping too that I will receive more feedback on it).

So, please check it out on the Basecamp API PHP Class page. I whipped together a quick documentation page as well listing how to use the core methods, as well as a bunch of the simple set and get public methods.