Changeset 8116
- Timestamp:
- 06/18/2008 01:59:40 AM (18 years ago)
- Location:
- branches/crazyhorse
- Files:
-
- 10 edited
- 1 copied
-
wp-admin/css/dashboard-rtl.css (modified) (2 diffs)
-
wp-admin/css/press-this.css (modified) (2 diffs)
-
wp-admin/edit-category-form.php (modified) (1 diff)
-
wp-admin/images/loading-publish.gif (copied) (copied from trunk/wp-admin/images/loading-publish.gif)
-
wp-admin/press-this.php (modified) (13 diffs)
-
wp-admin/rtl.css (modified) (1 diff)
-
wp-content/plugins/hello.php (modified) (1 diff)
-
wp-includes/bookmark-template.php (modified) (1 diff)
-
wp-includes/classes.php (modified) (2 diffs)
-
wp-includes/link-template.php (modified) (1 diff)
-
xmlrpc.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/crazyhorse/wp-admin/css/dashboard-rtl.css
r7494 r8116 12 12 float: left; 13 13 margin: 1px 0 0 6px; 14 } 15 16 div.dashboard-widget-holder { 17 float: right; 14 18 } 15 19 … … 57 61 margin:0 0 0.2em 0.5em; 58 62 } 63 #dashboard_secondary div.dashboard-widget-content ul li { 64 float: right; 65 } 59 66 #dashboard_secondary div.dashboard-widget-content ul li a { 60 67 border-right:0 none; -
branches/crazyhorse/wp-admin/css/press-this.css
r8103 r8116 112 112 font-size: 11px; 113 113 } 114 #newtag { padding: 3px; }114 #newtag { width: 60%; padding: 3px; } 115 115 116 116 #wphead { … … 453 453 margin-bottom: 8px; 454 454 } 455 456 #post_status { 457 margin-left: 10px; 458 margin-bottom: 1em; 459 display: block; 460 } -
branches/crazyhorse/wp-admin/edit-category-form.php
r7896 r8116 38 38 <th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th> 39 39 <td> 40 <?php wp_dropdown_categories( 'hide_empty=0&name=category_parent&orderby=name&selected=' . $category->parent . '&hierarchical=1&show_option_none=' . __('None')); ?><br />40 <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br /> 41 41 <?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?> 42 42 </td> -
branches/crazyhorse/wp-admin/press-this.php
r8103 r8116 7 7 function press_it() { 8 8 #define some basic variables 9 $quick['post_status'] = 'publish';9 $quick['post_status'] = $_REQUEST['post_status']; 10 10 $quick['post_category'] = $_REQUEST['post_category']; 11 11 $quick['tags_input'] = $_REQUEST['tags_input']; … … 43 43 } 44 44 # set the post_content 45 $quick['post_content'] = $content;45 $quick['post_content'] = str_replace('<br />', "\n", preg_replace('/<\/?p>/','',$content)); 46 46 47 47 #error handling for $post … … 57 57 return $post_ID; 58 58 } 59 60 61 function category_div() { ?>62 <div id="categories">63 <div class="submitbox" id="submitpost">64 <div id="previewview"></div>65 <div class="inside">66 <h2><?php _e('Categories') ?></h2>67 <div id="categories-all">68 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">69 <?php wp_category_checklist() ?>70 </ul>71 </div>72 <h2><?php _e('Tags') ?></h2>73 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>74 <div id="tagchecklist"></div>75 76 </div>77 <p class="submit">78 <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>79 <img src="images/loading-publish.gif" alt="" id="photo_saving" style="display:none;"/>80 </p>81 </div>82 <?php }83 59 84 60 # For submitted posts. … … 111 87 // Ajax Requests 112 88 $title = wp_specialchars(stripslashes($_GET['t'])); 113 $selection = trim( wp_specialchars(str_replace("\n", ' ',stripslashes($_GET['s']))));114 $url = $_GET['u'];89 $selection = trim(str_replace('\\n', "<br />", wp_specialchars(js_escape($_GET['s'])))); 90 $url = clean_url($_GET['u']); 115 91 $image = $_GET['i']; 116 92 if($_REQUEST['ajax'] == 'thickbox') { ?> … … 131 107 image_selector(); 132 108 }); 133 134 109 </script> 135 110 <h3 id="title"><label for="post_title"><?php _e('Description') ?></label></h3> … … 155 130 156 131 if($_REQUEST['ajax'] == 'photo_images') { 157 error_log('photo images');158 132 function get_images_from_uri($uri) { 159 133 if(preg_match('/\.(jpg|png|gif)/', $uri)) 160 134 return "'".$uri."'"; 161 135 162 136 $content = wp_remote_fopen($uri); 137 if ( false === $content ) return ''; 138 163 139 $host = parse_url($uri); 164 165 if ( false === $content ) return '';166 140 167 141 $pattern = '/<img ([^>]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/is'; 168 142 preg_match_all($pattern, $content, $matches); 169 if ( empty($matches[1]) ) { error_log('empty'); return ''; }; 143 144 if ( empty($matches[1]) ) return ''; 145 170 146 $sources = array(); 171 172 147 foreach ($matches[3] as $src) { 173 error_log($src); 174 #if ( false !== strpos($src, '&') ) continue; 175 if(strpos($src, 'http') === false) { 176 if(strpos($src, '../') === false && strpos($src, './') === false) { 177 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 178 } else { 179 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); 180 } 181 } 182 183 $sources[] = $src; 148 if(strpos($src, 'http') === false) 149 if(strpos($src, '../') === false && strpos($src, './') === false) 150 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 151 else 152 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); 153 154 $sources[] = $src; 184 155 } 185 156 return "'" . implode("','", $sources) . "'"; … … 227 198 if (img.width * img.height < 2500) skip = true; 228 199 aspect = img.width / img.height; 229 if (aspect > 1) { // Image is wide 230 scale = 75 / img.width; 231 } else { // Image is tall or square 232 scale = 75 / img.height; 233 } 200 scale = (aspect > 1) ? (75 / img.width) : (75 / img.height); 201 234 202 if (scale < 1) { 235 203 w = parseInt(img.width * scale); … … 253 221 254 222 if($_REQUEST['ajax'] == 'photo') { ?> 255 256 223 <div class="photolist"></div> 257 258 224 <small><?php _e('Click images to select:') ?></small> 259 225 <div class="titlewrap"> … … 261 227 </div> 262 228 <?php die; } 263 264 229 ?> 265 230 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 318 283 tab_focus : ":next", 319 284 plugins : "safari,inlinepopups", 320 entities : "38,amp,60,lt,62,gt" 285 entities : "38,amp,60,lt,62,gt", 286 force_p_newlines : true 321 287 }); 322 288 <?php } ?> … … 350 316 } 351 317 function set_editor(text) { 318 352 319 if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent(''); 353 320 if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text); … … 370 337 set_menu('text'); 371 338 set_title('<?php _e('Text') ?>'); 372 <?php if($selection) { ?> 373 set_editor('<?php echo '<p><a href="'.$url.'">'.$selection.'</a> </p> '; ?>'); 374 <?php } else { ?> 375 set_editor('<?php echo '<p><a href="'.$url.'">'.$title.'</a> </p> '; ?>'); 376 <?php } ?> 339 377 340 return false; 378 341 break; … … 500 463 501 464 </div> 502 <?php category_div(); ?> 465 <div id="categories"> 466 <div class="submitbox" id="submitpost"> 467 <div id="previewview"></div> 468 <div class="inside"> 469 <h2><?php _e('Categories') ?></h2> 470 <div id="categories-all"> 471 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 472 <?php wp_category_checklist() ?> 473 </ul> 474 </div> 475 <h2><?php _e('Tags') ?></h2> 476 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p> 477 <div id="tagchecklist"></div> 478 </div> 479 <label for="post_status" id="post_status"><input type="radio" name="post_status" value="publish" checked="checked" id="published" />Published <input type="radio" name="post_status" value="draft" id="unpubplished" /> Unpublished</label> 480 481 <p class="submit"> 482 <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> 483 <img src="images/loading-publish.gif" alt="" id="photo_saving" style="display:none;"/> 484 </p> 485 </div> 486 487 503 488 </form> 504 489 -
branches/crazyhorse/wp-admin/rtl.css
r7607 r8116 162 162 #poststuff #media-buttons 163 163 { 164 direction: ltr;164 direction: rtl; 165 165 float:left; 166 166 margin-left:20px; -
branches/crazyhorse/wp-content/plugins/hello.php
r7097 r8116 6 6 Author: Matt Mullenweg 7 7 Version: 1.5 8 Author URI: http:// photomatt.net/8 Author URI: http://ma.tt/ 9 9 */ 10 10 -
branches/crazyhorse/wp-includes/bookmark-template.php
r7990 r8116 204 204 if ( $categorize ) { 205 205 //Split the bookmarks into ul's for each category 206 $cats = get_terms('link_category', array(' category_name' => $category_name, 'include' => $category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0));206 $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); 207 207 208 208 foreach ( (array) $cats as $cat ) { -
branches/crazyhorse/wp-includes/classes.php
r7944 r8116 430 430 ($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend 431 431 432 for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) { 432 $num_elements = sizeof( $children_elements ); 433 for ( $i = 0; $i < $num_elements; $i++ ) { 433 434 434 435 $child = $children_elements[$i]; … … 443 444 444 445 array_splice( $children_elements, $i, 1 ); 446 $num_elements--; 445 447 $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); 446 448 $i = -1; -
branches/crazyhorse/wp-includes/link-template.php
r8069 r8116 612 612 $format = str_replace('%link', $link, $format); 613 613 614 echo $format; 614 $adjacent = $previous ? 'previous' : 'next'; 615 echo apply_filters( "{$adjacent}_post_link", $format, $link ); 615 616 } 616 617 -
branches/crazyhorse/xmlrpc.php
r8103 r8116 128 128 'wp.getPageStatusList' => 'this:wp_getPageStatusList', 129 129 'wp.getPageTemplates' => 'this:wp_getPageTemplates', 130 'wp.getOptions' => 'this:wp_getOptions', 131 'wp.setOptions' => 'this:wp_setOptions', 130 132 131 133 // Blogger API … … 172 174 'demo.addTwoNumbers' => 'this:addTwoNumbers' 173 175 ); 176 177 $this->initialise_blog_option_info( ); 174 178 $this->methods = apply_filters('xmlrpc_methods', $this->methods); 175 179 $this->IXR_Server($this->methods); … … 254 258 } 255 259 } 260 } 261 262 function initialise_blog_option_info( ) { 263 global $wp_version; 264 265 $this->blog_options = array( 266 // Read only options 267 'software_name' => array( 268 'desc' => __( 'Software Name' ), 269 'readonly' => true, 270 'value' => 'WordPress' 271 ), 272 'software_version' => array( 273 'desc' => __( 'Software Version' ), 274 'readonly' => true, 275 'value' => $wp_version 276 ), 277 'blog_url' => array( 278 'desc' => __( 'Blog URL' ), 279 'readonly' => true, 280 'option' => 'siteurl' 281 ), 282 283 // Updatable options 284 'time_zone' => array( 285 'desc' => __( 'Time Zone' ), 286 'readonly' => false, 287 'option' => 'gmt_offset' 288 ), 289 'blog_title' => array( 290 'desc' => __( 'Blog Title' ), 291 'readonly' => false, 292 'option' => 'blogname' 293 ), 294 'blog_tagline' => array( 295 'desc' => __( 'Blog Tagline' ), 296 'readonly' => false, 297 'option' => 'blogdescription' 298 ), 299 'date_format' => array( 300 'desc' => __( 'Date Format' ), 301 'readonly' => false, 302 'option' => 'date_format' 303 ), 304 'time_format' => array( 305 'desc' => __( 'Time Format' ), 306 'readonly' => false, 307 'option' => 'time_format' 308 ) 309 ); 310 311 $this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options ); 256 312 } 257 313 … … 863 919 } 864 920 921 function wp_getOptions( $args ) { 922 $this->escape( $args ); 923 924 $blog_id = (int) $args[0]; 925 $username = $args[1]; 926 $password = $args[2]; 927 $options = (array) $args[3]; 928 929 if( !$this->login_pass_ok( $username, $password ) ) 930 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) ); 931 932 $user = set_current_user( 0, $username ); 933 934 // If no specific options where asked for, return all of them 935 if (count( $options ) == 0 ) { 936 $options = array_keys($this->blog_options); 937 } 938 939 return $this->_getOptions($options); 940 } 941 942 function _getOptions($options) 943 { 944 $data = array( ); 945 foreach( $options as $option ) { 946 if( array_key_exists( $option, $this->blog_options ) ) 947 { 948 $data[$option] = $this->blog_options[$option]; 949 //Is the value static or dynamic? 950 if( isset( $data[$option]['option'] ) ) { 951 $data[$option]['value'] = get_option( $data[$option]['option'] ); 952 unset($data[$option]['option']); 953 } 954 } 955 } 956 957 return $data; 958 } 959 960 function wp_setOptions( $args ) { 961 $this->escape( $args ); 962 963 $blog_id = (int) $args[0]; 964 $username = $args[1]; 965 $password = $args[2]; 966 $options = (array) $args[3]; 967 968 if( !$this->login_pass_ok( $username, $password ) ) 969 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) ); 970 971 $user = set_current_user( 0, $username ); 972 if( !current_user_can( 'manage_options' ) ) 973 return new IXR_Error( 403, __( 'You are not allowed to update options.' ) ); 974 975 foreach( $options as $o_name => $o_value ) { 976 $option_names[] = $o_name; 977 if( empty( $o_value ) ) 978 continue; 979 980 if( !array_key_exists( $o_name, $this->blog_options ) ) 981 continue; 982 983 if( $this->blog_options[$o_name]['readonly'] == true ) 984 continue; 985 986 update_option( $this->blog_options[$o_name]['option'], $o_value ); 987 } 988 989 //Now return the updated values 990 return $this->_getOptions($option_names); 991 } 865 992 866 993 /* Blogger API functions
Note: See TracChangeset
for help on using the changeset viewer.