Welcome to my blog !

A blog devoted to all things geeky, including PHP, Web Development, Photography, Design, Gadgets and Gizmos.

December 15 2008

Wordpress 2.7 image upload issues

Tagged Under : , ,

Like some people upgrading to wordpress 2.7 recently, I had some issues with the image upload functionality in blog posts. Found the fixes described here.

My issues was general javascript issues, the upload image window would appear in the same browser window (not in a popup).  The fix which worked for me was emptying the wp-content/uploads/js_cache folder. I emptied that folder and my Javascript issues dissapeared!

October 10 2008

Using VIM to edit PHP

Tagged Under : ,

I’ve bee through a number of different editors for coding PHP, including PHPStudio, Dreamweaver, Eclipse, Zend Studio for Eclipse.  The quality of those editors ranged from great (eclipse) to terrible (Zend studio for eclipse, crashing buggy nightmare). I had some kind of negative issue on each of those platforms, generally things not working properly or certain functionality missing.

So I’ve made the leap to using Vim fulltime as a PHP editor.  The main advantage with VIM is that it can be found on pretty much every UNIX/OS X server on the internet.  I can log in and with some VIM knowledge continue editing a file quickly and easily.  No need to depend upon platform specific and expensive editing software.

To get started in vim on OS X the quickest way is to open a terminal window and type vimtutor and you’ll be presented with a pretty simple tutorial.  I just burned through that to make sure I had the basics down, then moved onto the help section and looked into creating new windows in vim (very cool) and search commands and patterns (very powerful).  In about 4-5 hrs you can go from VIM noob to vim intermediate.   Even if you don’t want to make it your fulltime editor and prefer something like dreamweaver, it’s a handy skill to have for editing files efficiently on UNIX boxes.

September 04 2008

Share code with pastie!

Tagged Under : ,

I’m often discussing Javascript/PHP/HTML in a chat window and usually paste chunks of code I want to show the other people into chat.  Problem is, quite often the recipient gets smileys all through code or it does’t render properly on their chat client or the snippet gets lost along the way.

http://www.pastie.org/ looks like a pretty sweet way to share those snippets while maintaining code highlighting, formatting and also for keeping it referenced for later usage.  It’s a free service (donations accepted) so pretty handy for quickly showing off your latest ubersauce function.!

August 04 2008

Zend Studio for Eclipse is fail

After probably the 100th fatal issue in Zend Studio for Eclipse I have had enough. As other have noticed, Zend Studio for Eclipse gets stuck on building projects fairly often and losing work is common.

The product is obviously aimed at the professional PHP developer market, as it has some pretty advanced features in place. However in it’s current state, I would not recommend Zend Studio Eclipse to anyone. I’ve lost a lot of work to this product and today was the final straw.

Where to from here? Well I’ve been down the Dreamweaver path before. Not that great but at least it doesn’t crash in such a devastating fashion and as frequently. However I might just get back to basics and use Vim. At least with Vim I know my work is safe (I’ve NEVER had OS X crash a terminal).

July 27 2008

Hacking Wordpress and Drupal

The thing I really have enjoyed about using Drupal and Wordpress a lot lately is that they are simple, fast to develop with and powerful.  They really show off PHP as a quick and powerful language, complex apps mainly based around functions.

Using the wordpress function reference, I can do most things VERY quickly and don’t have to think about complex concepts that pop up in other PHP applications (like the very nice but very complex OOP code in magento).  I know comparing a blog application to a full blown advanced shopping cart is like chalk and cheese, but I do enjoy the speed that comes from the KISS design of Wordpress.  Hack in my custom code, in 10 minutes and move on.

July 17 2008

Essential Drupal Plugins

Drupal Logo

(a somewhat long post)

After recently finishing a website in Drupal 6, I’ve rediscovered some of the best modules available for the CMS.  Drupal is a pretty slim CMS out of the box, it does some basic CMS and menu things, but becomes super powerful once you start integrating a few of the great modules out there.  The tricky part is often identifying which ones to get.

