From 0d61a4fa457da36b18d40f3b1003daab1aea2d77 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 13 Sep 2010 22:22:37 +0200 Subject: [PATCH] Require image when creating new concert. --- inside/Concert.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inside/Concert.php b/inside/Concert.php index d51c932..75e6bc4 100644 --- a/inside/Concert.php +++ b/inside/Concert.php @@ -69,7 +69,7 @@ class Concert { rename_file($temp_name, $this->id, "program"); $this->picture = $this->id.substr($temp_name, -4); } else { - $this->picture = $data['picture'];; + $this->picture = $data['picture']; } $this->links = $data['links']; }else {//RETRIEVE @@ -248,15 +248,19 @@ class Concert { function _validate(){ $valid = true; if($this->name == '') { - notify("Tittel må angis."); + notify("Tittel må angis."); $valid = false; } if($this->intro == '') { - notify("Ingress må angis."); + notify("Ingress må angis."); $valid = false; } if (date("Y", strtotime($this->time)) < 2000){ - notify("Ugyldig årstall."); + notify("Ugyldig årstall."); + $valid = false; + } + if ($this->id == NULL && isset($_FILES['userfile']) && empty($_FILES['userfile']['name'])){ + notify("Bilde må velges"); $valid = false; } return $valid;