Update of /cvsroot/php-blog/jBlog
In directory sc8-pr-cvs1:/tmp/cvs-serv20335
Modified Files:
comment.php jBlog.css jBlog_admin.php jBlog_functions.inc.php
jBlog_genpage.php jBlog_layout.php
Added Files:
.cvsignore jBlog.css.php
Log Message:
Revise the layout so that we use more <divs> around things.
This makes is easier for people to use CSS to customize the layout.
Use jBlog.css.php as the stylesheet (George has plans for this).
--- NEW FILE: .cvsignore ---
index.html
jBlog_config_local.inc.php
.htaccess
uploads
archives
--- NEW FILE: jBlog.css.php ---
<?php
readfile("jBlog.css");
/* This could be tidied up by using the comment style rules recently added */
if ($_REQUEST['mode'] == "comments") {
?>
<style type="text/css">
<!--
.body {
font-family: Tahoma, Verdana, Arial;
}
.td {
font-family: Tahoma, Verdana, Arial;
}
.input {
width:100px;
font-size:12px;
font-family: Tahoma, Verdana, Arial;
background: #cdcdcd;
}
//-->
</style>
<?php
}
?>
Index: comment.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/comment.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- comment.php 4 Mar 2003 21:09:20 -0000 1.3
+++ comment.php 5 Mar 2003 21:09:39 -0000 1.4
@@ -63,27 +63,7 @@
<html>
<head>
<title>Comments</title>
-<link rel="stylesheet" type="text/css" href="<?=$jBlog['jBlogHTTPPath'] . '/'?>jBlog.css">
-<style type="text/css">
-<!--
-.body {
- font-family: Tahoma, Verdana, Arial;
-}
-
-.td {
- font-family: Tahoma, Verdana, Arial;
- }
-
-.input {
- width:100px;
- font-size:12px;
- font-family: Tahoma, Verdana, Arial;
- background: #cdcdcd;
-
-
-}
-//-->
-</style>
+<link rel="stylesheet" type="text/css" href="<?=$jBlog['jBlogHTTPPath'] . '/'?>jBlog.css.php?mode=comments">
</head>
<body>
<?php
Index: jBlog.css
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- jBlog.css 4 Mar 2003 00:43:58 -0000 1.2
+++ jBlog.css 5 Mar 2003 21:09:39 -0000 1.3
@@ -28,6 +28,7 @@
font-size: 14px;
padding-left: 20px;
width: 500px;
+ padding-bottom: 10px;
}
.jBlog_date, .jBlog_commentsTitle {
@@ -64,20 +65,20 @@
}
-TD.jBlogGreyBox {
+TD.jBlogLeftBox, TD.jBlogRightBox {
font-size: 14px;
background: #ffffff;
border: 1px solid #4068ab;
}
-TD.jBlogGreyBox A {
+TD.jBlogLeftBox A, TD.jBlogRightBox A {
font-size: 13px;
color: #1a3c5a;
font-weight: bold;
text-decoration: none;
}
-TD.jBlogGreyBox A:hover {
+TD.jBlogLeftBox A:hover, TD.jBlogRightBox A:hover {
text-decoration: underline;
}
Index: jBlog_admin.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_admin.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- jBlog_admin.php 4 Mar 2003 21:41:42 -0000 1.6
+++ jBlog_admin.php 5 Mar 2003 21:09:40 -0000 1.7
@@ -14,7 +14,7 @@
<html>
<head>
<title>jBlog Administration Suite</title>
- <link rel="stylesheet" type="text/css" href="jBlog.css">
+ <link rel="stylesheet" type="text/css" href="jBlog.css.php">
</head>
<body>
<table height="100%" width="100%"><tr><td valign="top" align="left" class="jBlogGreyBox" height="100%" width="100%">
Index: jBlog_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_functions.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- jBlog_functions.inc.php 5 Mar 2003 01:21:17 -0000 1.12
+++ jBlog_functions.inc.php 5 Mar 2003 21:09:40 -0000 1.13
@@ -23,6 +23,7 @@
global $jBlog, $commentsFields;
global $_SESSION;
?>
+<div class="jBlogCommentForm">
<form name="comment" action="<?=$jBlog['jBlogHTTPPath']?>comment.php" method="post">
<input type="hidden" name="jBlog[entry_id]" value="<?=$id?>" />
<table border="0" width="100%" cellpadding="3">
@@ -41,6 +42,7 @@
<input type="checkbox" name="jBlog[remember]" <?=$_SESSION['jBlog_remember']?> /><br />
<input type="submit" value="Submit Comment" />
</form>
+</div>
<?php
}
@@ -247,68 +249,94 @@
function jBlog_printEntries($entries, $extended=0) {
global $jBlog;
- if ($entries !== false) {
- for($x=0, $j = count($entries); $x<$j; $x++) {
- if ($lastDate != date("Ymd", $entries[$x]["timestamp"])) {
- echo "<div class='jBlog_date'>";
- echo date("l, F jS Y", $entries[$x]["timestamp"]);
- echo "</div>";
- $lastDate = date("Ymd", $entries[$x]["timestamp"]);
- }
+ /* pre-walk the array to collect them keyed by date */
+ $bydate = array();
+
+ if (!is_array($entries)) {
+ echo "jBlog error: entries to print invalid";
+ return;
+ }
+
+ $lastDate = "";
+ for ($x = 0, $num_entries = count($entries); $x < $num_entries; $x++) {
+ $d = date("l, F jS Y", $entries[$x]["timestamp"]);
+ $bydate[$d][] = $entries[$x];
+ }
+
+ foreach ($bydate as $date => $ents) {
+ echo "<div class='jBlog_Entry_Date'>";
+ echo "<div class='jBlog_date'>$date</div>";
+
+ foreach ($ents as $x => $entry) {
echo "<span class='jBlog_title'>";
- echo $entries[$x]["title"];
+ echo $entry['title'];
echo "</span>";
+
echo "<div class='jBlog_entry'>";
- if($extended && strlen($entries[$x]["extended"])) {
- echo nl2br(jBlog_emoticate(jBlog_markup_text($entries[$x]["extended"])));
- } else {
- echo nl2br(jBlog_emoticate(jBlog_markup_text($entries[$x]["body"])));
- }
- if($entries[$x]["exflag"] && !$extended) {
- ?>
- <div class='jBlog_time'><br>
- <a href="<?= $jBlog['jBlogHTTPPath'] ?>archives/e_<?= $entries[$x]['id'] ?>.html">View Extended Entry</a>
- </div><br>
- <?php
- }
- echo "<div class='jBlog_time'><br>";
- echo "<a href=\"{$jBlog['jBlogHTTPPath']}archives/e_{$entries[$x]['id']}.html\">Posted by ".$entries[$x]["author"]." at ";
- echo date("H:i", $entries[$x]["timestamp"]);
- echo "</a>";
- if ($j != 1) {
- $label = "Comments";
- if ((int) $entries[$x]['comments'] == 1) {
- $label = "Comment";
- }
- echo " | <a href=\"{$jBlog['jBlogHTTPPath']}comment.php?jBlog[entry_id]={$entries[$x]['id']}\" onClick=\"window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;\">".$entries[$x]["comments"]." $label</a>";
- }
- echo "</div>";
- echo "</div>";
+ if ($extended && strlen($entry['extended'])) {
+ echo nl2br(jBlog_emoticate(jBlog_markup_text($entry["extended"])));
+ } else {
+ echo nl2br(jBlog_emoticate(jBlog_markup_text($entry["body"])));
+ }
+
+ if ($entry['exflag'] && !$extended) {
+ echo "<br><div class='jBlog_time'><a href=\""
+ . $jBlog['jBlogHTTPPath']
+ . "archives/e_"
+ . $entry['id']
+ . ".html\">View Extended Entry</a></div><br>";
+ }
+
+ echo "<div class='jBlog_time'><br><a href=\""
+ . $jBlog['jBlogHTTPPath']
+ . "archives/e_"
+ . $entry['id']
+ . ".html\">Posted by "
+ . $entry['author']
+ . " at "
+ . date("H:i", $entry['timestamp'])
+ . "</a>";
+
+ if ($num_entries != 1) {
+ $label = $entry['comments'] == 1 ? "Comment" : "Comments";
+ echo " | <a href=\"{$jBlog['jBlogHTTPPath']}comment.php?jBlog[entry_id]={$entry['id']}\" "
+ . "onClick=\"window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;\">"
+ . $entry['comments'] . " $label</a>";
+ }
+
+ echo "</div>"; // jBlog_time
+
+
+
echo "\n<!--\n";
echo "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
echo " xmlns:trackback=\"http://madskills.com/public/xml/rss/module/trackback/\"\n";
echo " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
echo "<rdf:Description\n";
- echo " rdf:about=\"{$jBlog['baseURL']}feeds/ei_{$entries[$x]['id']}.rdf\"\n";
- echo " trackback:ping=\"{$jBlog['baseURL']}comment.php?type=trackback&entry_id={$entries[$x]['id']}\"\n";
- echo " dc:title=\"{$entries[$x]['title']}\"\n";
- echo " dc:identifier=\"{$jBlog['baseURL']}archives/e_{$entries[$x]['id']}.html\" />\n";
+ echo " rdf:about=\"{$jBlog['baseURL']}feeds/ei_{$entry['id']}.rdf\"\n";
+ echo " trackback:ping=\"{$jBlog['baseURL']}comment.php?type=trackback&entry_id={$entry['id']}\"\n";
+ echo " dc:title=\"{$entry['title']}\"\n";
+ echo " dc:identifier=\"{$jBlog['baseURL']}archives/e_{$entry['id']}.html\" />\n";
echo "</rdf:RDF>\n";
echo "-->\n";
- echo "<p>";
- if ($j == 1) {
- echo '<link rel="pingback" href="' . $jBlog['baseURL'] . "comment.php?type=pingback&entry_id={$entries[$x]['id']}\" />\n";
+
+ if ($num_entries == 1) {
+ echo '<link rel="pingback" href="' . $jBlog['baseURL'] . "comment.php?type=pingback&entry_id={$entry['id']}\" />\n";
echo "\n<br />\n";
echo '<div class="jBlog_commentsTitle">Comments</div>';
- jBlog_printComments(jBlog_fetchComments($entries[$x]['id']));
+ jBlog_printComments(jBlog_fetchComments($entry['id']));
echo "<br />\n\n";
echo '<div class="jBlog_commentsTitle">Add Comment</div>';
- jBlog_displayCommentForm($entries[$x]['id']);
+ jBlog_displayCommentForm($entry['id']);
}
- }
- }
- else
- echo "jBlog error: entries to print invalid";
+
+ echo "</div>"; // jBlog_entry
+ }
+
+ // Entry_Date
+ echo "</div>";
+ }
+
}
function jBlog_fetchComments($id, $limit = null)
Index: jBlog_genpage.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_genpage.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- jBlog_genpage.php 4 Mar 2003 00:43:58 -0000 1.2
+++ jBlog_genpage.php 5 Mar 2003 21:09:41 -0000 1.3
@@ -1,7 +1,7 @@
<?php
?><html><head><title><?=$jBlog['blogTitle']?></title>
-<link rel="stylesheet" type="text/css" href="<?=$jBlog['jBlogHTTPPath']?>jBlog.css">
+<link rel="stylesheet" type="text/css" href="<?=$jBlog['jBlogHTTPPath']?>jBlog.css.php">
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?=$jBlog['baseURL']?>feeds/index.rss" />
<body>
<?php
Index: jBlog_layout.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_layout.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- jBlog_layout.php 5 Mar 2003 01:10:17 -0000 1.5
+++ jBlog_layout.php 5 Mar 2003 21:09:41 -0000 1.6
@@ -41,7 +41,7 @@
</table>
<table class="jBlog" cellpadding="20">
<tr>
- <td class="jBlogGreyBox" valign="top">
+ <td class="jBlogLeftBox" valign="top">
<?php
if (!is_numeric($jBlog["GET"]["range"]))
$jBlog["GET"]["range"] = date("Ymd");
@@ -72,7 +72,8 @@
}
?>
</td>
- <td class="jBlogGreyBox" valign="top">
+ <td class="jBlogRightBox" valign="top">
+ <div class="jBlogQuickJump">
<b>Quickjump:</b><br>
<?php
// Draw the calendar
@@ -87,11 +88,17 @@
jBlog_drawCalendar(substr($jBlog["GET"]["calendarZoom"], 4, 2),
substr($jBlog["GET"]["calendarZoom"], 0,4));
?><br>
+ </div>
+
+ <div class="jBlogQuickSearch">
<b>Quicksearch:</b>
<form action="<?=$jBlog['jBlogHTTPPath'] ?>search.php" METHOD="GET">
<input type="hidden" name="jBlog[action]" value="search">
<INPUT TYPE="TEXT" name="jBlog[searchTerm]" ONFOCUS="value='';">
- </FORM><p>
+ </form>
+ </div>
+
+ <div class="jBlogArchives">
<b>Archives:</b><br>
<?php
$ts = mktime(0,0,0,(date("m")+1), 1, date("Y"));
@@ -105,11 +112,20 @@
$ts = mktime(0,0,0,date("m", $ts), 1, date("Y", $ts));
}
?>
- <a href='?jBlog[action]=archives'>Older...</a><p>
+ <a href='?jBlog[action]=archives'>Older...</a>
+ </div>
+
<?= jBlog_displayTopReferrers() ?><p>
+ <div class="jBlogSuperUser">
<b>Superuser:</b><br>
- <a href="<?=$jBlog['jBlogHTTPPath']?>jBlog_admin.php">$ su -</a><p>
- This blog powered by <a href="http://sourceforge.net/projects/php-blog">jBlog</a>!
+ <a href="<?=$jBlog['jBlogHTTPPath']?>jBlog_admin.php">$ su -</a>
+ <br />
+ <br />
+ </div>
+
+ <div class="jBlogPlug">
+ This blog powered by <a href="http://sourceforge.net/projects/php-blog">jBlog</a>!
+ </div>
</td>
</tr>
</table>
|