Anyway, heres my list of modules I’d reccomend for almost any site.  A lot of SEO things + content management tools and a few extras which I found useful.

  • CCK (Content construction kit, allows you to create new content types in Drupal, so instead of a simple page or news item you can tailor new content types to suit your material.  Essential for most sites).  CCK is very powerful and handy for most sites.
  • Admin Menu adds a drop down menu to the top of the admin pages.  The drop down menu has links to all of the admin sections, seriously speeds up administrative tasks.
  • Front Page allows you to easily create a unique front page on your site.  Most Drupal sites use the same template for most pages and simply hide/show blocks of content and content types.  Front page allows you to easily create a unique front to the page.
  • Global Redirect checks the current URL for an alias and does a 301 redirect if not being used.  Drupal has node urls which can be changed to clean aliased URLs.  Problem is Drupal maintains both the node address and the alias.  Bad for SEO, where engines might see the duplicate pages as spammy content.  Global Redirect fixes that, essential for SEO.
  • Google Analytics quickly throws analytics onto the site.
  • Image is a module which allows you to quickly create images and image galleries for your drupal
  • TinyMCE and IMCE.  TinyMCE module is a pretty compact rich text editor for Drupal.  IMCE adds image upload and manipulation capabilities to that.  Very handy!
  • Local Menu.  One of the issues I have come across (one I haven’t ‘really’ solved yet) is that when I need to pull out children of a specific menu item it can be difficult.  I know there are functions in the Menu API for it, but I haven’t been able to get it working.  Local Menu allows you to quickly create a variety of menus, including menus built on the current page.  Great for quickly display links to subpages of the current node.
  • Nice Menus.  Quick and easy suckerfish menus.  Easily configured to handle vertical and horizontal menus.
  • Node Privacy by Role.  In Drupal, blocks can have complex permissions based upon user roles and the current page.  Node privacy by role allows you to also add permissions to Nodes (pages), great if you have a certain page which only ‘managers’ or ’staff’ should see.
  • Nodewords allows you to get hands on with page meta tags.  Handy for SEO.
  • Page Title allows you to create unique title tags for nodes, something drupal doesn’t do out of the box.
  • Path Auto can automatically generate aliases for nodes (pages).  You can manually add wildcards or alter the url for each node.   Great for SEO, Essential !
  • Search404 performs a search instead of a 404, so a mistyped url goes to search results for the term.
  • Site Map provides a human readable SEO friendly site map (not a Google XML sitemap, just a human one)
  • Views allow you to modify the way information in nodes is rendered.  This one is essential if you plan to offer a few variations of the info in your content types.  This with CCK is the way to present any kind of information.
  • Webform.  One of the first things I did in Drupal was wonder how I should create a custom form.  At first I thought I might have to get into the forms api to do it, but webform can create some very complex forms very easily.  Its easy enough to use that clients (with a little bit of training) could create their own forms.

I used a few other things (weather module, xml sitemaps), but the above are the most crucial in my opinion.  Also the contemplate module looks great, but this project didn’t require anything that powerful.  Drupal 6 has a pretty small learning curve really, once you find the modules you need, simple sites can be churned out quickly and they have the powerful admin that drupal offers.  All good!

July 08 2008

Drupal 6 fun!

Tagged Under : ,

Drupal Logo

A recent project has required me to get back into Drupal, which I had some experience using last year (Drupal 5).  Initially its a pretty bare bones systems in some regards.  Not really tailored to SEO or complex views.  But once you have discovered which custom modules to install, the power of the CMS really explodes.

The CCK modules are seriously powerful, numerous SEO modules, numerous image and RTE modules.  The Admin is very user friendly, always good for the clients and Drupal 6 has an improved UI.

The only issue I have had with Drupal 6 so far (coincidentally I had the same issue on Drupal 5) is messing with the navigation system, attempting to get navigation to tertiary menu items displaying correctly.  By all accounts the menu_navigation_links() function should be able to pull out child menu items, but as of yet I have had no luck.

June 22 2008

Zend VS Cake

I’ve been using the Zend Framework for PHP for a while, I’ve only done 3-4 projects using it, and only 1 using the MVC component of Zend 1.5.  The code is very solid, PHP 5 and easy to use.  However, I had to take a look at Cake for a potential job coming up soon.  Coded up a quick blog app based on the code demonstrations on the Cake site.  Impressions of the source code (mishmash of PHP4 with PHP5 compliance checks) was not good.

Compared to Zend, the codebase doesn’t look like it would be easy to jump into should I need to make any  modifications to it.  On the other hand its FAST to develop with.  Zend is way more hands on, having to extend a lot of classes for basic stuff (pagination, database acl etc) while cake 1.2 gives you those elements for free as well as scaffolding, simple configuration, simple authentication.  Cake is just a lot simpler and faster all round, I might get a couple of things done in Cake and see if I am feeling inclined to go back to Zend.