Changeset 6025
- Timestamp:
- 09/03/2007 11:19:20 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/jkw.php
r5984 r6025 2 2 3 3 class JeromesKeyword_Import { 4 4 5 5 function header() { 6 6 echo '<div class="wrap">'; … … 30 30 } 31 31 32 32 33 33 function dispatch () { 34 34 if ( empty( $_GET['step'] ) ) { … … 37 37 $step = (int) $_GET['step']; 38 38 } 39 39 40 40 // load the header 41 41 $this->header(); 42 42 43 43 switch ( $step ) { 44 44 case 0 : … … 69 69 break; 70 70 } 71 71 72 72 // load the footer 73 73 $this->footer(); 74 74 } 75 76 75 76 77 77 function check_V1_post_keyword ( $precheck = true ) { 78 78 global $wpdb; 79 79 80 80 echo '<div class="narrow">'; 81 81 echo '<p><h3>'.__('Reading Jerome’s Keywords Tags…').'</h3></p>'; 82 82 83 83 // import Jerome's Keywords tags 84 84 $qry = "SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'"; … … 114 114 115 115 } 116 116 117 117 echo '<form action="admin.php?import=jkw&step='.($precheck? 2:6).'" method="post">'; 118 118 wp_nonce_field('import-jkw'); … … 125 125 function check_V2_post_keyword ( $precheck = true ) { 126 126 global $wpdb; 127 127 128 128 echo '<div class="narrow">'; 129 129 echo '<p><h3>'.__('Reading Jerome’s Keywords Tags…').'</h3></p>'; 130 130 131 131 // import Jerome's Keywords tags 132 132 $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); … … 140 140 $count = count($metakeys); 141 141 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>'; 142 142 143 143 echo '<ul>'; 144 144 145 145 foreach($metakeys as $post_meta) { 146 146 $keyword = addslashes(trim($post_meta->tag_name)); 147 147 148 148 if ($keyword != ''){ 149 149 echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>'; … … 157 157 158 158 } 159 159 160 160 echo '<form action="admin.php?import=jkw&step='.($precheck? 4:5).'" method="post">'; 161 161 wp_nonce_field('import-jkw'); … … 175 175 'query_varname' => 'tag', // HTTP var name used for tag searches 176 176 'template' => 'keywords.php', // template file to use for displaying tag queries 177 177 178 178 'meta_always_include' => '', // meta keywords to always include 179 179 'meta_includecats' => 'default', // default' => include cats in meta keywords only for home page 180 180 // all' => includes cats on every page, none' => never included 181 181 182 182 'meta_autoheader' => '1', // automatically output meta keywords in header 183 183 'search_strict' => '1', // returns only exact tag matches if true 184 184 'use_feed_cats' => '1', // insert tags into feeds as categories 185 185 186 186 /* post tag options */ 187 187 'post_linkformat' => '', // post tag format (initialized to $link_localsearch) … … 189 189 'post_includecats' => '0', // include categories in post's tag list 190 190 'post_notagstext' => 'none', // text to display if no tags found 191 191 192 192 /* tag cloud options */ 193 193 'cloud_linkformat' => '', // post tag format (initialized to $link_tagcloud) … … 200 200 'cloud_scalemin' => '0' // minimum value for count scaling 201 201 ); 202 202 203 203 $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); 204 204 205 205 $wpdb->query('DROP TABLE IF EXISTS ' . $tablename); 206 206 207 207 foreach($options as $optname => $optval) { 208 208 delete_option('jkeywords_' . $optname); 209 209 } 210 210 211 211 $this->done(); 212 212 } 213 214 213 214 215 215 function done ( ) { 216 216 echo '<div class="narrow">'; … … 218 218 echo '</div>'; 219 219 } 220 220 221 221 222 222 function JeromesKeyword_Import ( ) { 223 223 224 224 // Nothing. 225 226 } 227 225 226 } 227 228 228 } 229 229 -
trunk/wp-admin/import/utw.php
r5941 r6025 32 32 $step = (int) $_GET['step']; 33 33 } 34 34 35 35 if ( $step > 1 ) 36 36 check_admin_referer('import-utw'); -
trunk/wp-admin/includes/misc.php
r5809 r6025 98 98 function save_mod_rewrite_rules() { 99 99 global $wp_rewrite; 100 100 101 101 $home_path = get_home_path(); 102 102 $htaccess_file = $home_path.'.htaccess'; … … 110 110 } 111 111 } 112 112 113 113 return false; 114 114 } -
trunk/wp-admin/includes/upgrade.php
r5943 r6025 616 616 $slug = sanitize_title($name); 617 617 $term_group = 0; 618 618 619 619 // Associate terms with the same slug in a term group and make slugs unique. 620 620 if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) { -
trunk/wp-app.php
r6010 r6025 128 128 $this->redirect($this->get_service_url()); 129 129 } 130 130 131 131 // dispatch 132 132 foreach($this->selectors as $regex => $funcs) { … … 221 221 222 222 $entry = array_pop($parser->feed->entries); 223 223 224 224 log_app('Received entry:', print_r($entry,true)); 225 225 226 226 $catnames = array(); 227 227 foreach($entry->categories as $cat) 228 228 array_push($catnames, $cat["term"]); 229 229 230 230 $wp_cats = get_categories(array('hide_empty' => false)); 231 231 232 232 $post_category = array(); 233 233 234 234 foreach($wp_cats as $cat) { 235 235 if(in_array($cat->cat_name, $catnames)) … … 253 253 $post_date = $pubtimes[0]; 254 254 $post_date_gmt = $pubtimes[1]; 255 255 256 256 if ( isset( $_SERVER['HTTP_SLUG'] ) ) 257 257 $post_name = $_SERVER['HTTP_SLUG']; … … 1114 1114 1115 1115 function rfc3339_str2time($str) { 1116 1116 1117 1117 $match = false; 1118 1118 if(!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match)) 1119 1119 return false; 1120 1120 1121 1121 if($match[3] == 'Z') 1122 1122 $match[3] == '+0000'; 1123 1123 1124 1124 return strtotime($match[1] . " " . $match[2] . " " . $match[3]); 1125 1125 } … … 1128 1128 1129 1129 $pubtime = $this->rfc3339_str2time($entry->published); 1130 1130 1131 1131 if(!$pubtime) { 1132 1132 return array(current_time('mysql'),current_time('mysql',1)); -
trunk/wp-includes/atomlib.php
r6010 r6025 48 48 49 49 function AtomParser() { 50 50 51 51 $this->feed = new AtomFeed(); 52 52 $this->current = null; … … 88 88 while ($data = fread($fp, 4096)) { 89 89 if($this->debug) $this->content .= $data; 90 90 91 91 if(!xml_parse($parser, $data, feof($fp))) { 92 92 trigger_error(sprintf(__('XML error: %s at line %d')."\n", -
trunk/wp-includes/bookmark.php
r5997 r6025 9 9 10 10 $link = sanitize_bookmark($link, $filter); 11 11 12 12 if ( $output == OBJECT ) { 13 13 return $link; -
trunk/wp-includes/feed.php
r6001 r6025 187 187 188 188 $tag = get_tag($tag_id); 189 189 190 190 if ( empty($tag) || is_wp_error($tag) ) 191 191 return false; 192 192 193 193 $permalink_structure = get_option('permalink_structure'); 194 194 -
trunk/wp-includes/functions.php
r6008 r6025 407 407 return false; 408 408 } 409 409 410 410 if ( extension_loaded( 'zlib' ) ) { 411 411 ob_start( 'ob_gzhandler' ); -
trunk/wp-includes/general-template.php
r6024 r6025 148 148 strpos($show, 'home') === false) 149 149 $url = false; 150 150 151 151 if ( 'display' == $filter ) { 152 152 if ( $url ) -
trunk/wp-includes/plugin.php
r5958 r6025 287 287 { 288 288 global $wp_filter; 289 289 290 290 // If function then just skip all of the tests and not overwrite the following. 291 291 // Static Calling -
trunk/wp-includes/query.php
r6022 r6025 422 422 $array_keys = array('category__in', 'category__not_in', 'category__and', 423 423 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and'); 424 424 425 425 foreach ( $array_keys as $key ) { 426 426 if ( !isset($array[$key])) -
trunk/wp-includes/rss.php
r5859 r6025 828 828 if ( $rss = fetch_rss( $url ) ) { 829 829 echo '<ul>'; 830 830 831 831 if ( $num_items !== -1 ) { 832 832 $rss->items = array_slice( $rss->items, 0, $num_items ); 833 833 } 834 834 835 835 foreach ( $rss->items as $item ) { 836 836 printf( … … 841 841 ); 842 842 } 843 843 844 844 echo '</ul>'; 845 845 } else { -
trunk/wp-includes/update.php
r5900 r6025 9 9 global $wp_version; 10 10 $php_version = phpversion(); 11 11 12 12 $current = get_option( 'update_core' ); 13 13 $locale = get_locale(); … … 36 36 $response .= fgets( $fs, 1160 ); // One TCP-IP packet 37 37 fclose( $fs ); 38 38 39 39 $response = explode("\r\n\r\n", $response, 2); 40 40 $body = trim( $response[1] ); 41 41 $body = str_replace(array("\r\n", "\r"), "\n", $body); 42 42 43 43 $returns = explode("\n", $body); 44 44 -
trunk/wp-includes/widgets.php
r5973 r6025 607 607 extract($args); 608 608 $options = get_option('widget_categories'); 609 609 610 610 $c = $options[$number]['count'] ? '1' : '0'; 611 611 $h = $options[$number]['hierarchical'] ? '1' : '0'; 612 612 $d = $options[$number]['dropdown'] ? '1' : '0'; 613 613 614 614 $title = empty($options[$number]['title']) ? __('Categories') : $options[$number]['title']; 615 615 … … 647 647 function wp_widget_categories_control( $number ) { 648 648 $options = $newoptions = get_option('widget_categories'); 649 649 650 650 if ( !is_array( $options ) ) { 651 651 $options = $newoptions = get_option( 'widget_categories' ); 652 652 } 653 653 654 654 if ( $_POST['categories-submit-' . $number] ) { 655 655 $newoptions[$number]['count'] = isset($_POST['categories-count-' . $number]); … … 658 658 $newoptions[$number]['title'] = strip_tags(stripslashes($_POST['categories-title-' . $number])); 659 659 } 660 660 661 661 if ( $options != $newoptions ) { 662 662 $options = $newoptions; 663 663 update_option('widget_categories', $options); 664 664 } 665 665 666 666 $title = attribute_escape( $options[$number]['title'] ); 667 667 ?> … … 669 669 <?php _e( 'Title:' ); ?> <input style="width:300px" id="categories-title-<?php echo $number; ?>" name="categories-title-<?php echo $number; ?>" type="text" value="<?php echo $title; ?>" /> 670 670 </label></p> 671 671 672 672 <p><label for="categories-dropdown-<?php echo $number; ?>"> 673 673 <input type="checkbox" class="checkbox" id="categories-dropdown-<?php echo $number; ?>" name="categories-dropdown-<?php echo $number; ?>"<?php echo $options[$number]['dropdown'] ? ' checked="checked"' : ''; ?> /> <?php _e( 'Show as dropdown' ); ?> 674 674 </label></p> 675 675 676 676 <p><label for="categories-count-<?php echo $number; ?>"> 677 677 <input type="checkbox" class="checkbox" id="categories-count-<?php echo $number; ?>" name="categories-count-<?php echo $number; ?>"<?php echo $options[$number]['count'] ? ' checked="checked"' : ''; ?> /> <?php _e( 'Show post counts' ); ?> 678 678 </label></p> 679 679 680 680 <p><label for="categories-hierarchical-<?php echo $number; ?>"> 681 681 <input type="checkbox" class="checkbox" id="categories-hierarchical-<?php echo $number; ?>" name="categories-hierarchical-<?php echo $number; ?>"<?php echo $options[$number]['hierarchical'] ? ' checked="checked"' : ''; ?> /> <?php _e( 'Show hierarchy' ); ?> 682 682 </label></p> 683 683 684 684 <input type="hidden" id="categories-submit-<?php echo $number; ?>" name="categories-submit-<?php echo $number; ?>" value="1" /> 685 685 <?php … … 688 688 function wp_widget_categories_setup() { 689 689 $options = $newoptions = get_option( 'widget_categories' ); 690 690 691 691 if ( isset( $_POST['categories-number-submit'] ) ) { 692 692 $number = (int) $_POST['categories-number']; 693 693 694 694 if ( $number > 9 ) { 695 695 $number = 9; … … 697 697 $number = 1; 698 698 } 699 699 700 700 $newoptions['number'] = $number; 701 701 } 702 702 703 703 if ( $newoptions != $options ) { 704 704 $options = $newoptions; … … 771 771 $options = wp_widget_categories_upgrade(); 772 772 $number = (int) $options['number']; 773 773 774 774 if ( $number > 9 ) { 775 775 $number = 9; … … 777 777 $number = 1; 778 778 } 779 779 780 780 $dims = array( 'width' => 350, 'height' => 170 ); 781 781 $class = array( 'classname' => 'widget_catgories' ); 782 782 783 783 for ( $i = 1; $i <= 9; $i++ ) { 784 784 $name = sprintf( __( 'Categories %d' ), $i ); 785 785 $id = 'categories-' . $i; 786 786 787 787 $widget_callback = ( $i <= $number ) ? 'wp_widget_categories' : ''; 788 788 $control_callback = ( $i <= $number ) ? 'wp_widget_categories_control' : ''; 789 789 790 790 wp_register_sidebar_widget( $id, $name, $widget_callback, $class, $i ); 791 791 wp_register_widget_control( $id, $name, $control_callback, $dims, $i ); 792 792 } 793 793 794 794 add_action( 'sidebar_admin_setup', 'wp_widget_categories_setup' ); 795 795 add_action( 'sidebar_admin_page', 'wp_widget_categories_page' ); … … 986 986 echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>'; 987 987 } 988 988 989 989 echo $after_widget; 990 990 } … … 1080 1080 1081 1081 $GLOBALS['wp_register_widget_defaults'] = true; 1082 1082 1083 1083 $dims90 = array( 'height' => 90, 'width' => 300 ); 1084 1084 $dims100 = array( 'height' => 100, 'width' => 300 ); 1085 1085 $dims150 = array( 'height' => 150, 'width' => 300 ); 1086 1086 1087 1087 $class = array('classname' => 'widget_pages'); 1088 1088 wp_register_sidebar_widget('pages', __('Pages'), 'wp_widget_pages', $class); 1089 1089 wp_register_widget_control('pages', __('Pages'), 'wp_widget_pages_control', $dims150); 1090 1090 1091 1091 $class['classname'] = 'widget_calendar'; 1092 1092 wp_register_sidebar_widget('calendar', __('Calendar'), 'wp_widget_calendar', $class); 1093 1093 wp_register_widget_control('calendar', __('Calendar'), 'wp_widget_calendar_control', $dims90); 1094 1094 1095 1095 $class['classname'] = 'widget_archives'; 1096 1096 wp_register_sidebar_widget('archives', __('Archives'), 'wp_widget_archives', $class); 1097 1097 wp_register_widget_control('archives', __('Archives'), 'wp_widget_archives_control', $dims100); 1098 1098 1099 1099 $class['classname'] = 'widget_links'; 1100 1100 wp_register_sidebar_widget('links', __('Links'), 'wp_widget_links', $class); 1101 1101 1102 1102 $class['classname'] = 'widget_meta'; 1103 1103 wp_register_sidebar_widget('meta', __('Meta'), 'wp_widget_meta', $class); 1104 1104 wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control', $dims90); 1105 1105 1106 1106 $class['classname'] = 'widget_search'; 1107 1107 wp_register_sidebar_widget('search', __('Search'), 'wp_widget_search', $class); 1108 1108 1109 1109 $class['classname'] = 'widget_recent_entries'; 1110 1110 wp_register_sidebar_widget('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries', $class); 1111 1111 wp_register_widget_control('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries_control', $dims90); 1112 1112 1113 1113 wp_widget_categories_register(); 1114 1114 wp_widget_text_register(); -
trunk/wp-settings.php
r6017 r6025 43 43 else 44 44 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; 45 45 46 46 // Append the query string if it exists and isn't null 47 47 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
Note: See TracChangeset
for help on using the changeset viewer.