Tags: cakephp
New Release CakePHP Geotargeting Helper
Do you need to find out geological information out about users that use your web app? Look no further! This helper utilizes IPInfoDB's geolocation tools to find out geographical information about your users from their IP address.
Migrate Your Wordpress Blog To Croogo
I just saw this on Twitter while doing a search for Croogo related news. It looks like Matt Curry has released a plugin that will migrate your Wordpress blog over to Croogo. I would give this a shot but I'm currently not running any Wordpress sites. This is great news for any CakePHP developer running a Wordpress blog looking to switch over to the CakePHP based Croogo.
Right now it looks like it migrates most data, but I would test it on a development server before you migrate your production blog.
CakePHP Github Roundup
Github is a great resource for any developer. Other developers are constantly publishing new code to Github but sometimes it's hard to find what you are looking for. I will attempt to find some of the better pieces of code hosted on Github for your CakePHP programming pleasure.
Matt Curry probably has one of the best selections of CakePHP code on Github. He has published components, datasources, helpers and plugins. I have used many of libraries in my work, most recently the chat plugin.
Neil Crookes also has some great code in his repository. He recently launched his searchable plugin for in site searching. He also has an accompanying blog post with instructions on how to use the searchable plugin.
Joel Moss has published probably the best migration system for CakePHP that works with YAML files. I have used it in many projects and it has saved me a lot of time setting up my databases. He also has named scope behavior which emulates named scope from Ruby on Rails.
Fabio Kreusch has published a CakePHP Newsletter Plugin that works quite well if you are looking to implement a newsletter into your CakePHP application.
Are you looking to add some ecommerce to your site? Take a look at Sam Anzaroot's CakeCart which is a shopping cart built ontop of CakePHP although he says it is currently in "pre-pre-alpha" stage it is a good place to start.
This is by no means a complete list, just some of the pieces of code I have found useful on Github. If there are any other interesting projects that you know of on Github leave the url in the comments.
Using CakePHP and RPX for Social Authentication
I am working on a social network application where I want to allow users to import their information from another social network or service that provides an open authentication. I looked at Facebook connect and Twitter sign on but after doing research the easiest solution for me was using RPX's hosted solution. It took me about 10 minutes to implement and maybe another hour to fine tune to my needs.
To start you will need to register with RPX and then set up your widget. Some of the providers (such as Facebook and Twitter) need you to set up the application on their network first and then they will provide you with an API key that you can then plug into RPX.
After setting up the widget they will provide you with some code to copy and paste, there really isn't any modifications needed to the code except setting the token_url which is used as a redirect url once the user has been authenticated. You will probably want to set the token_url to a registration page where the user can enter a username and password for CakePHP's authentication component.
Once you have everything in place you will need to set up some code for the action that corresponds with the token_url. First you will need to receive the token from RPX used to retrieve the user's data, then you will need to request the user's info using their API. Here is the code that I am using in my action.
App::import('Core', 'HttpSocket');
$http = new HttpSocket();
$token = $this->params['form']['token'];
$results = $http->post(
'https://rpxnow.com/api/v2/auth_info',
array(
'token' => $token,
'apiKey' => 'YOUR-API-KEY-HERE'
)
);
$user = json_decode($results);
I am using CakePHP's built in HttpSocket class to request the user's information. The information sent from RPX is in JSON format so I used PHP 5's built in json_decode method to create an object out of the json. Now you would most likely create a new user record and save the information received from RPX and in the view display a form to collect the rest of the user's credentials such as username and password.
That's it, it's very simple to use. If you have any questions leave a comment and I will get back to you as soon as possible.
CakePHP Video Encoder Component Released
I have just released my Video Encoder component for CakePHP. This will be handy for all of you trying to build the next YouTube with CakePHP. Check out the project page for instructions on how to use and to download. Also if you have any questions, comments or find any bugs leave a comment on the project page.
