Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv3419
Modified Files:
serendipity_functions.inc.php
Log Message:
Beautified the archives, check it out: http://blog.jannis.to/archive
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- serendipity_functions.inc.php 5 Jun 2003 10:11:49 -0000 1.60
+++ serendipity_functions.inc.php 11 Jun 2003 18:10:31 -0000 1.61
@@ -539,7 +539,7 @@
function serendipity_sendComment($to, $fromName, $fromEmail, $fromUrl, $id, $title, $comment, $type='NORMAL') {
global $serendipity;
-
+
if ($type == 'TRACKBACK') {
/* If the comment is a trackback */
@@ -566,7 +566,7 @@
".COMMENTS.":
". strip_tags($comment);
-
+
}
$signature = "
@@ -1767,8 +1767,9 @@
$lastYear = date("Y", $f[0][0]);
$lastMonth= date("m", $f[0]);
$currYear = date("Y");
+ $max = 0;
while($currYear>=$lastYear) {
- echo "<h2>$currYear</h2><div class='serendipity_entry'>";
+ // echo "<h2>$currYear</h2><div class='serendipity_entry'>";
for($x=1; $x<13; $x++) {
$entries = serendipity_postAmount($currYear, $x);
if ($entries>0) {
@@ -1780,11 +1781,24 @@
$b = "</font>";
}
if ($x<=date("m") || $currYear < date("Y"))
- echo str_repeat(" ", 8)."$a{$serendipity['months'][$x]} $b<br>";
+ $out[$currYear][$x] = array($entries, "$a{$serendipity['months'][$x]} $b");
+ if ($entries > $max) $max = $entries;
}
- echo "</div>";
+ // echo "</div>";
$currYear--;
}
+ $barwidth = 40;
+ $fac = $barwidth/$max;
+
+ foreach($out as $year => $months) {
+ echo "<h2>$year</h2><div class='serendipity_entry'>\n";
+ for($y=1; $y<count($months); $y++) {
+ echo "<img src='{$serendipity['serendipityHTTPPath']}pixel/bar1.png' height='10' width='".ceil($months[$y][0]*$fac)."' hspace='0' vspace='0'>";
+ echo "<img src='{$serendipity['serendipityHTTPPath']}pixel/blank.png' height='10' width='".($barwidth-ceil($months[$y][0]*$fac))."' hspace='0' vspace='0'> ";
+ echo $months[$y][1]."<br />";
+ }
+ echo "</div>";
+ }
}
|