diff --git a/public/categorySummary.php b/public/categorySummary.php new file mode 100644 index 0000000..7d6b398 --- /dev/null +++ b/public/categorySummary.php @@ -0,0 +1,62 @@ +query("NotiziaModel", + array('$and'=>array(array("status"=>NotiziaModel::STATUS_ACCEPTED),array("category"=>$category))), + array("sort"=>array("about.data"=>-1),"limit"=>10) + ); + } + else{ + GUIHandler::redirect("index.php"); + } + + +}catch(GUIException $ex){ + $error = $ex->getMessage(); +}catch (Exception $exec){ + $msg = LogModel::fromException($exec); + GlobalVariables::get("dao")->save($msg); + + GUIHandler::redirect("index.php"); +} +?> +
+ +
+ titolo) > 103) ? substr($notizia->titolo,0,100).'...' : $notizia->titolo; + $stringSottotitolo = (strlen($notizia->sottotitolo) > 73) ? substr($notizia->sottotitolo,0,70).'...' : $notizia->sottotitolo; + $stringTesto = (strlen($notizia->testo) > 33) ? substr($notizia->testo,0,30).'...' : $notizia->testo; + $media = DaoMediaHandler::getMainMediaFromModel($notizia); + ?> +
+
renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?>
+
+
+
+
+
+
+ +
+
+ + +
\ No newline at end of file diff --git a/public/js/functions.js b/public/js/functions.js index dcda619..f21e087 100644 --- a/public/js/functions.js +++ b/public/js/functions.js @@ -28,16 +28,17 @@ function openRegistrationModal(){ } function sendRegistration(){ - $.ajax({ - method:'POST', - url:'sendRegistrationBackend.php', - dataType:'html', - data:$("#regForm").serialize(), - success: function(data){ - - }, - error:function(data){ - $(".modalError").html(data); - } - }); -} \ No newline at end of file + $.ajax({ + method:'POST', + url:'sendRegistrationBackend.php', + dataType:'html', + data:$('#regForm').serialize(), + success: function(data){ +// $("#regForm").remove(); + $(".modalResponse").html(data); + /* Verificare se si possa eliminare la form in caso di registrazione avvenuta con successo assegnando un parametro + * allo span di avvenuta registrazione*/ +// $(".modalError").html(""); + } + }); +} \ No newline at end of file diff --git a/public/registration.php b/public/registration.php index 090a0c8..1b59bcb 100644 --- a/public/registration.php +++ b/public/registration.php @@ -4,43 +4,23 @@ require_once(dirname(__FILE__)."/load.php"); try { ?> -
x
+
x
-
+
Email:
Username:
Password:
Conferma password:
Vuoi iscriverti alla newsletter?
+
-
Registrami
+ save($msg); } -echo "zzzzzzzzzzzzzzzzzzzzzz"; -?> - \ No newline at end of file +// echo "zzzzzzzzzzzzzzzzzzzzzz"; +?> \ No newline at end of file diff --git a/public/sendRegistrationBackend.php b/public/sendRegistrationBackend.php index 618171b..f7481b4 100644 --- a/public/sendRegistrationBackend.php +++ b/public/sendRegistrationBackend.php @@ -13,24 +13,39 @@ try { } - echo "invitao "; - if(strcmp($pass, $confPass)==0){ -// GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); -// GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email)); -// GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); - $user = new stdClass(); - $user->email = $email; - $user->password = sha1($pass); - $user->username = $userName; - $user->newsletter = $newsletter; - - - $userModel = new UserModel($user); -// GlobalVariables::get("dao")->save($userModel); - echo "salvataggio riuscito"; + $notEmail = GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email)); + $notUser = GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); + + if(is_null($notEmail) || strcmp($email, $notEmail)!=0){ + if(is_null($notUser) || strcmp($userName, $notUser)!=0){ + if(strcmp($pass, $confPass)==0){ + + // GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); + // GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email)); + // GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); + $user = new stdClass(); + $user->email = $email; + $user->password = sha1($pass); + $user->username = $userName; + $user->newsletter = $newsletter; + + + $userModel = new UserModel($user); + // GlobalVariables::get("dao")->save($userModel); + echo 'Registrazione avvenuta con successo.A breve riceverai una mail per confermare la tua registrazione'; + } + else{ +// trigger_error("Le due password non coincidono (trigger)"); + echo 'Le due password non coincidono'; + } + } + else{ + + echo 'Questo username è già in uso da un altro utente.'; + } } else{ - echo "Le due password non coincidono"; + echo 'Questa email risulta già in utilizzo.'; } }catch(Exception $exec){ diff --git a/public/style/public.css b/public/style/public.css index 8fef4cc..095dca9 100644 --- a/public/style/public.css +++ b/public/style/public.css @@ -87,7 +87,7 @@ body{font-family:lato, arial;} */ #floating{ - background-color:green; + background-color:#ceecf4; z-index:4; padding:5px 10px; } @@ -98,7 +98,8 @@ body{font-family:lato, arial;} .close{vertical-align:top;color:white;} .modalBody{text-align:right;} -.modalError{text-algin:center;color:red;font-weight:bold;} +.regMe{text-align:left;} +.modalResponse{text-align:center;color:aqua;font-weight:bold;} #modalBlock{}/* margin-left:auto; margin-right:auto; @@ -321,3 +322,12 @@ body{font-family:lato, arial;} .rotoBanner{} .reader{} .notRotoBanner{} + + + + + +.categorySummaryContainer{width:600px;padding:5px 10px;vertical-align:top;} +.notiziaContainer > .notiziaImage{display:inline-block;} +.notiziaContainer > .notiziaInfo{display:inline-block;width:430px;padding:10px;} +.summaryRightBar{width:300px;padding:5px;vertical-align:top;} \ No newline at end of file