Oct
13
2011

Using PHP to merge and minify CSS and Javascript

And yet another ‘bangin’ update!  Don’t use this (I’m going to leave it here for reference), use the magicmin javascript and css minification/caching class instead for performance, better javascript minification, caching, gzip, base64_encoded images, and more! One MAJOR factor in the usability of your website is site load time.  This is affected by a number of factors: the number of images, database queries, and the number of server requests to fetch your stylesheets and javascript […]

Sep
24
2011

Synchronous Input Population Using JavaScript

Synchronization for html input forms

Working with code can often be tedious, and frequently requires programmers to continually reference functions or other sets of code that exists on different pages.  For example: As a relative newbie to wordpress, when creating or modifying files I spend ~70% of my development time looking through files for correct/applicable function usage.  If I wish to display an option to edit a post in a template, I must use “edit_post_link(‘edit’, ‘<p>’, ‘</p>’);”, however, the chance […]

Aug
25
2011

Using PHP to Replace Special Characters with their Equivalents

PHP Character Replacement

After having just completed an extensive text file parsing script, I discovered something very very very annoying.  A small army of Microsoft Word inspired characters had invaded the imported plain text files (courtesy a number of citation management softwares and websites), causing text to have all sorts of ‘fun’ symbols sprucing things up. For example “Tâ��ms” => “Teams”, but with that extra something added in for visual highlight (or something). So what was a programmer […]

Aug
22
2011

How to Import an ExpressionEngine Blog into WordPress

EE to WP

I’m sure by now that most of you have seen my post on how I feel about ExpressionEngine (here), so this post is a natural follower!  Today, we’re going to talk about migrating your content from ExpressionEngine to WordPress. I spent quite a bit of time working through EE’s poorly detailed instructions on how to export entries before I decided to just get my hands dirty.  Mind you, this post is only applicable to you […]

Aug
11
2011

JavaScript Close Window AND Refresh Parent

Earlier today I was working with complex PHP function to update values in a database, within a popout window.  The function worked flawlessly (naturally ;) ), however I was looking for a way to have immediate display feedback on the parent page. Enter the JavaScript close window refresh parent script… <a id="actions" href="#" onClick="window.close();window.opener.location.reload();">Close Window</a> Looking for more?  Sorry!  That’s it for this crafty little function.

Aug
1
2011

Data Encryption Using AES_ENCRYPT

Database security using AES encryption

Having databases contain information on subscribers, customers, clients, and the like is similar to playing russian roulette.  You’re never certain as to when the bullet comes!  Same principles apply to having your customer’s sensitive information yanked from your precious databases!  We all watch the news to see which company will have their customer details compromised next. Most recently, Sony has now had approximately 100 million accounts compromised, costing them upwards of $171 million dollars.  And […]

Jul
21
2011

Simple (Advanced) Click Tracking Using PHP and MySQL

Track clicks using PHP

On a recent project, I was asked to record the pages that each user was navigating to in a secured special-purpose website.  Initially it seemed daunting, however I recalled a script I’d written to track email open rates using PHP. I am generally disinterested in maintaining a database table of pages, along with a second table of clicked links as I find it to be very inefficient, so I opted to create a simple pass-through […]

Jul
18
2011

Exploding a String using Multiple Delimiters Using PHP

Php Array output

Updated February 12th, 2013 to reflect Dave’s comment function below- A++ for simplicity! function explodeX( $delimiters, $string ) { return explode( chr( 1 ), str_replace( $delimiters, chr( 1 ), $string ) ); } $list = ‘Thing 1&Thing 2,Thing 3|Thing 4’; $exploded = explodeX( array(‘&’, ‘,’, ‘|’ ), $list ); echo ‘<pre>’; print_r($exploded); echo ‘</pre>’; Earlier today, I was looking for a simple function to explode text that was contained in string format to be output […]

Jul
17
2011

ExpressionEngine Vs. WordPress

Expressionengine VS Wordpress

Update: detailed instructions and a full script for migrating from EE to WP may now be found here. For nine months now, I’ve been working with ExpressionEngine (EE) for one of my employers websites.  Originally, I was very hesitant to make the dive into yet another content management system, and after 9 months- my hesitation was certainly merited! Expressionengine doesn’t specify that it lacks necessary functionality, it just makes it impossible to do whatever it […]

Jul
16
2011

Helpful MySQL Query Functions and Tips

In case you’re wondering, I don’t just spend a couple hours a week throwing random bits of code onto this blog- I spend anywhere between 60- 100 hours per week making code my bitch. But thousands of hours and millions of lines of code later, I’m still occasionally stuck trying to remember a query (but then again when you’ve got most of the MySQL manual embedded in your brain, the info becomes hard to sort […]

Pages:«1234»