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