Joomla PHP Template Logic
Something somewhat confusing is the comparison to of each $footer# to the string '0' then later comparing it to greater than integer 0.  This is practically the definition of weakly typed languages.  If you know what $footer# variables actually contain you might be able to simplify this, but here is a fully functioning replacement to the first code block.

One could simplify this a bit, but the core concepts are there.  '0' casts to False, and True casts to 1.  There are plenty of other ways to accomplish the same thing, especially if you have significantly more incoming $footer#'s, or if they are stored in something iteratable like an array.  

//$footer1 = '10';
//$footer2 = '-5';
//$footer3 = '0';

$footer1Bool = (bool) $footer1;
$footer2Bool = (bool) $footer2;
$footer3Bool = (bool) $footer3;

$footer1Int = (int) $footer1Bool;
$footer2Int = (int) $footer2Bool;
$footer3Int = (int) $footer3Bool;

$footerCombined = $footer1Int + $footer2Int + $footer3Int;

if ( $footerCombined &gt;= 3 ) {
    $footerWidth = 'one_third';
} else if ( $footerCombined == 2 ) {
    $footerWidth = 'one_half';
} else {
    $footerWidth = 'full';
}