This Unixtime Widget is for snippets that need to sort by a date provided in a TV. Please test these modifications. I have included a few lines before and after my changes so they will be easy to find.
tmplvars.format.inc.php
<?php
$grd->pagerClass =$params['pclass'];
$grd->pagerStyle =$params['pstyle'];
$o = $grd->render();
break;
/* Mark Kaplan unixtime modification */
case "unixtime":
$value = parseInput($value);
// Check for MySQL style date - Adam Crownoble 8/3/2005
$date_match = '^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$';
$matches= array();
if(strpos($value,'-')!==false && ereg($date_match, $value, $matches)) {
$timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]);
}
else { // If it's not a MySQL style date, then use strtotime to figure out the date
$timestamp = strtotime($value);
}
$o = $timestamp;
break;
/* END Mark Kaplan unixtime modification */
default:
$value = parseInput($value);
if($tvtype=='checkbox'||$tvtype=='listbox-multiple')
?>
mutate_tmplvars.dynamic.action.php
<option value="string" <?php echo ($content['display']=='string')? "selected='selected'":""; ?>>String Formatter</option>
<!-- Mark Kaplan unixtime modification -->
<option value="unixtime" <?php echo ($content['display']=='unixtime')? "selected='selected'":""; ?>>Unixtime</option>
<!-- END Mark Kaplan unixtime modification -->
</select>