istanbul escort - beylikdüzü escort
Home Archive for category "PHP"
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

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

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 
formats

Variable Variables and Template Lite

Published on May 1, 2008 by in PHP, Template Lite

There is one programing concept that always hurts my head, and that is the variable variables or dynamic variables. What dynamic let you do is access data from the value of the a variable you are viewing. (See I told you it would hurt your head)

$b =20; // set the [...]

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

Template Lite Modifiers

Published on April 23, 2008 by in PHP, Template Lite

One of the greatest tools I have in my library set is Template Lite . Template lite is a light-weight version of another template engine known as Smarty. Once you start using template lite you will be pleasantly surprised by how powerful yet modular it is.
My whole point of this blog is [...]

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