| @@ -212,32 +212,8 @@ | ||
| 212 | 212 | die($message); |
| 213 | 213 | } /* wp_die() */ |
| 214 | 214 | } /* if */ |
| 215 | 215 | |
| 216 | -if (!function_exists('add_post_meta')) { | |
| 217 | - function add_post_meta ($postId, $key, $value, $unique) { | |
| 218 | - global $wpdb; | |
| 219 | - | |
| 220 | - $postId = (int) $postId; | |
| 221 | - $key = $wpdb->escape($key); | |
| 222 | - $value = $wpdb->escape($value); | |
| 223 | - | |
| 224 | - $result = $wpdb->query(" | |
| 225 | - INSERT INTO $wpdb->postmeta | |
| 226 | - SET | |
| 227 | - post_id='$postId', | |
| 228 | - meta_key='$key', | |
| 229 | - meta_value='$value' | |
| 230 | - "); | |
| 231 | - if (!$result) : | |
| 232 | - $err = mysql_error(); | |
| 233 | - if (FEEDWORDPRESS_DEBUG) : | |
| 234 | - echo "[DEBUG:".date('Y-m-d H:i:S')."][feedwordpress]: post metadata insertion FAILED for field '$key' := '$value': [$err]"; | |
| 235 | - endif; | |
| 236 | - endif; | |
| 237 | - } /* add_post_meta() */ | |
| 238 | -} /* if */ | |
| 239 | - | |
| 240 | 216 | function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selected_cats = false) { |
| 241 | 217 | if (function_exists('wp_category_checklist')) : |
| 242 | 218 | wp_category_checklist($post_id, $descendents_and_self, $selected_cats); |
| 243 | 219 | else : |
| @@ -282,9 +258,9 @@ | ||
| 282 | 258 | if (get_option('feedwordpress_version') != FEEDWORDPRESS_VERSION) : |
| 283 | 259 | echo "<div class=\"wrap\">\n"; |
| 284 | 260 | echo "<h2>Upgrading FeedWordPress...</h2>"; |
| 285 | 261 | |
| 286 | - $feedwordpress = new FeedWordPress; | |
| 262 | + $feedwordpress =& new FeedWordPress; | |
| 287 | 263 | $feedwordpress->upgrade_database($ver); |
| 288 | 264 | echo "<p><strong>Done!</strong> Upgraded database to version ".FEEDWORDPRESS_VERSION.".</p>\n"; |
| 289 | 265 | echo "<form action=\"\" method=\"get\">\n"; |
| 290 | 266 | echo "<div class=\"submit\"><input type=\"hidden\" name=\"page\" value=\"syndication.php\" />"; |