Expression Engine DST/timezone settings - set it and forget it

Posted by kevin at 11:42pm EST on Friday, March 23, 2012

Every year around this time I have bizarre timezone issues with Expression Engine due to the daylight savings switch, regardless of how many updates I install or settings I change. Some of these issues (time creep, DST not being honored, etc.) have been caused by confirmed bugs in old versions, while others are simply due to the way localization settings are hidden in 5 different places (that I know of) - the config.php file, localization preferences, member preferences, member profiles, and individual entries.

Luckily, those of us who don’t care about honoring member localization settings can simply add a few lines to the config.php file to hard code EE’s settings to match the current server time without ever having to mess with it again.

Simply add these lines to your config.php file. Settings in this file completely override anything else you have set up through the control panel. Be sure to edit it to represent your server’s localization info where appropriate.

$config['server_timezone''UM5'// (UTC - 5:00) Eastern Time, Bogota, Lima, Quito
$config['default_site_timezone''UM5';
$config['time_format''us'// us or eu
$config['server_offset'''// never use this to adjust things more than a few minutes in either direction
$config['daylight_savings'date('I') ? 'y' 'n'// dynamically match your server's DST setting
$config['default_site_dst'date('I') ? 'y' 'n';
$config['honor_entry_dst''n'// per-entry DST settings are often wrong due to bugs in previous versions of EE 

Note: See the table on http://codeigniter.com/user_guide/helpers/date_helper.html to find your timezone reference

Huge thanks to Ryan Masuga of Masuga Web Design for posting these settings on the official forums last August. I’m just sorry I didn’t find the post until now.

0 Comments

Quick Review: Dante’s Inferno (PS3/XBOX 360)

Posted by kevin at 4:08pm EST on Saturday, January 22, 2011

Dante's Inferno Divine Edition cover (PS3)Just played through Dante’s Inferno on the PS3. Here are my thoughts….

If you’ve played through all the God of War games and need another fix, Dante’s Inferno is a good alternative to playing through them again. If you only own an XBOX 360, this is pretty much the closest you’ll get to God of War.

The good - Interesting boss battles, good story/cutscenes, great voice acting.

The bad - Puzzles are so simple you have to wonder why they even bothered including them. Lots of cheap deaths; platforming jumps are trial and error with a level of unavoidable carnage mixed in that may lead some players to ragequit. Skill trees lack variation and certain skills are vastly overpowered (getting health for every cross kill makes the last few rings extremely easy for holy players).

tl;dr - Not mind-blowing, but certainly worth a rent and it only takes 7 or 8 hours to finish.

continue reading »

0 Comments

Fix: Expression Engine Twitter Timeline plugin not showing retweets

Posted by kevin at 5:21pm EST on Friday, January 14, 2011

I use the Twitter Timeline plugin on my Expression Engine site, Nippon Cinema, and I just noticed it wasn’t showing retweets.

The problem is the current version of the plugin (1.42) doesn’t use the “include_rts” url parameter from Twitter’s new API.

Easy fix!

Should be 2 small edits, beginning with an additional line in the “// Fetch parameters” section of pi.twitter_timeline.php

Keep in mind, fetching parameters has changed slightly in EE 2.

1.X:

$include_rts $TMPL->fetch_param('include_rts'); 

2.X:

$include_rts $this->EE->TMPL->fetch_param('include_rts'); 

Then find:

if ($screen_name)
{
    $timeline    
'user';
    
$log_extra    "For User {$screen_name}";
            
    
$this->parameters['screen_name'$screen_name;

Add this just below it:

if ($include_rts)
{
    $this
->parameters['include_rts'$include_rts;

Now you can add include_rts="true" to your twitter timeline tag to show retweets or leave it out to hide them.

0 Comments

Canon LiDE50 scanner on Windows 7 64-bit (minus WIA support)

Posted by kevin at 7:37pm EST on Saturday, January 8, 2011

Gotta love when you go through hell troubleshooting a problem in Windows, only to have to repeat the entire process the next time you reinstall. What I wouldn’t give for Marilu Henner’s autobiographical memory. This time I’m keeping notes!

The problem: Canon did not provide any Windows 7 drivers for their LiDE50 scanner. They’d prefer you just throw your old scanner in a landfill and buy a new model. Sorry, corporate overlords; I don’t plan on forking over another 80 bucks for a piece of hardware I use maybe twice a year.

Don’t bother trying to install the drivers that came bundled with Windows 7 (Canon Inc. -> CanoScan LiDE 500f). These are “close but no cigar”. The best you can hope for is your scanner lights up and makes just enough of an effort to move that you’ll think it’s mechanically broken. It’s not.

A Google search will invariably lead you to this link -> http://www.webwhitenoise.com/item/2009/05/canon-canoscan-lide-50-x64-drivers/

These modified drivers seem to work great for the poster and many of the commenters without a hitch. However, I’m still banging my head against the wall thanks to this error:

You need a WIA driver to use this device. Please install it from the installation CD or manufacturer's website and try again.

What does that mean exactly? I guess it means you need to use third-party Twain-friendly scanning software to make any use of your crappy old LiDE50. Thankfully, that’s one thing Canon does provide. Go here and download CanoScan Toolbox Ver. 4.1.3.6 from the Software section under Windows XP. Yes, it’s an ancient version of 32-bit software—but it works. I can now set up the CanoScan Toolbox software to scan something and then send the resulting file directly to Photoshop for editing.

It’s not ideal, but it sure beats replacing a perfectly functional scanner or installing a virtual machine.

0 Comments

cron oddity on Ubuntu

Posted by kevin at 7:11am EST on Sunday, December 12, 2010

I could not for the life of me figure out why my cron.daily scripts were not running after upgrading to Ubuntu 10.04. I tried everything from setting up a crontab as root to double and triple checking the syntax of my scripts, but nothing seemed to get cron to run them without manual intervention. Then I found this ancient thread on the Ubuntu forums. Apparently Ubuntu defaults to using cron for hourly scripts, but Anacron for the daily and weekly ones. This setup is perfect for desktop users who are likely to turn their systems on and off a lot, but it’s awful for servers that are always on. Anacron has a tendency to shut off when it sees it has nothing to do and then never come back up again. Fortunately, the solution is incredibly simple. You just need to add a script to cron.hourly that restarts Anacron—then Anacron will handle the rest itself.

The script can be as simple as:

#!/bin/sh
/usr/sbin/anacron -

Stick that in your /etc/cron.hourly directory, make it executable with “chmod +x filename”, and you’re good to go. If you’re wondering, the -s parameter makes Anacron run your scripts one at a time (serially).

0 Comments