annotate mood.php @ 1:7dec52982000

Affichage uniquement des messages publiquement visible (non spam)
author Franck Deroche <webmaster@defr.org>
date Sat, 20 Oct 2007 14:25:20 +0200
parents 629389204276
children
rev   line source
webmaster@0 1 <?php
webmaster@0 2 setlocale(LC_ALL, "fr_BE.utf8@euro");
webmaster@0 3 include("classes.php");
webmaster@0 4 $type = $_GET['type'];
webmaster@0 5 $year = $_GET['year'];
webmaster@0 6 $month = $_GET['month'];
webmaster@0 7 $prevMonth = ($month - 1)%12; if($prevMonth == 0) $prevMonth = 12; $prevYear = ($month == 1)?$year-1:$year;
webmaster@0 8 $nextMonth = $month % 12 + 1; $nextYear = ($month == 12)?$year+1:$year;
webmaster@0 9 $Data = new DataAccess;
webmaster@0 10 include("top.php");
webmaster@0 11 $Data->Connect();
webmaster@0 12 if($type != "cal")
webmaster@0 13 $Data->Query("SELECT * FROM Mess Where num_version='Version 10' ORDER BY num_mess DESC");
webmaster@0 14 else
webmaster@0 15 $Data->Query("SELECT * FROM Mess WHERE YEAR(DatePost)={$year} AND MONTH(DatePost)={$month} ORDER BY num_mess DESC");
webmaster@0 16 $i=0;
webmaster@0 17 if($type == "cal") {
webmaster@0 18 echo("<div class='cal'>");
webmaster@0 19 if($prevYear > $startDate['year'] - 1 && $prevMonth > $startDate['month'] - 1)
webmaster@0 20 echo("<a class='calPrev' href='/blog/posts/{$prevYear}/{$prevMonth}'>{$arMonth[$prevMonth - 1]} {$prevYear}</a>");
webmaster@0 21 else
webmaster@0 22 echo("<a class='calPrev'>{$arMonth[$prevMonth - 1]} {$prevYear}</a>");
webmaster@0 23 if(($curYear == $nextYear && $nextMonth < $curMonth + 1) || ($nextYear < $curYear) )
webmaster@0 24 echo("<a class='calNext' href='/blog/posts/{$nextYear}/" . ($month % 12 + 1) ."'>{$arMonth[$month%12]} {$nextYear}</a>");
webmaster@0 25 else
webmaster@0 26 echo("<a class='calNext'>{$arMonth[$month%12]} {$nextYear}</a>");
webmaster@0 27 echo("{$arMonth[$month - 1]} {$year}</div> ");
webmaster@0 28 }
webmaster@0 29 while(($row=$Data->GetRow()) && ($i++<10 || $type == "cal")) {
webmaster@0 30 $Mess=$Data->utf8_ensure(str_replace("<P>","<p>",str_replace("</P>","</p>", $row['Message'])));
webmaster@0 31 $dateFormatee = strftime("%A %d %B %Y, %Hh%M", strtotime($row['DatePost']));
webmaster@0 32 $Titre = $Data->utf8_ensure($row['Titre']);
webmaster@0 33 $Titre_url = str_replace(" ", "_", strip_tags($Titre));
webmaster@0 34 $Titre_url = str_replace("-", "_", $Titre_url);
webmaster@0 35 echo("
webmaster@0 36 <div class='PostContent' style='background:url(t_alphaboost.png) bottom right no-repeat;'>
webmaster@0 37 <h2>{$Titre} | <span class='Date'>{$dateFormatee}</span></h2>
webmaster@0 38 <img src='t.png' style='float:left;margin:1.5em 1em 0.5em 0; padding:10px; border:1px #795 solid; background:url(css/Res_Somatic/bg_test.png);' />
webmaster@0 39 {$Mess}<br />
webmaster@0 40 <a href=\"/blog/posts/{$row['num_mess']}-{$Titre_url}\">#{$row['num_mess']}</a> -
webmaster@0 41 <a href=\"/blog/posts/{$row['num_mess']}-{$Titre_url}\">
webmaster@0 42 ");
webmaster@0 43 if(!is_null($row['NbCommentaires']) && $row['NbCommentaires']!=0)
webmaster@0 44 echo("Un 'tit commentaire ( {$row['NbCommentaires']} ) ?");
webmaster@0 45 else
webmaster@0 46 echo("Un 'tit commentaire ?");
webmaster@0 47 echo("
webmaster@0 48 </a>
webmaster@0 49 </div>");
webmaster@0 50 }
webmaster@0 51 if($type == "cal") {
webmaster@0 52 echo("<div class='cal'>");
webmaster@0 53 if($prevYear > $startDate['year'] - 1 && $prevMonth > $startDate['month'] - 1)
webmaster@0 54 echo("<a class='calPrev' href='/blog/posts/{$prevYear}/{$prevMonth}'>{$arMonth[$prevMonth - 1]} {$prevYear}</a>");
webmaster@0 55 else
webmaster@0 56 echo("<a class='calPrev'>{$arMonth[$prevMonth - 1]} {$prevYear}</a>");
webmaster@0 57 if(($curYear == $nextYear && $nextMonth < $curMonth + 1) || ($nextYear < $curYear) )
webmaster@0 58 echo("<a class='calNext' href='/blog/posts/{$nextYear}/" . ($month % 12 + 1) ."'>{$arMonth[$month%12]} {$nextYear}</a>");
webmaster@0 59 else
webmaster@0 60 echo("<a class='calNext'>{$arMonth[$month%12]} {$nextYear}</a>");
webmaster@0 61 echo("{$arMonth[$month - 1]} {$year}</div> ");
webmaster@0 62 }
webmaster@0 63 $Data->Close();
webmaster@0 64 include("foot.php");
webmaster@0 65 ?>