From: Jason Woofenden Date: Thu, 13 Nov 2008 13:29:11 +0000 (-0500) Subject: metaform: fixed SQL for decimal and other weird numeric types X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=185eecff52ed662395ac4846bd7ec579b26a2880 metaform: fixed SQL for decimal and other weird numeric types --- diff --git a/metaform.php b/metaform.php index f7a5740..e9c73ec 100644 --- a/metaform.php +++ b/metaform.php @@ -170,7 +170,7 @@ function make_sql() { if($sql != 'n/a') { $tem->set('name', $name); $tem->set('type', $sql); - if($sql == 'int') { + if(substr($sql, 0, 3) == 'int' || substr($sql, 0, 7) == 'decimal') { $tem->set('default', '0'); } elseif($format == 'yesno') { $tem->set('default', '"No"'); diff --git a/metaform/template.php b/metaform/template.php index a0b657f..7697c48 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -88,6 +88,8 @@ function ~form_name~_main() { if($ret) { return $ret; } + + # sections displayed with tem_show() will be coppied to the main template if you have one. tem_show('main_body'); }