| @@ -1,7 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | function fwp_linkedit_single_submit ($status = NULL) { |
| 3 | - if (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_27)) : | |
| 3 | + global $wp_db_version; | |
| 4 | + if (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25) : | |
| 4 | 5 | ?> |
| 5 | 6 | <div class="submitbox" id="submitlink"> |
| 6 | 7 | <div id="previewview"></div> |
| 7 | 8 | <div class="inside"> |
| @@ -31,9 +32,10 @@ | ||
| 31 | 32 | endif; |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | function fwp_linkedit_periodic_submit ($caption = NULL) { |
| 35 | - if (!fwp_test_wp_version(FWP_SCHEMA_25)) : | |
| 36 | + global $wp_db_version; | |
| 37 | + if (!(isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25)) : | |
| 36 | 38 | if (is_null($caption)) : $caption = __('Save Changes »'); endif; |
| 37 | 39 | ?> |
| 38 | 40 | <p class="submit"> |
| 39 | 41 | <input type="submit" name="submit" value="<?php print $caption; ?>" /> |
| @@ -41,38 +43,8 @@ | ||
| 41 | 43 | <?php |
| 42 | 44 | endif; |
| 43 | 45 | } |
| 44 | 46 | |
| 45 | -function fwp_linkedit_single_submit_closer ($caption = NULL) { | |
| 46 | - if (fwp_test_wp_version(FWP_SCHEMA_27)) : | |
| 47 | - if (is_null($caption)) : $caption = __('Save Changes'); endif; | |
| 48 | -?> | |
| 49 | -<p class="submit"> | |
| 50 | -<input class="button-primary" type="submit" name="submit" value="<?php print $caption; ?>" /> | |
| 51 | -</p> | |
| 52 | -<?php | |
| 53 | - endif; | |
| 54 | -} | |
| 55 | - | |
| 56 | -function fwp_authors_single_submit ($link = NULL) { | |
| 57 | - global $wp_db_version; | |
| 58 | - | |
| 59 | - if (fwp_test_wp_version(FWP_SCHEMA_25)) : | |
| 60 | -?> | |
| 61 | -<div class="submitbox" id="submitlink"> | |
| 62 | -<div id="previewview"> | |
| 63 | -</div> | |
| 64 | -<div class="inside"> | |
| 65 | -</div> | |
| 66 | - | |
| 67 | -<p class="submit"> | |
| 68 | -<input type="submit" name="save" value="<?php _e('Save') ?>" /> | |
| 69 | -</p> | |
| 70 | -</div> | |
| 71 | -<?php | |
| 72 | - endif; | |
| 73 | -} | |
| 74 | - | |
| 75 | 47 | function fwp_option_box_opener ($legend, $id, $class = "stuffbox") { |
| 76 | 48 | global $wp_db_version; |
| 77 | 49 | if (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25) : |
| 78 | 50 | ?> |
| @@ -117,9 +89,9 @@ | ||
| 117 | 89 | |
| 118 | 90 | function fwp_category_box ($checked, $object, $tags = array()) { |
| 119 | 91 | global $wp_db_version; |
| 120 | 92 | |
| 121 | - if (fwp_test_wp_version(FWP_SCHEMA_25)) : // WordPress 2.5.x | |
| 93 | + if (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25) : // WordPress 2.5.x | |
| 122 | 94 | ?> |
| 123 | 95 | <div id="category-adder" class="wp-hidden-children"> |
| 124 | 96 | <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4> |
| 125 | 97 | <p id="category-add" class="wp-hidden-child"> |
| @@ -142,9 +114,9 @@ | ||
| 142 | 114 | <?php fwp_category_checklist(NULL, false, $checked) ?> |
| 143 | 115 | </ul> |
| 144 | 116 | </div> |
| 145 | 117 | <?php |
| 146 | - elseif (fwp_test_wp_version(FWP_SCHEMA_20)) : // WordPress 2.x | |
| 118 | + elseif (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_20) : // WordPress 2.x | |
| 147 | 119 | ?> |
| 148 | 120 | <div id="moremeta"> |
| 149 | 121 | <div id="grabit" class="dbx-group"> |
| 150 | 122 | <fieldset id="categorydiv" class="dbx-box"> |
| @@ -151,10 +123,9 @@ | ||
| 151 | 123 | <h3 class="dbx-handle"><?php _e('Categories') ?></h3> |
| 152 | 124 | <div class="dbx-content"> |
| 153 | 125 | <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p> |
| 154 | 126 | <p id="jaxcat"></p> |
| 155 | - <div id="categorychecklist"><?php fwp_category_checklist(NULL, false, $checked); ?></div> | |
| 156 | - </div> | |
| 127 | + <ul id="categorychecklist"><?php fwp_category_checklist(NULL, false, $checked); ?></ul></div> | |
| 157 | 128 | </fieldset> |
| 158 | 129 | </div> |
| 159 | 130 | </div> |
| 160 | 131 | <?php |
| @@ -159,12 +130,12 @@ | ||
| 159 | 130 | </div> |
| 160 | 131 | <?php |
| 161 | 132 | else : // WordPress 1.5 |
| 162 | 133 | ?> |
| 163 | - <fieldset style="width: 60%;"> | |
| 134 | + <fieldset id="categorydiv" style="width: 20%; margin-right: 2em"> | |
| 164 | 135 | <legend><?php _e('Categories') ?></legend> |
| 165 | 136 | <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p> |
| 166 | - <div style="height: 10em; overflow: scroll;"><?php fwp_category_checklist(NULL, false, $checked); ?></div> | |
| 137 | + <div style="height: 20em"><?php fwp_category_checklist(NULL, false, $checked); ?></div> | |
| 167 | 138 | </fieldset> |
| 168 | 139 | <?php |
| 169 | 140 | endif; |
| 170 | 141 | } |
| @@ -170,34 +141,20 @@ | ||
| 170 | 141 | } |
| 171 | 142 | |
| 172 | 143 | function update_feeds_mention ($feed) { |
| 173 | 144 | echo "<li>Updating <cite>".$feed['link/name']."</cite> from <<a href=\"" |
| 174 | - .$feed['link/uri']."\">".$feed['link/uri']."</a>> ..."; | |
| 145 | + .$feed['link/uri']."\">".$feed['link/uri']."</a>> ...</li>\n"; | |
| 175 | 146 | flush(); |
| 176 | 147 | } |
| 177 | -function update_feeds_finish ($feed, $added, $dt) { | |
| 178 | - echo " completed in $dt second".(($dt==1)?'':'s')."</li>\n"; | |
| 179 | -} | |
| 180 | 148 | |
| 181 | 149 | function fwp_author_list () { |
| 182 | 150 | global $wpdb; |
| 183 | 151 | $ret = array(); |
| 184 | - | |
| 185 | - // display_name introduced in WP 2.0 | |
| 186 | - if (fwp_test_wp_version(FWP_SCHEMA_20)) : | |
| 187 | - $name_column = 'display_name'; | |
| 188 | - else : | |
| 189 | - $name_column = 'user_nickname'; | |
| 190 | - endif; | |
| 191 | - | |
| 192 | - $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY {$name_column}"); | |
| 152 | + $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY display_name"); | |
| 193 | 153 | if (is_array($users)) : |
| 194 | 154 | foreach ($users as $user) : |
| 195 | 155 | $id = (int) $user->ID; |
| 196 | - $ret[$id] = $user->{$name_column}; | |
| 197 | - if (strlen(trim($ret[$id])) == 0) : | |
| 198 | - $ret[$id] = $user->user_login; | |
| 199 | - endif; | |
| 156 | + $ret[$id] = $user->display_name; | |
| 200 | 157 | endforeach; |
| 201 | 158 | endif; |
| 202 | 159 | return $ret; |
| 203 | 160 | } |