Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_entryproperties
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4770/plugins/serendipity_event_entryproperties
Modified Files:
Tag: branch-smarty
serendipity_event_entryproperties.php
Log Message:
fixed "wrong stickyness". Please execute this to fix your entries:
DELETE FROM serendipity_entryproperties WHERE ep_is_sticky = '';
and then it should work
Index: serendipity_event_entryproperties.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_entryproperties/Attic/serendipity_event_entryproperties.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- serendipity_event_entryproperties.php 22 Sep 2004 08:11:47 -0000 1.1.2.3
+++ serendipity_event_entryproperties.php 22 Sep 2004 09:02:20 -0000 1.1.2.4
@@ -106,9 +106,9 @@
foreach($this->supported_properties AS $prop_key) {
$prop_val = (isset($serendipity['POST']['properties'][$prop_key]) ? $serendipity['POST']['properties'][$prop_key] : null);
$prop_key = 'ep_' . $prop_key;
- if (!isset($property[$prop_key])) {
+ if (!isset($property[$prop_key]) && !empty($prop_val)) {
$q = "INSERT INTO {$serendipity['dbPrefix']}entryproperties (entryid, property, value) VALUES (" . (int)$eventData['id'] . ", '" . serendipity_db_escape_string($prop_key) . "', '" . serendipity_db_escape_string($prop_val) . "')";
- } elseif ($property[$propkey] != $prop_val) {
+ } elseif ($property[$propkey] != $prop_val && !empty($prop_val)) {
$q = "UPDATE {$serendipity['dbPrefix']}entryproperties SET value = '" . serendipity_db_escape_string($prop_val) . "' WHERE entryid = " . (int)$eventData['id'] . " AND property = '" . serendipity_db_escape_string($prop_key) . "'";
} else {
$q = "DELETE FROM {$serendipity['dbPrefix']}entryproperties WHERE entryid = " . (int)$eventData['id'] . " AND property = '" . serendipity_db_escape_string($prop_key) . "'";
|