Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv869
Modified Files:
serendipity_functions.inc.php
Log Message:
Added a history plugin that displays things you wrote one year
ago (or a week ago, whatever...). Check it out and tell me if
there's something wrong with it :)
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.305
retrieving revision 1.306
diff -u -d -r1.305 -r1.306
--- serendipity_functions.inc.php 24 Jun 2004 10:46:53 -0000 1.305
+++ serendipity_functions.inc.php 24 Jun 2004 20:00:53 -0000 1.306
@@ -595,7 +595,8 @@
/**
* Give it a range in YYYYMMDD format to gather the desired entries
-* (For february 2002 you would pass 200202 e.g.
+* (For february 2002 you would pass 200202 for all entries withing
+* two timestamps you would pass array(timestamp1,timestamp2)
**/
function serendipity_fetchEntries($range = null, $full = true, $limit = '', $fetchDrafts = false, $modified_since = false, $orderby = 'timestamp DESC', $filter_sql = '') {
global $serendipity;
@@ -635,6 +636,11 @@
if ($drafts) {
$and .= " AND $drafts";
}
+ }
+ elseif (is_array($range) && count($range)==2) {
+ $startts = $range[0];
+ $endts = $range[1];
+ $and = " WHERE timestamp >= $startts AND timestamp <= $endts";
} else {
if ($modified_since) {
$unix_modified = strtotime($modified_since);
|