Cambiata etichetta immagini di articolo;
Archivio ora ha la paginazione; Fixata paginazione in searchResults; styling per la paginazione
This commit is contained in:
+66
-17
@@ -28,7 +28,7 @@ try {
|
||||
$month= $_POST["month"];
|
||||
$year = $_POST["year"];
|
||||
|
||||
$limit=12;
|
||||
$limit=2;
|
||||
$page = 1;
|
||||
$numPages = 1;
|
||||
|
||||
@@ -41,7 +41,7 @@ try {
|
||||
$dateString = $_POST["year"]."-".$_POST["month"]."-".$_POST["day"];
|
||||
|
||||
$notizieDateAll = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"about.data"=>array('$gt'=>new MongoDate(strtotime($dateString)),
|
||||
array("status"=>NotiziaModel::STATUS_ACCEPTED),array("about.data"=>array('$gt'=>new MongoDate(strtotime($dateString)),
|
||||
'$lt'=>new MongoDate(strtotime($dateString." +1 day"))))
|
||||
);
|
||||
|
||||
@@ -56,9 +56,9 @@ try {
|
||||
|
||||
|
||||
$notizieDate = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"about.data"=>array('$gt'=>new MongoDate(strtotime($dateString)),
|
||||
array("status"=>NotiziaModel::STATUS_ACCEPTED),array("about.data"=>array('$gt'=>new MongoDate(strtotime($dateString)),
|
||||
'$lt'=>new MongoDate(strtotime($dateString." +1 day")))),
|
||||
array("limit"=>$limit,"skip"=>$page*$limit)
|
||||
array("limit"=>$limit,"skip"=>$skip)
|
||||
);
|
||||
|
||||
if (sizeof($notizieDate)>0){
|
||||
@@ -84,7 +84,7 @@ try {
|
||||
GUIHandler::generateMenu();?>
|
||||
|
||||
<div class="archivioDate">
|
||||
<form method="POST" id="selectDate">
|
||||
<form method="POST" id="formData">
|
||||
<select name="day">
|
||||
<?php
|
||||
for($i=1;$i<=31;$i++){
|
||||
@@ -117,7 +117,7 @@ try {
|
||||
</select>
|
||||
<select name="year">
|
||||
<?php
|
||||
for($i=2006;$i<=$currentYear;$i++){
|
||||
for($i=2009;$i<=$currentYear;$i++){
|
||||
if($post && ($i == intval($year))){
|
||||
?>
|
||||
<option value="<?php echo $i;?>" selected><?php echo $i;?></option>
|
||||
@@ -130,7 +130,8 @@ try {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" name="submit" value="Invia"/>
|
||||
<input id ="pageSend" type="hidden" name="page" value="1" />
|
||||
<input id="sendForm" type="submit" name="submit" value="Invia" form="formData"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="archivioResults">
|
||||
@@ -168,30 +169,78 @@ try {
|
||||
}
|
||||
?>
|
||||
<div class="paging">
|
||||
<form id="changePage" method="POST">
|
||||
<input type="hidden" name ="day" value="<?php echo $day;?>">
|
||||
<input type="hidden" name ="month" value="<?php echo $month;?>">
|
||||
<input type="hidden" name ="year" value="<?php echo $year;?>">
|
||||
<input type="hidden" name="submit" value="Invia" />
|
||||
<?php
|
||||
for($j = 1;$j<=$numPages;$j++){
|
||||
|
||||
if($page-2>1){
|
||||
?>
|
||||
<div id ="page_first" class="page">
|
||||
Inizio
|
||||
</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){
|
||||
$j = $page;
|
||||
}
|
||||
else if($page+2 >$numPages){
|
||||
$j = $numPages-3;
|
||||
$last = $numPages;
|
||||
}
|
||||
else{
|
||||
$j = $page - 2;
|
||||
}
|
||||
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" style="display:inline-block;padding:10px;cursor:pointer;">
|
||||
<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();
|
||||
$("input#sendForm").click();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
if($page+2<$numPages){
|
||||
?>
|
||||
<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;?>');
|
||||
$("input#sendForm").click();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input id="pageSend" type="hidden" name="page" />
|
||||
</form>
|
||||
<!-- <input id="pageSend" type="hidden" name="page" form="changePage"/> -->
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ GUIHandler::generateHtmlHeaders(array("additionalHeaders"=>$additionalHeaders));
|
||||
<?php if(sizeof($medias)>1){?>
|
||||
<div class="mediasConatiner">
|
||||
<div class="headMedias">
|
||||
<div class="moreMedia"><span>Altri media bellissimi</span></div>
|
||||
<div class="moreMedia"><span>Altri contenuti</span></div>
|
||||
</div>
|
||||
<div class="caroselContainer">
|
||||
<?php
|
||||
|
||||
+83
-28
@@ -45,7 +45,7 @@ try {
|
||||
|
||||
$notizie = GlobalVariables::get("dao")->search("NotiziaModel",$searchParameters,
|
||||
array("status"=>NotiziaModel::STATUS_ACCEPTED),
|
||||
array("sort"=>array("about.data"=>-1),"limit"=>$limit,"skip"=>$page*$limit)
|
||||
array("sort"=>array("about.data"=>-1),"limit"=>$limit,"skip"=>$skip)
|
||||
);
|
||||
|
||||
// $notizie = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||
@@ -106,41 +106,96 @@ try {
|
||||
</script>
|
||||
<?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>
|
||||
<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){
|
||||
$j = $page;
|
||||
}
|
||||
else if($page+2 >$numPages){
|
||||
$j = $numPages-3;
|
||||
$last = $numPages;
|
||||
}
|
||||
else{
|
||||
$j = $page - 2;
|
||||
}
|
||||
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" style="display:inline-block;padding:10px;cursor:pointer;">
|
||||
<?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 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 style="color:red;">Nessun articolo trovato con questi parametri di ricerca.</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="summaryRightBar">
|
||||
<?php GUIHandler::generateRightBannerBlock();?>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<form id="changePage" method="POST">
|
||||
<input type="hidden" name ="search" value="<?php echo $searchParameters;?>">
|
||||
<?php
|
||||
for($j = 1;$j<=$numPages;$j++){
|
||||
?>
|
||||
<div id ="page_<?php echo $j;?>" class="page" style="display:inline-block;padding:10px;cursor:pointer;">
|
||||
<?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
|
||||
}
|
||||
?>
|
||||
<input id="pageSend" type="hidden" name="page" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
GUIHandler::generateFooter();
|
||||
GUIHandler::generateGoogleAnalyticsScripts();
|
||||
|
||||
@@ -471,4 +471,17 @@ Password Recovery
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
____ _ _ _
|
||||
| _ \ __ _ __ _(_)_ __ __ _| |_(_) ___ _ __
|
||||
| |_) / _` |/ _` | | '_ \ / _` | __| |/ _ \| '_ \
|
||||
| __/ (_| | (_| | | | | | (_| | |_| | (_) | | | |
|
||||
|_| \__,_|\__, |_|_| |_|\__,_|\__|_|\___/|_| |_|
|
||||
|___/
|
||||
*/
|
||||
|
||||
.paging {padding:5px 0px;}
|
||||
.paging .page{margin:0px 5px 0px 0px;display:inline-block;padding:5px 15px;background-color:#B7B7B7;cursor:pointer;}
|
||||
.paging .page.current{font-weight:bold;cursor:default;background-color:#d3d3d3;}
|
||||
.paging .page:hover{background-color:#939393;}
|
||||
.paging .page.current:hover{background-color:#d3d3d3;}
|
||||
|
||||
Reference in New Issue
Block a user