Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv32529
Modified Files:
index.php serendipity_functions.inc.php
serendipity_lang_de.inc.php serendipity_lang_en.inc.php
Log Message:
Enhanced the looks a little:
- the line trailing each entry is now adapted to the "common format"
Posted by xx in xx at xx | comments (n) | trackbacks (n)
- entry title now links to the entry
- archive let's user choose whether to see the full entries of a month
or only the topics (clickable)
How about a beta release now? If you disagree, tell me within 2 hours :-)
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- index.php 27 Jun 2003 13:41:37 -0000 1.13
+++ index.php 28 Jun 2003 18:11:01 -0000 1.14
@@ -33,7 +33,33 @@
echo $data;
}
+else
+if (preg_match('@/archives/(\d+)_short\.html@', $uri, $matches)) {
+ $range = $matches[1];
+ $_GET['serendipity']['action'] = "read";
+ $_GET['serendipity']['range'] = $range;
+ $_GET['serendipity']['short'] = true;
+
+ if (strlen($range) == 6) {
+ $date = date("m/Y", mktime(0,0,0, substr($range, 4, 6), 2, substr($range, 0, 4)));
+ } else {
+ $date = date("d/m/Y", strtotime($range));
+ }
+
+ $serendipity['blogSubTitle'] = "Topics for $date";
+ ob_start();
+ include_once("serendipity_genpage.inc.php");
+ $data = ob_get_contents();
+ ob_end_clean();
+ if ($serendipity['pregenerate']) {
+ $fp = fopen("./archives/{$matches[1]}", "w");
+ fwrite($fp, $data);
+ fclose($fp);
+ }
+
+ echo $data;
+}
else if (preg_match('@/(\d+)_\w*\.html@i', $uri, $matches)) {
$id = $matches[1];
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- serendipity_functions.inc.php 26 Jun 2003 19:04:01 -0000 1.81
+++ serendipity_functions.inc.php 28 Jun 2003 18:11:01 -0000 1.82
@@ -377,14 +377,20 @@
$d = date(DATE_FORMAT_1, $entries[$x]["timestamp"]);
$bydate[$d][] = $entries[$x];
}
-
+ if (!$serendipity['GET']['short']) {
foreach ($bydate as $date => $ents) {
echo "<div class='serendipity_Entry_Date'>";
echo "<div class='serendipity_date'>$date</div>";
foreach ($ents as $x => $entry) {
echo "<div class='serendipity_title'>";
+ echo "<a style='text-decoration:none;' href=\""
+ . $serendipity['serendipityHTTPPath']
+ . "archives/"
+ . $entry['id']
+ . "_".serendipity_makeFilename($entry['title']).".html\">";
echo htmlentities($entry['title']);
+ echo "</a>";
echo "</div>";
echo "<div class='serendipity_entry'>";
@@ -401,26 +407,22 @@
. "_".serendipity_makeFilename($entry['title']).".html#extended\">View Extended Entry</a></div><br>";
}
- echo "<div class='serendipity_entryFooter'><br><a href=\""
- . $serendipity['serendipityHTTPPath']
- . "archives/"
- . $entry['id']
- . "_".serendipity_makeFilename($entry['title']).".html\">".POSTED_BY." "
+ echo "<div class='serendipity_entryFooter'><br>"
+ . POSTED_BY." "
. htmlentities($entry['username'])
. ($entry['category_name']?(" in ${entry['category_name']}"):"")
- ." at "
- . date("H:i", $entry['timestamp'])
- . "</a>";
+ . " ".AT
+ . date("H:i", $entry['timestamp']);
if (!isset($serendipity['GET']['id'])) {
$label = $entry['comments'] == 1 ? COMMENT : COMMENTS;
echo " | <a href=\"{$serendipity['serendipityHTTPPath']}comment.php?serendipity[entry_id]={$entry['id']}&serendipity[type]=comments\" "
. "onClick=\"window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;\">"
- . $entry['comments'] . " $label</a>";
+ . "$label ({$entry['comments']})</a>";
$label = $entry['trackbacks'] == 1 ? TRACKBACK : TRACKBACKS;
echo " | <a href=\"{$serendipity['serendipityHTTPPath']}comment.php?serendipity[entry_id]={$entry['id']}&serendipity[type]=trackbacks\" "
. "onClick=\"window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;\">"
- . "{$entry['trackbacks']} $label</a>";
+ . "$label ({$entry['trackbacks']})</a>";
}
echo "</div>"; // serendipity_time
@@ -454,8 +456,25 @@
// Entry_Date
echo "</div>";
- }
-
+ }
+ }
+ else {
+ $s = &$serendipity['GET']['range'];
+ echo "<div class='serendipity_date'>".TOPICS_OF." ".
+ date("m/Y", mktime(0,0,0,substr($s,4,2),1,substr($s, 0, 4)))
+ ."</div>";
+ foreach ($bydate as $date => $ents) {
+ foreach ($ents as $x => $entry) {
+ echo "<a href=\""
+ . $serendipity['serendipityHTTPPath']
+ . "archives/"
+ . $entry['id']
+ . "_".serendipity_makeFilename($entry['title']).".html\">";
+ echo "{$entry[title]}</a>";
+ echo "<br />";
+ }
+ }
+ }
}
function serendipity_deleteComment($id,$entry_id,$type='comments')
@@ -1737,14 +1756,16 @@
$entries = serendipity_postAmount($currYear, $x);
if ($entries>0) {
$a = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear".sprintf("%02s",$x).".html'>";
- $b = "($entries entries)</a>";
+ $b = "</a>";
+ $c = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear".sprintf("%02s",$x)."_short.html'>";
+ $d = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear".sprintf("%02s",$x).".html'>";
}
else {
- $a = "<font color='#cdcdcd'>";
- $b = "</font>";
+ $a = $c = "<font color='#cdcdcd'>";
+ $b = $d = "</font>";
}
if ($x<=date("m") || $currYear < date("Y"))
- $out[$currYear][$x] = array($entries, "$a{$serendipity['months'][$x]} $b");
+ $out[$currYear][$x] = array($entries, $a, $b, $c, $d);
if ($entries > $max) $max = $entries;
}
// echo "</div>";
@@ -1752,18 +1773,21 @@
}
$barwidth = 40;
$fac = $barwidth/$max;
-
+ echo "<table cellspacing='0'>";
foreach($out as $year => $months) {
- echo "<h2>$year</h2><div class='serendipity_entry'>\n";
+ echo "<tr><td colspan='4'><h2>$year</h2></td></tr>";
for($y=1; $y<13; $y++) {
- if ($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 />";
- }
+ if ($months[$y]) {
+ echo "<tr><td>";
+ 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]}{$serendipity['months'][$y]}{$months[$y][2]} ({$months[$y][0]} ".ENTRIES.")</td><td>";
+ echo "<img src='{$serendipity['serendipityHTTPPath']}pixel/blank.png' height='10' width='35' hspace='0' vspace='0'> ";
+ echo " ({$months[$y][1]}".VIEW_FULL."{$months[$y][2]})</td><td> ({$months[$y][3]}".VIEW_TOPICS."{$months[$y][4]})</td></tr>";
+ }
}
- echo "</div>";
}
+ echo "</table>";
}
Index: serendipity_lang_de.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serendipity_lang_de.inc.php 22 Jun 2003 14:03:17 -0000 1.9
+++ serendipity_lang_de.inc.php 28 Jun 2003 18:11:01 -0000 1.10
@@ -148,6 +148,10 @@
define("TRACKBACKS", "Trackbacks");
define("TRACKBACK", "Trackback");
define("NO_TRACKBACKS", "Keine Trackbacks");
+define("TOPICS_OF", "Themen in");
+define("VIEW_FULL", "ganz anzeigen");
+define("VIEW_TOPICS", "Überschriften anzeigen");
+define("AT", "um");
define("serendipity_LANG_LOADED", true);
?>
Index: serendipity_lang_en.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- serendipity_lang_en.inc.php 22 Jun 2003 14:03:17 -0000 1.13
+++ serendipity_lang_en.inc.php 28 Jun 2003 18:11:01 -0000 1.14
@@ -150,6 +150,10 @@
define("TRACKBACKS", "Trackbacks");
define("TRACKBACK", "Trackback");
define("NO_TRACKBACKS", "No Trackbacks");
+define("TOPICS_OF", "Topics of");
+define("VIEW_FULL", "view full");
+define("VIEW_TOPICS", "view topics");
+define("AT", "at");
define("serendipity_LANG_LOADED", true);
|