rese tutte le paggine dei fatti di napoli adate al mobile

This commit is contained in:
Lorenzo Giacomelli
2016-05-19 19:02:34 +02:00
parent d959fe76a4
commit 94df8a1e98
15 changed files with 1123 additions and 52 deletions
+48 -23
View File
@@ -201,7 +201,16 @@ class GUIHandlerMobile {
<div class="logo"><a href="http://ifattidinapoli.com/mobile/index.php"><img src="images/logo_uff.png" /></a></div>
<div class="bottomBar">
<img id="menuMobile" alt="" src="images/menuIcon.png">
<?php
if(!UserLoginManager::isLogged()){
?>
<img id="loginMobile" alt="" src="images/loginIcon.png">
<?php
}
else{
echo "<span style=\"display:inline-block;vertical-align:top;padding:5px 10px;\">".UserLoginManager::getLogged()->nome." ".UserLoginManager::getLogged()->cognome." (<a href=\"javascript:logout();\">logout</a>)</span>";
}
?>
</div>
</div>
@@ -233,12 +242,7 @@ class GUIHandlerMobile {
<?php
}
}
?>
<!-- <div class="menuTab"> -->
<!-- TUTTE LE SEZIONI -->
<!-- <ul> -->
<?php
foreach(NotiziaModel::$NOTIZIE_CATEGORY as $category=>$data){
foreach(NotiziaModel::$NOTIZIE_CATEGORY as $category=>$data){
if(!$data["mainMenu"] && !$data["hidden"]){
?>
<div class="menuTab"><a href="categorySummary.php?category=<?php echo $category;?>"><?php echo strtoupper($data["label"]);?></a></div>
@@ -249,25 +253,18 @@ class GUIHandlerMobile {
<!-- </ul> -->
</div>
</div>
<div class="loginContainer">
<div class="menuHead">
<img id="closeLogin" alt="" src="images/menuIconTransparent.png"/>
</div>
<div class="loginReg">
<div class="loginData">
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(event){
$("#menuable").click(function(){
if($(".hiddenMenu").hasClass("open")){
$(".hiddenMenu").fadeOut().removeClass("open");
}
else{
$(".hiddenMenu").fadeIn().addClass("open");
}
});
$(".hiddenMenu").mouseleave(function(){
if($(".hiddenMenu").hasClass("open")){
$(".hiddenMenu").fadeOut().removeClass("open");
}
});
$("#sendFormGlass").click(function (){
$("#searchForm").submit();
});
@@ -302,6 +299,34 @@ class GUIHandlerMobile {
$("#closeMenu").click(function (){
$(".menuContainer").trigger("close");
});
/*LOGIN MENU*/
$(".loginContainer").bind("open",function(){
if(!$(this).hasClass("open")){
$(this).animate({
"margin-left":"0vw"
},700).addClass("open");
$("body").css({"position":"fixed"});
}
}).bind("close",function (){
if($(this).hasClass("open")){
$(this).animate({
"margin-left":"100vw"
},700).removeClass("open");
$("body").css({"position":"static"})
}
});
$("#loginMobile").click(function (){
openLogin();
$(".loginContainer").trigger("open");
});
$("#closeLogin").click(function (){
$(".loginContainer").trigger("close");
});
});
</script>
+9 -7
View File
@@ -6,7 +6,7 @@ Creation Date: 13/gen/2016
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_ADMIN, "normalize.css");
GUIHandlerMobile::addStylesheet(GUIHandler::STYLESHEET_USER, "normalize.css");
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "normalize.css");
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_ADMIN, "jquery-ui.css");
@@ -24,13 +24,13 @@ GUIHandler::addStylesheet(GUIHandler::STYLESHEET_USER, "photoswipe.css");
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_USER, "default-skin.css");
GUIHandlerMobile::addStylesheet(GUIHandler::STYLESHEET_USER, "photoswipe.css");
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "photoswipe.css");
GUIHandlerMobile::addStylesheet(GUIHandler::STYLESHEET_USER, "default-skin.css");
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "default-skin.css");
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL, "jquery-1.12.0.min.js");
GUIHandlerMobile::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL, "jquery-1.12.0.min.js");
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_GENERAL, "jquery-1.12.0.min.js");
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_ADMIN, "jquery-ui.min.js");
@@ -52,13 +52,15 @@ GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"highcharts.js");
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"functions.js?rev=".time());
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_GENERAL,"functions.js?rev=".time());
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe.min.js");
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe-ui-default.min.js");
GUIHandlerMobile::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe.min.js");
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_USER,"photoswipe.min.js");
GUIHandlerMobile::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe-ui-default.min.js");
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_USER,"photoswipe-ui-default.min.js");
/*
____ _ _ ____ _ ___ ____
| _ \| | | | __ )| | |_ _/ ___|
@@ -69,5 +71,5 @@ GUIHandlerMobile::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe-ui-de
*/
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_USER, "public.css?rev=".time());
GUIHandlerMobile::addStylesheet(GUIHandler::STYLESHEET_USER, "public.css?rev=".time());
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "public.css?rev=".time());
?>
+2 -9
View File
@@ -152,19 +152,12 @@ try {
?>
<div class="notiziaContainer">
<div class="notiziaImage mediaContent"><?php (!is_null($media))?$media->renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?></div>
<div id="notizia_<?php echo $i;?>" class="notiziaInfo">
<a href="articolo.php?id=<?php echo $notizia->id;?>" id="notizia_<?php echo $i;?>" class="notiziaInfo">
<div class="notiziaTitolo"><?php echo $stringTitolo;?></div>
<div class="notiziaSottotitolo"><?php echo$stringSottotitolo;?></div>
<div class="notiziaTesto"><?php echo $stringTesto;?></div>
</div>
</a>
</div>
<script type="text/javascript">
$(document).ready(function(event){
$("#notizia_<?php echo $i;?>").click(function(event){
window.location.href="articolo.php?id=<?php echo $notizia->id;?>";
});
});
</script>
<?php
}
?>
+269
View File
@@ -0,0 +1,269 @@
<?php
require_once(dirname(__FILE__)."/../load.php");
try {
AnalyticsHelper::logPageImpression();
GUIHandlerMobile::generateHtmlHeaders();
$mesi = array(1=>'Gennaio', 'Febbraio', 'Marzo', 'Aprile',
'Maggio', 'Giugno', 'Luglio', 'Agosto',
'Settembre', 'Ottobre', 'Novembre','Dicembre');
$currentYear=date("Y");
$post=false;
$found = false;
$day = "";
$month= "";
$year = "";
if(array_key_exists("submit", $_POST) && strcmp($_POST["submit"], "Invia")==0){
$post = true;
$day = $_POST["day"];
$month= $_POST["month"];
$year = $_POST["year"];
$limit=10;
$page = 1;
$numPages = 1;
if(array_key_exists("page", $_POST)){
$page = intval($_POST["page"]);
}
$skip =($page - 1) * $limit;
// var_dump($skip);
$dateString = $_POST["year"]."-".$_POST["month"]."-".$_POST["day"];
$notizieDateAll = GlobalVariables::get("dao")->count("NotiziaModel",
array("status"=>NotiziaModel::STATUS_ACCEPTED,"about.data"=>array('$gt'=>new MongoDate(strtotime($dateString)),
'$lt'=>new MongoDate(strtotime($dateString." +1 day"))))
);
if($notizieDateAll>0){
// $dim = count($notizieDateAll);
$numPages = ceil($notizieDateAll/$limit);
$found = true;
}
else{
$found = false;
}
$notizieDate = GlobalVariables::get("dao")->query("NotiziaModel",
array("status"=>NotiziaModel::STATUS_ACCEPTED, "about.data"=>array('$gt'=>new MongoDate(strtotime($dateString)),
'$lt'=>new MongoDate(strtotime($dateString." +1 day")))),
array("limit"=>$limit,"skip"=>$skip)
);
if (sizeof($notizieDate)>0){
$found=true;
$notizieDate = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $notizieDate);
}
// var_dump($notizieDate);
}
}catch(GUIException $ex){
$error = $ex->getMessage();
}catch (Exception $exec){
$msg = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($msg);
GUIHandlerMobile::redirect("index.php");
}
?>
<?php
GUIHandlerMobile::generateHeadPublic();
GUIHandlerMobile::generateMenu();?>
<div style="margin-top:32vw;width:100vw;margin-left:auto;margin-right:auto;min-height:40vh;">
<div class="archivioDate">
<form method="POST" id="formData">
<select name="day">
<?php
for($i=1;$i<=31;$i++){
if($post && ($i == intval($day))){
?>
<option value="<?php echo $i;?>" selected><?php echo $i;?></option>
<?php }
else{
?>
<option value="<?php echo $i;?>"><?php echo $i;?></option>
<?php
}
}
?>
</select>
<select name="month">
<?php
foreach ($mesi as $key=>$value){
if($post && ($key == intval($month))){
?>
<option value="<?php echo $key;?>" selected><?php echo $value;?></option>
<?php }
else{
?>
<option value="<?php echo $key;?>"><?php echo $value;?></option>
<?php
}
}
?>
</select>
<select name="year">
<?php
for($i=2009;$i<=$currentYear;$i++){
if($post && ($i == intval($year))){
?>
<option value="<?php echo $i;?>" selected><?php echo $i;?></option>
<?php }
else{
?>
<option value="<?php echo $i;?>"><?php echo $i;?></option>
<?php
}
}
?>
</select>
<input id ="pageSend" type="hidden" name="page" value="1" />
<input id="sendForm" type="submit" name="submit" value="Invia" />
</form>
</div>
<div class="archivioResults">
<?php if(!$post){
?>
<div>Selezionate una data per la ricerca, e premere il tasto Invia.</div>
<?php
}
else{
if ($found){
$i=0;
foreach ($notizieDate as $notizia){
$i++;
$stringTitolo = (strlen($notizia->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);
?>
<div class="notiziaContainer">
<div class="notiziaImage mediaContent"><?php (!is_null($media))?$media->renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?></div>
<a href="articolo.php?id=<?php echo $notizia->id;?>" id="notizia_<?php echo $i;?>" class="notiziaInfo">
<div class="notiziaTitolo"><?php echo $stringTitolo;?></div>
<div class="notiziaSottotitolo"><?php echo$stringSottotitolo;?></div>
<div class="notiziaTesto"><?php echo $stringTesto;?></div>
</a>
</div>
<?php
}
?>
<div class="paging">
<?php
if($page-2>1){
?>
<div id ="page_first" class="page">
Inizio
</div>
<div class="page noSelection">...</div>
<script type="text/javascript">
$(document).ready(function(){
$("#page_first").click(function(){
$("input#pageSend").val('1');
$("input#sendForm").click();
});
});
</script>
<?php
}
$j = 1;
$last = $page +2;
if($page-2<1){
if($page-1 == 1){
$j=$page-1;
}
else{
$j = $page;
}
}
else{
$j = $page - 2;
}
if($page+2 >$numPages){
// $j=page-2;
if($page +1 == $numPages){
$last = $page+1;;
}
else{
$last = $page;
}
}
for($j;$j<=$last;$j++){
if($j == $page){
?>
<div id ="page_<?php echo $j;?>" class="page current" >
<?php echo $j;?>
</div>
<?php
}
else{
?>
<div id ="page_<?php echo $j;?>" class="page" >
<?php echo $j;?>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#page_<?php echo $j;?>").click(function(){
$("input#pageSend").val(<?php echo $j;?>);
$("input#sendForm").click();
});
});
</script>
<?php
}
}
if($page+2<$numPages){
?>
<div class="page noSelection">...</div>
<div id ="page_last" class="page">
Ultima (<?php echo $numPages;?>)
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#page_last").click(function(){
$("input#pageSend").val('<?php echo $numPages;?>');
$("input#sendForm").click();
});
});
</script>
<?php
}
?>
<!-- <input id="pageSend" type="hidden" name="page" form="changePage"/> -->
<!-- </form> -->
</div>
<?php
}
else{
?>
<div style="color:red;">Nessun articolo trovato nella data selezionata.</div>
<?php
}
}
?>
</div>
<?php
GUIHandlerMobile::generateFooter();
GUIHandlerMobile::generateGoogleAnalyticsScripts();
?>
</div>
+77
View File
@@ -0,0 +1,77 @@
<?php
require_once(dirname(__FILE__)."/../load.php");
try{
AnalyticsHelper::logPageImpression();
GUIHandlerMobile::generateHtmlHeaders(array("title"=>NotiziaModel::$NOTIZIE_CATEGORY[$_GET["category"]]["label"]));
$category = "";
if(array_key_exists("category", $_GET) && strcmp($_GET["category"], "")!=0){
// var_dump(NotiziaModel::$NOTIZIE_CATEGORY[intval($_GET["category"])]["hidden"]);
if(NotiziaModel::$NOTIZIE_CATEGORY[$_GET["category"]]["hidden"]){
GUIHandlerMobile::redirect("index.php");
}
$category = $_GET["category"];
// $category = NotiziaModel::CATEGORY_CRONACA;
$category = intval($category);
$notizie = GlobalVariables::get("dao")->query("NotiziaModel",
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>$category,"about.data"=>array('$lte'=>new MongoDate())),
array("sort"=>array("about.data"=>-1),"limit"=>10)
);
if (sizeof($notizie)>0){
$notizie = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $notizie);
}
}
else{
GUIHandlerMobile::redirect("index.php");
}
}catch(GUIException $ex){
$error = $ex->getMessage();
}catch (Exception $exec){
$msg = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($msg);
GUIHandlerMobile::redirect("index.php");
}
?>
<div style="margin-top:32vw;width:100vw;margin-left:auto;margin-right:auto;">
<?php
GUIHandlerMobile::generateHeadPublic($category);
GUIHandlerMobile::generateMenu();?>
<div class="categorySummaryContainer">
<?php $i=0;
foreach ($notizie as $notizia){
$i++;
$stringTitolo = (strlen($notizia->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);
?>
<div class="notiziaContainer">
<div class="notiziaImage mediaContent"><?php (!is_null($media))?$media->renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?></div>
<a href="articolo.php?id=<?php echo $notizia->id;?>" id="notizia_<?php echo $i;?>" class="notiziaInfo">
<div class="notiziaTitolo"><?php echo $stringTitolo;?></div>
<div class="notiziaSottotitolo"><?php echo$stringSottotitolo;?></div>
<div class="notiziaTesto"><?php echo $stringTesto;?></div>
</a>
</div>
<?php
}
?>
</div>
<?php
GUIHandlerMobile::generateFooter();
GUIHandlerMobile::generateGoogleAnalyticsScripts();
?>
</div>
Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

+79
View File
@@ -0,0 +1,79 @@
function openPagePost(page, request, blank){
var blank = typeof blank !== 'undefined' ? blank : false;
var inputs = '';
request.forEach(function(element, index, array){
inputs += '<input type="hidden" name="'+element.name+'" value="'+element.value+'" />';
});
$('<form '+(blank?'target="_blank" ':"")+'method="POST" action="'+page+'">'+inputs+'</form>').appendTo("body").submit();
}
function bannerClick(banner, link){
$.ajax({url: "stats/bannerClick.php", method: "POST", data: { "banner": banner, "source": window.location.href }, dataType: "html" });
window.open(link);
}
function openRegistration(){
$.ajax({
method:"POST",
url:'registrationMobile.php',
dataType:'html',
success: function(data){
$(".loginData").html(data);
}
});
}
function openLogin(){
$.ajax({
method:"POST",
url:'loginMobile.php',
dataType:'html',
success: function(data){
$(".loginData").html(data);
}
});
}
function logout(){
$.ajax({
method:"POST",
url:'logoutMobile.php',
dataType:'html',
success: function(data){
location.reload();
}
});
}
function bannerRoll(prev,pos,category){
$.ajax({
method:"POST",
url:'getBanner.php?replaced='+prev+'&pos='+pos+'&cat='+category,
dataType:'html',
success: function(data){
$('#'+prev).parent().html(data);
}
});
}
function previewImage(imageSrc){
$('.clickableImageContainer').html('<img id ="clickImage" src="'+ imageSrc +'" />');
$('.imageOverlay').css("display","block");
$('.clickableImageContainer').css("display","block");
}
function hidePreview(){
$('.imageOverlay').css("display","none");
$('.clickableImageContainer').css("display","none");
$('#clickImage').remove();
}
function printNews(newsId){
// $.ajax({
// method:"POST",
// url:'printPage.php?id='+ newsId,
// dataType:'html',
//
// });
openPagePost("printPage.php",[{name:'id',value:newsId}],true);
}
+73
View File
@@ -0,0 +1,73 @@
<?php
/*
Author: Riccardo Di Dato
Creation Date: 11/mar/2016
*/
require_once(dirname(__FILE__)."/../load.php");
try {
$username = "";
$msg = "";
$action = PostHandler::get("action");
if (!is_null($action) && strcmp($action, "login")==0){
$username = PostHandler::get("username");
$pass = PostHandler::get("password");
$msg = "Username o password errati";
if (!is_null($username) && strcmp($username,"")!=0 && !is_null($pass) && strcmp($pass,"")!=0){
if (UserLoginManager::login($username, $pass)){
GUIHandler::pageReload();
}
}
}
}catch(GUIException $ex){
$msg = $ex->getMessage();
$err = true;
}catch (Exception $exec){
$msg = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($msg);
}
?>
<div class="modalBody">
<div class="title" style="padding: 5px;">Inserisci i tuoi dati per accedere</div>
<div style="color:red; text-align:center;"><?php echo $msg;?></div>
<form id="logForm">
<input type="hidden" name="action" value=""/>
<div><input placeholder="USERNAME" type="text" name="username" value="<?php echo $username;?>"/></div>
<div><input placeholder="PASSWORD" type="password" name="password" value="" /></div>
<div class="btn"><a class="btn" id="loginBtn" href="javascript:void(0);">Accedi</a></div>
</form>
<div style="font-size: 10pt;padding:10px;"><a id="passForgot" style="color:rgb(0, 133, 185);" href="javascript:void(0);">Password Dimenticata?</a></div>
<div style="font-size: 10pt; padding:10px;text-align:center;">Non sei ancora registrato? <br/><a id="alreadyReg" style="display:inline-block;padding:5px;color:rgb(0, 133, 185);" href="javascript:openRegistration();">Registrati</a></div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#loginBtn").click(function () {
$("#logForm input[name=action]").val("login");
$.ajax({
method:"POST",
url:'loginMobile.php',
data:$("#logForm").serialize(),
success: function(data){
$(".loginData").html(data);
}
});
});
$('#logForm input[name=password]').keypress(function(event) {
if (event.which==13){
$("#loginBtn").click();
return false;
}
});
$("#passForgot").click(function () {
$(".loginData").load("passwordForgotMobile.php");
});
});
</script>
+13
View File
@@ -0,0 +1,13 @@
<?php
/*
Author: Riccardo Di Dato
Creation Date: 16/mar/2016
*/
require_once(dirname(__FILE__)."/../load.php");
if (UserLoginManager::isLogged()){
UserLoginManager::logout();
}
?>
+98
View File
@@ -0,0 +1,98 @@
<?php
/*
Author: Riccardo Di Dato
Creation Date: 16/mar/2016
*/
require_once(dirname(__FILE__)."/../load.php");
try {
$sent = false;
$msg = "";
$action = PostHandler::get("action");
$email = "";
if (!is_null($action) && strcmp($action, "recover")==0){
$email = trim(PostHandler::get("email"));
$user = GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email)); // WTF!?!?!
if (is_null($user)){
$msg = "Email non valida";
}
else {
$sent = true;
$oldOne = GlobalVariables::get("dao")->getFirst("PasswordRecoveryRequestModel",array("target.class"=>"UserModel","target.id"=>$user->id));
if (!is_null($oldOne)){
GlobalVariables::get("dao")->delete($oldOne);
}
$request = PasswordRecoveryRequestModel::fromModel($user);
GlobalVariables::get("dao")->save($request);
// $mail = FDN_MailHelper::getUserPasswordResetMail($user);
// GlobalVariables::get("dao")->save($mail);
}
}
}catch(GUIException $ex){
$msg = $ex->getMessage();
$err = true;
}catch (Exception $exec){
$model = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($model);
$msg = "Si è verificato un errore inatteso durante l'operazione. Se il problema persiste contattaci comunicandoci il seguente codice <b>" . $model->getCode() . "</b>";
}
if ($sent){
if (strcmp("", $msg)!=0){
?>
<div style="color:red; text-align:center;"><?php echo $msg;?></div>
<?php
}
else {
?>
<div style="padding:2em;">A breve riceverai una email per modificare la password!</div>
<?php
}
}
else {
?>
<div class="modalBody">
<div class="title">Inserisci la tua email per recuperare i dati</div>
<div style="color:red; text-align:center;"><?php echo $msg;?></div>
<form id="recForm">
<input type="hidden" name="action" value=""/>
<div><input placeholder="EMAIL" type="text" name="email" value="<?php echo $email; ?>"/></div>
<div class="btn"><a class="btn" id="recoverBtn" href="javascript:void(0);">Richiedi</a></div>
</form>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#recoverBtn").click(function () {
$("#recForm input[name=action]").val("recover");
$.ajax({
method:"POST",
url:'passwordForgotMobile.php',
data:$("#recForm").serialize(),
success: function(data){
$(".loginData").html(data);
}
});
});
$('#recForm input[name=email]').keypress(function(event) {
if (event.which==13){
$("#recoverBtn").click();
return false;
}
});
});
</script>
<?php
}
?>
+42
View File
@@ -0,0 +1,42 @@
<?php
require_once(dirname(__FILE__)."/../load.php");
try {
AnalyticsHelper::logPageImpression();
GUIHandlerMobile::generateHtmlHeaders();
}catch(GUIException $ex){
$error = $ex->getMessage();
}catch (Exception $exec){
$msg = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($msg);
GUIHandlerMobile::redirect("index.php");
}
?>
<div style="margin-top:32vw;width:100vw;margin-left:auto;margin-right:auto;">
<?php
GUIHandlerMobile::generateHeadPublic();
GUIHandlerMobile::generateMenu();?>
<div class="contattiRedazione">
<div >GERENZA</div>
<img alt="" src="images/blueBalls.png">
<div><a href="www.ifattidinapoli.it">www.ifattidinapoli.it</a></div>
<img alt="" src="images/blueBalls.png">
<div >Direttore Responsabile</div>
<div style="font-weight:bold;color:black;">Antonio Pianelli</div>
<div style="font-weight:bold;color:red;font-size:12pt;">337848292</div>
<img alt="" src="images/blueBalls.png">
<div>info@ifattidinapoli.it</div>
<div style="font-weight:bold;padding:5px;font-size:10pt;color:black;">TESTATA REGISTRATA PRESSO IL TRIBUNALE DI NAPOLI AUT. NR. 8 DEL 27 GENNAIO 2006</div>
</div>
<?php
GUIHandlerMobile::generateFooter();
GUIHandlerMobile::generateGoogleAnalyticsScripts();
?>
</div>
+115
View File
@@ -0,0 +1,115 @@
<?php
require_once(dirname(__FILE__)."/../load.php");
try {
$msg = "";
$saved = false;
$action = PostHandler::get("action");
if (!is_null($action) && strcmp($action, "save")==0){
$obj = new stdClass();
$obj->nome = PostHandler::get("nome");
$obj->cognome = PostHandler::get("cognome");
// ANTICIPATI PER NON PERDERLI IN CASO DI ERRORE
$email = trim(PostHandler::get("email"));
$obj->email = $email;
$username = trim(PostHandler::get("username"));
$obj->username = $username;
if (is_null($email) || !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/",$email)){
throw new GUIException("L'email inserita non è in un formato valido ($email)");
}
if (GlobalVariables::get("dao")->count("UserModel",array("email",$email)) > 0 ){
throw new GUIException("L'email inserita è già in uso ($email)");
}
// Validate Username
if (is_null($username) || strcmp($username,"")==0){
throw new GUIException("Inserire un nome utente valido");
}
if (GlobalVariables::get("dao")->count("UserModel",array("username"=>$username ) ) > 0 ){
throw new GUIException("Il nome utente '".$username."' è già in uso");
}
$pass = trim(PostHandler::get("password"));
$passConf = trim(PostHandler::get("password_confirm"));
if (is_null($pass) || strcmp($pass,"")==0){
throw new GUIException("Inserire una password");
}
if (strcmp($pass,$passConf)!=0){
throw new GUIException("Le password inserite non coincidono");
}
$obj->password = sha1($pass);
$obj->newsletter = false;
$news = PostHandler::get("newsletter");
if (!is_null($news) && strcasecmp("true", $news)){
$obj->newsletter = true;
}
$user = new UserModel($obj);
GlobalVariables::get("dao")->save($user);
$saved = true;
}
}catch(GUIException $ex){
$msg = $ex->getMessage();
$err = true;
}catch (Exception $exec){
$msg = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($msg);
}
if ($saved){
?>
<div class="modalBody">
<p>La tua registrazione è quasi completa!</p>
<p>A breve riceverai un'email all'indirizzo <br/><span style="font-weight:bold;"><?php echo $user->email;?></span><br/> per completare la registrazione</p>
</div>
<?php
}
else {
?>
<div class="modalBody">
<form id="regForm">
<div class="title">Inserisci i tuoi dati per registrarti al sito.</div>
<div style="color:red; text-align:center;font-size:12pt;"><?php echo $msg;?></div>
<input type="hidden" name="action" value=""/>
<div><input placeholder="NOME" type="text" name="nome" value="<?php echo $obj->nome;?>" /></div>
<div><input placeholder="COGNOME" type="text" name="cognome" value="<?php echo $obj->cognome;?>" /></div>
<div><input placeholder="EMAIL" type="text" name="email" value="<?php echo $obj->email;?>" /></div>
<div><input placeholder="USERNAME" type="text" name="username" value="<?php echo $obj->username;?>"/></div>
<div><input placeholder="PASSWORD" type="password" name="password" value="" /></div>
<div><input placeholder="CONFERMA PASSWORD" type="password" name="password_confirm" value="" /></div>
<div style="font-size:12pt;">Vuoi iscriverti alla newsletter? <input type="checkbox" name="newsletter" value="true" checked /></div>
<div class="btn" ><a class="btn" id="regMe" href="javascript:void(0);">Registrami</a></div>
</form>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#regMe").click(function () {
$("#regForm input[name=action]").val("save");
$.ajax({
method:"POST",
url:'registrationMobile.php',
data:$("#regForm").serialize(),
success: function(data){
$(".loginData").html(data);
}
});
});
$('#regForm input[name=password_confirm]').keypress(function(event) {
if (event.which==13){
$("#regMe").click();
return false;
}
});
});
</script>
<?php
}
?>
+206
View File
@@ -0,0 +1,206 @@
<?php
require_once(dirname(__FILE__)."/../load.php");
try {
// AnalyticsHelper::logNotiziaImpression($articolo->id);
AnalyticsHelper::logPageImpression();
GUIHandlerMobile::generateHtmlHeaders();
$searchParameters = "";
if(array_key_exists("search", $_POST) && strcmp($_POST["search"], "")!=0){
// var_dump($_POST["search"]);
$searchParameters = strip_tags(PostHandler::get("search"));
$found = false;
$limit=10;
$page = 1;
$numPages = 1;
if(array_key_exists("page", $_POST)){
$page = intval($_POST["page"]);
}
$skip =($page - 1) * $limit;
$notizieAll = GlobalVariables::get("dao")->searchCount("NotiziaModel",$searchParameters,
array("status"=>NotiziaModel::STATUS_ACCEPTED)
);
// $notizieAll = GlobalVariables::get("dao")->query("NotiziaModel",
// array("status"=>NotiziaModel::STATUS_ACCEPTED)
// );
if($notizieAll>0){
// $dim = count($notizieAll);
$numPages = ceil($notizieAll/$limit);
$found = true;
}
else{
$found = false;
}
$notizie = GlobalVariables::get("dao")->search("NotiziaModel",$searchParameters,
array("status"=>NotiziaModel::STATUS_ACCEPTED),
array("sort"=>array("about.data"=>-1),"limit"=>$limit,"skip"=>$skip)
);
// $notizie = GlobalVariables::get("dao")->query("NotiziaModel",
// array("status"=>NotiziaModel::STATUS_ACCEPTED),
// array("sort"=>array("about.data"=>-1),"skip"=>$skip,"limit"=>$limit)
// );
if (sizeof($notizie)>0){
$found=true;
$notizie = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $notizie);
}
}
else{
GUIHandlerMobile::redirect("index.php");
}
}catch(GUIException $ex){
$error = $ex->getMessage();
}catch (Exception $exec){
$msg = LogModel::fromException($exec);
GlobalVariables::get("dao")->save($msg);
// GUIHandlerMobile::redirect("index.php");
}
?>
<div style="margin-top:32vw;width:100vw;margin-left:auto;margin-right:auto;min-height:40vh">
<?php
GUIHandlerMobile::generateHeadPublic();
GUIHandlerMobile::generateMenu();?>
<div class="searchResultsContainer">
<?php
if ($found){
$i=0;
foreach ($notizie as $notizia){
$i++;
$stringTitolo = (strlen($notizia->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);
?>
<div class="notiziaContainer">
<div class="notiziaImage mediaContent"><?php (!is_null($media))?$media->renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?></div>
<a href="articolo.php?id=<?php echo $notizia->id;?>" id="notizia_<?php echo $i;?>" class="notiziaInfo">
<div class="notiziaTitolo"><?php echo $stringTitolo;?></div>
<div class="notiziaSottotitolo"><?php echo$stringSottotitolo;?></div>
<div class="notiziaTesto"><?php echo $stringTesto;?></div>
</a>
</div>
<?php
}
?>
<div class="paging">
<form id="changePage" method="POST">
<input type="hidden" name ="search" value="<?php echo $searchParameters;?>">
<?php
if($page-2>1){
?>
<div id ="page_first" class="page">
Inizio
</div>
<div class="page noSelection">...</div>
<script type="text/javascript">
$(document).ready(function(){
$("#page_first").click(function(){
$("input#pageSend").val('1');
$("form#changePage").submit();
});
});
</script>
<?php
}
$j = 1;
$last = $page +2;
if($page-2<1){
if($page-1 == 1){
$j=$page-1;
}
else{
$j = $page;
}
}
else{
$j = $page - 2;
}
if($page+2 >$numPages){
if($page +1 == $numPages){
$last = $page+1;;
}
else{
$last = $page;
}
}
for($j;$j<=$last;$j++){
if($j == $page){
?>
<div id ="page_<?php echo $j;?>" class="page current" >
<?php echo $j;?>
</div>
<?php
}
else{
?>
<div id ="page_<?php echo $j;?>" class="page">
<?php echo $j;?>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#page_<?php echo $j;?>").click(function(){
$("input#pageSend").val(<?php echo $j;?>);
$("form#changePage").submit();
});
});
</script>
<?php
}
}
if($page+2<$numPages){
?>
<div class="page noSelection">...</div>
<div id ="page_last" class="page">
Ultima
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#page_last").click(function(){
$("input#pageSend").val('<?php echo $numPages;?>');
$("form#changePage").submit();
});
});
</script>
<?php
}
?>
<input id="pageSend" type="hidden" name="page" />
</form>
</div>
<?php
}
else{
?>
<div style="color:red;">Nessun articolo trovato con questi parametri di ricerca.</div>
<?php
}
?>
</div>
<?php
GUIHandlerMobile::generateFooter();
GUIHandlerMobile::generateGoogleAnalyticsScripts();
?>
</div>
+90 -4
View File
@@ -22,10 +22,12 @@ body{font-family:lato, arial;}
.bottomBar #loginMobile{border:0px;margin-left:1vw;}
.bottomBar img{width:2.2em;display:inline-block;}
.menuContainer{width:100vw;height:215vh;position:fixed;margin-left:-100vw;background-color:#333;z-index:100;overflow:scroll;top:0;}
.menuContainer{width:100vw;height:115vh;position:fixed;margin-left:-100vw;background-color:#333;z-index:100;overflow:scroll;top:0;}
.loginContainer{width:100vw;height:100vh;position:fixed;margin-left:100vw;background-color:#333;z-index:100;overflow:auto;top:0;}
.menuHead{text-align:right;overflow:auto;}
#closeMenu{height:2em;float:right;margin:0.3em 0.3em 0.3em 10px;}
#closeLogin,#closeMenu{height:2em;float:right;margin:0.3em 0.3em 0.3em 10px;}
#closeLogin{float:left;}
.searchBar{overflow:auto;height:2em;margin:0.3em 10px;}
.searchBar > div{font-size:14pt;position:relative;}
@@ -47,8 +49,9 @@ body{font-family:lato, arial;}
right: 0.3em;
}
.menuBar{font-weight:bold;color:white;/* background-color:#0069a3 */;height:200vh;padding-bottom:15vh;}
.menuTab{
.loginReg,.menuBar{font-weight:bold;color:white;/* background-color:#0069a3 */;}
.menuBar{height:100%;}
.menuTab{
font-size: 14pt;
font-family: "Bebas Neue";
border-radius: 5px 0px 0px 5px;
@@ -61,6 +64,26 @@ body{font-family:lato, arial;}
.menuTab > ul{margin:0;}
.menuTab > ul > li{width:60%;}
.loginData{
font-size: 14pt;
font-family: "Bebas Neue";
/* margin: 0px 5px 2px 10px; */
background-color: #222;
/* border-left: 5px solid #0069a3; */
padding:5px;
margin-top:5vh;
text-align:center;
}
.loginData a{color:white;}
.loginData .modalBody{padding:0 0 15px;}
.loginData .modalBody .title{padding:5px;}
.loginData .modalBody form div{padding:5px;}
.loginData .modalBody form input{padding:5px;}
.loginData .modalBody form div.btn{padding:0px;}
.loginData .modalBody form a.btn{padding:5px 15px;border:1px solid; border-radius:5px;display:inline-block;}
.footer{background-color:/* #095a87 */black;text-align:center;width:100vw;font-size:8pt;color:white;overflow:hidden;}
.footer .footerButton{text-align:center;margin-bottom:2vw;}
@@ -169,3 +192,66 @@ body{font-family:lato, arial;}
.newCommento div{padding:5px 0px;}
.newCommento textarea{}
.newCommento input{padding:5px 10px;}
/**
CATEGORY SUMMARY
*/
.notiziaContainer{padding:0 10px;}
.notiziaContainer div{display:inline-block;}
.notiziaContainer a{color:black;vertical-align:middle;display:inline-block;}
.notiziaContainer a div{display:block;}
.searchResultsContainer, .archivioResults, .categorySummaryContainer{width:100%;padding:5px 2vw 5px 0px;box-sizing:border-box;}
.searchResultsContainer > .notiziaContainer, .archivioResults > .notiziaContainer,
.categorySummaryContainer > .notiziaContainer{border:solid #d6d6d6 1px;margin-bottom:5px;padding:1vw;}
.notiziaContainer > .notiziaImage{display:inline-block;vertical-align:middle;text-align:center;max-width:40vw;}
.notiziaContainer .notiziaImage.mediaContent img{max-width:40vw;}
.notiziaContainer > .notiziaInfo{
display:inline-block;
width:50vw;
padding:2vw;
vertical-align:middle;
cursor:pointer;
text-decoration:none;
color:black;
font-size:10pt;
}
.notiziaInfo > .notiziaTitolo{font-weight:bold;padding:5px;}
.notiziaInfo > .notiziaSottotitolo{padding:5px;}
.notiziaInfo > .notiziaTesto{padding:5px;color:#1a9ee9;font-weight:bold;}
.archivioDate{padding:5px 0px;font-size:10pt;}
.archivioDate select, .archivioDate input{padding:2px 10px; margin:5px 5px 0px; border:solid #1a9ee9 1px;}
/*
____ _ _ _
| _ \ __ _ __ _(_)_ __ __ _| |_(_) ___ _ __
| |_) / _` |/ _` | | '_ \ / _` | __| |/ _ \| '_ \
| __/ (_| | (_| | | | | | (_| | |_| | (_) | | | |
|_| \__,_|\__, |_|_| |_|\__,_|\__|_|\___/|_| |_|
|___/
*/
.paging {padding:5px 0px;font-size:10pt;}
.paging .page{margin:0px 5px 0px 5px;display:inline-block;padding:5px 5px;background-color:#B7B7B7;cursor:pointer;}
.paging .page.noSelection{cursor:default;}
.paging .page.noSelection:hover{background-color:#B7B7B7;}
.paging .page.current{font-weight:bold;cursor:default;background-color:#d3d3d3;}
.paging .page:hover{background-color:#939393;}
.paging .page.current:hover{background-color:#d3d3d3;}
/*
____ _ _
| _ \ ___ __| | __ _ ___(_) ___ _ __ ___
| |_) / _ \/ _` |/ _` |_ / |/ _ \| '_ \ / _ \
| _ < __/ (_| | (_| |/ /| | (_) | | | | __/
|_| \_\___|\__,_|\__,_/___|_|\___/|_| |_|\___|
*/
.contattiRedazione{text-align:center;font-size:14pt;padding:10px 5px;color:#199fe6;}
.contattiRedazione a{color:black;}
+2 -9
View File
@@ -91,19 +91,12 @@ try {
?>
<div class="notiziaContainer">
<div class="notiziaImage mediaContent"><?php (!is_null($media))?$media->renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?></div>
<div id="notizia_<?php echo $i;?>" class="notiziaInfo">
<a href="articolo.php?id=<?php echo $notizia->id;?>" id="notizia_<?php echo $i;?>" class="notiziaInfo">
<div class="notiziaTitolo"><?php echo $stringTitolo;?></div>
<div class="notiziaSottotitolo"><?php echo$stringSottotitolo;?></div>
<div class="notiziaTesto"><?php echo $stringTesto;?></div>
</div>
</a>
</div>
<script type="text/javascript">
$(document).ready(function(event){
$("#notizia_<?php echo $i;?>").click(function(event){
window.location.href="articolo.php?id=<?php echo $notizia->id;?>";
});
});
</script>
<?php
}
?>