Skip to content


The Great PHP on Windows Contest!

php|architect is running a contest called The Great PHP on Windows Contest. Basically you can tell from the title, this is a contest about PHP and Windows. The challenge is to develop a PHP application, desktop or web, that runs on Windows. You get bonus points for using Microsoft technology, like SQL Server, Azure, etc.

For more details you can check out the contest page.

I signed for the contest and they accepted my entry! My project is Task HUD, a task management web application, should be awesome. Not just for the contest, but because this is something I need. Even though nothing is up yet, you can keep track of the progress of Task HUD at http://www.taskhud.com.

I’m excited to be a part of this contest and I look forward to what the other entries are developing.

If you use twitter, you can follow what people are saying, using the #winphp hash tag and you can follow @phparch.

If you are a PHP developer, you should sign up, because by the way, did I mention the sweet prizes? no? well, you need to check them out for yourself.

One last thing, I would like to thank Applied Innovations for hosting my entry on their servers, rock on.

Posted in PHP, Windows.


Oxite no go

Well, I tried to move my blog over to Oxite and because my hosting provider is an average run of the mill providers, I wasn’t able to get it up and running. Honestly, the process to get Oxite up and running is way too much effort for a blog. Wordpress works great and is a lot easier to install. So, I’m sticky to Wordpress for now.

Posted in Web.

Tagged with .


Moving blog to Oxite

After some back and forth, I decided I’m going to move my blog over to Oxite. I really like how clean ASP.NET MVC is and Oxite has everything I need to run my blog. From there I’ll be able to customize my blog and mix in a little Silverlight. So… this should be my last post in Wordpress.

Posted in Uncategorized.


Linking to other controllers

Hope this helps someone save some time, but that might be a hard to do, since you really don’t waste time when programming with Ruby :)

To link to another controller from a different controllers view you can use:
<%= link_to 'Accounts', :controller => 'accounts' %>

Posted in Ruby.


Customizing the system message in Joomla

In case others run into this and because it’s not in an intuitive spot, here is the file location to customize the system message in Joomla:

[joomla install]\libraries\joomla\document\html\renderer\message.php

Posted in Joomla.


Disable front-end editing on the Frontpage in Joomla

To disable editing on the Frontpage in Joomla 1.5.11, all I had to do was change:


$access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all');
$access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own');

(Lines 64-65)

To:

$access->canEdit = $user->authorize('com_content', 'edit', 'content', 'none');
$access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'none');

(Lines 64-65)

In the following file:

[joomla install]\components\com_content\views\frontpage\view.html.php

Posted in Joomla.


Sanitizing input in Joomla

Here is a quick tip. To sanitize input before you send the query to the database in Joomla, you can use:

$text = "My 'awesome' text";
$text = $database->Quote($text);

This will quote and escape special characters in the text string.

Reference:
http://help.joomla.org/content/view/525/125/

Posted in Joomla.


CakePHP home page controller and view

Hopefully this will save someone time, because the locations are a little off.

Here are the default files for the CakePHP home page controller and view.

Controller:
[cake install location]\cake\libs\controller\pages_controller.php

View:
[cake install location]\app\views\pages\home.ctp

I’m using CakePHP 1.2, so this might be a little different for earlier releases.

Posted in PHP.


Find differences in both arrays with PHP

Sometimes something looks easy, but it turns out to be a rabbit hole. Take for example the function array_diff in PHP. I thought it would return all the differences in both arrays, but it doesn’t. After going through the function comments thread, I came across a great solution. It’s to the point and it works!

To get the differences in both arrays, you can use:
array_merge(array_diff($array1, $array2),array_diff($array2, $array1));

For example:

$array1 = array('John', 'B', 'Smith');
$array2 = array('John', 'C', 'Smith');

$result = array_merge(array_diff($array1, $array2),array_diff($array2, $array1));

print_r($result);

will return:

Array
(
[0] => B
[1] => C
)

Basically the first call to array_diff returns the differences in $array1 and then the second call returns the differences in $array2. After that, they are merged together as an array, to provide all the differences in both arrays. Simple and sweet.

Credit goes to this comment.

Posted in PHP.


Having IE CSS issues? Use DOCTYPE!

Ok, this is probably silly, but I ran into an issue where everything was working in FireFox, but IE wouldn’t take. So after some searching and pounding my head against the keyboard, I ran across a quick forum post where someone mentioned to put in a DOCTYPE for your page. So I added the correct DOCTYPE and bam! everything work… thank you Google.

Here is a list of DOCTYPEs out there:
http://www.w3.org/QA/2002/04/valid-dtd-list.html

To save you some headache make sure you put one in.

Posted in Web.