Update of /cvsroot/php-blog/jBlog
In directory sc8-pr-cvs1:/tmp/cvs-serv21514
Modified Files:
jBlog_functions.inc.php jBlog_plugin_api.php
Log Message:
added ability to customize css classes for indiviual plugins
Fixed author determination in fetch's
Index: jBlog_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_functions.inc.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- jBlog_functions.inc.php 10 Mar 2003 22:11:17 -0000 1.46
+++ jBlog_functions.inc.php 10 Mar 2003 22:33:13 -0000 1.47
@@ -176,20 +176,20 @@
**/
function jBlog_fetchEntries($range, $full = true, $limit = "") {
global $jBlog;
- $where = "";
+ $and = "";
if ($full === true)
$body = ',body, extended';
if (is_numeric($range)) {
- $where = "WHERE FROM_UNIXTIME(timestamp, '%Y%m%d') LIKE '$range%' ";
+ $and = "AND FROM_UNIXTIME(timestamp, '%Y%m%d') LIKE '$range%' ";
}
if (!empty($limit)) {
$limit = "LIMIT $limit";
}
- $query = "SELECT * FROM {$jBlog['dbPrefix']}entries " . $where .
+ $query = "SELECT * FROM {$jBlog['dbPrefix']}entries e, {$jBlog['dbPrefix']}authors a WHERE e.authorid = a.authorid " . $and .
"ORDER BY timestamp DESC $limit";
$cursor = mysql_db_query($jBlog["dbName"], $query);
@@ -199,16 +199,6 @@
while($row = mysql_fetch_assoc($cursor)) {
$ret[] = $row;
-/*
- array("id" => $row['id'],
- "timestamp" => $row['timestamp'],
- "comments" => $row['comments'],
- "title" => $row['title'],
- "body" => $row['body'],
- "extended" => $row['extended'],
- "author" => $row['author'],
- "exflag" => $row['exflag']);
-*/
}
return $ret;
@@ -221,8 +211,8 @@
global $jBlog;
if ($full === true) $body = ", body, extended";
- $querystring = "SELECT * FROM ".$jBlog["dbPrefix"]."entries
- WHERE $key LIKE $val LIMIT 1";
+ $querystring = "SELECT * FROM ".$jBlog["dbPrefix"]."entries e, $jBlog[dbPrefix]authors a
+ WHERE a.authorid = e.authorid AND $key LIKE $val LIMIT 1";
$query = mysql_db_query($jBlog["dbName"], $querystring);
return mysql_fetch_assoc($query);
@@ -293,7 +283,7 @@
. "archives/e_"
. $entry['id']
. ".html\">Posted by "
- . htmlentities($entry['author'])
+ . htmlentities($entry['username'])
. " at "
. date("H:i", $entry['timestamp'])
. "</a>";
Index: jBlog_plugin_api.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_plugin_api.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- jBlog_plugin_api.php 10 Mar 2003 22:25:52 -0000 1.6
+++ jBlog_plugin_api.php 10 Mar 2003 22:33:14 -0000 1.7
@@ -148,7 +148,7 @@
$plugin->generate_content($title);
$content = ob_get_contents();
ob_end_clean();
- echo "<div class=\"jBlogSideBarItem\"><div class=\"jBlogSideBarTitle\">$title</div><div class=\"jBlogSideBarContent\">$content</div></div>\n";
+ echo "<div class=\"$plugin->wrap_class\"><div class=\"$plugin->title_class\">$title</div><div class=\"$plugin->content_class\">$content</div></div>\n";
}
echo "</div>\n";
}
@@ -193,7 +193,9 @@
class jBlog_plugin {
var $instance = null;
-
+ var $wrap_class = 'jBlogSideBarItem';
+ var $title_class = 'jBlogSideBarTitle';
+ var $content_class = 'jBlogSideBarContent';
/* Be sure to call this method from your derived classes constructors,
* otherwise your config data will not be stored or retrieved correctly */
function jBlog_plugin($instance)
|