Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28501/include
Modified Files:
functions_config.inc.php plugin_api.inc.php
Log Message:
* Fix "i.e." usage wher "e.g." is better
* Plugin fixes to display special owned plugins despite of frontend user capabilites (thanks to Jannis for spotting this!)
Index: functions_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_config.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- functions_config.inc.php 17 Jan 2005 19:07:17 -0000 1.13
+++ functions_config.inc.php 17 Jan 2005 19:52:14 -0000 1.14
@@ -33,7 +33,12 @@
function serendipity_get_user_config_var($name, $authorid, $default = '') {
global $serendipity;
- $r = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE authorid = " . (int)$authorid . " AND name = '" . $name . "' LIMIT 1", true);
+ $author_sql = '';
+ if (!empty($authorid)) {
+ $author_sql = "authorid = " . (int)$authorid . " AND ";
+ }
+
+ $r = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE $author_sql name = '" . $name . "' LIMIT 1", true);
if (is_array($r)) {
return $r[0];
Index: plugin_api.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/plugin_api.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- plugin_api.inc.php 10 Jan 2005 16:25:09 -0000 1.14
+++ plugin_api.inc.php 17 Jan 2005 19:52:17 -0000 1.15
@@ -671,6 +671,13 @@
$_res = serendipity_get_config_var($this->instance . '/' . $name, $defaultvalue, $empty);
if (is_null($_res)) {
+ // A protected plugin by a specific owner may not have its values stored in $serendipity
+ // because of the special authorid. To display such contents, we need to fetch it
+ // seperately from the DB.
+ $_res = serendipity_get_user_config_var($this->instance . '/' . $name, null, $defaultvalue);
+ }
+
+ if (is_null($_res)) {
$cbag = new serendipity_property_bag;
$this->introspect_config_item($name, $cbag);
$_res = $cbag->get('default');
|