| @@ -212,11 +212,63 @@ | ||
| 212 | 212 | die($message); |
| 213 | 213 | } /* wp_die() */ |
| 214 | 214 | } /* if */ |
| 215 | 215 | |
| 216 | -function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selected_cats = false) { | |
| 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 | +if (!function_exists('disabled')) { | |
| 241 | + /** | |
| 242 | + * Outputs the html disabled attribute. | |
| 243 | + * | |
| 244 | + * Compares the first two arguments and if identical marks as disabled | |
| 245 | + * | |
| 246 | + * @since 3.0.0 | |
| 247 | + * | |
| 248 | + * @param mixed $disabled One of the values to compare | |
| 249 | + * @param mixed $current (true) The other value to compare if not just true | |
| 250 | + * @param bool $echo Whether to echo or just return the string | |
| 251 | + * @return string html attribute or empty string | |
| 252 | + */ | |
| 253 | + function disabled( $disabled, $current = true, $echo = true ) { | |
| 254 | + return __checked_selected_helper( $disabled, $current, $echo, 'disabled' ); | |
| 255 | + } | |
| 256 | +} /* if */ | |
| 257 | + | |
| 258 | +require_once(dirname(__FILE__).'/feedwordpress-walker-category-checklist.class.php'); | |
| 259 | + | |
| 260 | +function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selected_cats = false, $prefix = '') { | |
| 217 | 261 | if (function_exists('wp_category_checklist')) : |
| 218 | - wp_category_checklist($post_id, $descendents_and_self, $selected_cats); | |
| 262 | + $walker = new FeedWordPress_Walker_Category_Checklist; | |
| 263 | + $walker->set_prefix($prefix); | |
| 264 | + wp_category_checklist( | |
| 265 | + /*post_id=*/ $post_id, | |
| 266 | + /*descendents_and_self=*/ $descendents_and_self, | |
| 267 | + /*selected_cats=*/ $selected_cats, | |
| 268 | + /*popular_cats=*/ false, | |
| 269 | + /*walker=*/ $walker | |
| 270 | + ); | |
| 219 | 271 | else : |
| 220 | 272 | // selected_cats is an array of integer cat_IDs / term_ids for |
| 221 | 273 | // the categories that should be checked |
| 222 | 274 | global $post_ID; |
| @@ -258,9 +310,9 @@ | ||
| 258 | 310 | if (get_option('feedwordpress_version') != FEEDWORDPRESS_VERSION) : |
| 259 | 311 | echo "<div class=\"wrap\">\n"; |
| 260 | 312 | echo "<h2>Upgrading FeedWordPress...</h2>"; |
| 261 | 313 | |
| 262 | - $feedwordpress =& new FeedWordPress; | |
| 314 | + $feedwordpress = new FeedWordPress; | |
| 263 | 315 | $feedwordpress->upgrade_database($ver); |
| 264 | 316 | echo "<p><strong>Done!</strong> Upgraded database to version ".FEEDWORDPRESS_VERSION.".</p>\n"; |
| 265 | 317 | echo "<form action=\"\" method=\"get\">\n"; |
| 266 | 318 | echo "<div class=\"submit\"><input type=\"hidden\" name=\"page\" value=\"syndication.php\" />"; |