Tags: development

CakePHP Video Encoder Component Released

Posted by Andrew on November 18th 2009, 7:29pm

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.

CakePHP Video Encoder Component

Bookmark and Share

Mozilla Moves from CakePHP to Django

Posted by Andrew on November 17th 2009, 9:22pm

Mozilla recently announced that they are switching from CakePHP to Django. They are currently using CakePHP 1.1 and most of the reasons for the switch they list have been fixed in recent versions of CakePHP (1.2 & 1.3) such as debugging, unit testing and caching. I don't understand why they just didn't upgrade or at least take a look at the recent versions of CakePHP before switching and at least acknowledge the fact that most of the problems they had, had already been solved.

Mozilla moves from CakePHP to Django

It's sad to see the largest CakePHP property switch to another framework, but being the large company that they are I'm sure there was a lot of thought that went into the decision. Good luck in the transition.

Source: http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/

Bookmark and Share

New Croogo Theme for Download: Simple

Posted by Andrew on November 17th 2009, 9:17am

Update: September 4th, 2010

I have released this theme for Croogo 1.3.2 and should be forward compatible. Please comment on the new post for questions and problems.

http://andrw.net/blog/simple-theme-released-for-croogo-132

Here it is. My first theme release for Croogo. Not sure how many people out there are using Croogo yet but it's showing a lot of potential and it's especially good news if you are already a CakePHP developer. Ensure that you read the README file included in the archive as it explains how to get things like full text searching and the tag cloud working. 

Simple: Croogo Theme

I already have a few ideas for my second theme so stay tuned and as always if you have any questions drop me a line in the comments.

Preview: Simple Croogo Theme

Last Updated: September 4th 2010, 10:27am

Download: Simple Croogo Theme

Bookmark and Share
Posted in Themes, Croogo | 30 Comments

Croogo Tip: After Adding New Actions, Refresh ACL Permissions

Posted by Andrew on November 16th 2009, 6:41pm

Recently I have been adding new features to my site (search, tag cloud) that involved adding new actions. Little did I know that the default ACL permissions use a whitelist instead of a blacklist meaning that all new actions by default will not be publicly avaiable.

When you add a new action to Croogo make sure you log in to your admin panel, go to Users > Permissions and then click on the "Generate Actions" button. This will generate all of the actions in your controllers and allow you to set the correct permissions for your new actions.

Bookmark and Share
Posted in Croogo | 2 Comments

Adding Full Text Search to Croogo

Posted by Andrew on November 16th 2009, 4:18am

I just launched full text search on my blog. I am sure that this is something planned for the future of Croogo but I wanted some to add search functionality and not have to wait. Once I figure out Git/Github I will fork the main project and get some of my additions up there.

Adding full text searching is actually quite easy. I limited it to searching the title and the body of the posts and only allowed searching of blog posts. Below is the code I used. This goes in the nodes controller.

function search () {
// Import sanitize library
App::import('Core', array('Sanitize'));

$query = mysql_escape_string(Sanitize::html($this->params['url']['q']));

$this->paginate['Node']['order'] = 'Node.id DESC';
$this->paginate['Node']['limit'] = Configure::read('Reading.nodes_per_page');
$this->paginate['Node']['conditions'] = array(
'Node.type' => 'blog',
'Node.status' => 1,
"MATCH(Node.title, Node.body) AGAINST('{$query}' IN BOOLEAN MODE)"
);
$this->paginate['Node']['contain'] = array(
'User',
'Meta',
'Comment',
'Term' => array('Vocabulary')
);

$this->Node->recursive = 0;
$this->set('nodes', $this->paginate());
$this->set('q', $query);
$this->set('title', "Search results for {$query}");
}

Now all that's needed is a form that will request the search action in the nodes controller and a search template to display your search results. For my form I used the "GET" method. In my search template I used the text helper to highlight the search term and also show an excerpt instead of the full post as shown below.

<p><?=$text->highlight($text->excerpt(strip_tags($this->element('node_body', array('node' => $node))), $q, 200, '...'), $q)?></p>

As usual if you have any questions leave a comment and I should get back to you shortly.

Update November 19th

Croogo Full Text Search

Bookmark and Share
Posted in Croogo | Leave a comment
1 | 2 | 3 | 4