Changeset 514819
- Timestamp:
- 03/05/2012 05:54:01 PM (14 years ago)
- Location:
- wp-html-sitemap/trunk
- Files:
-
- 11 edited
-
css/sitemap.css (modified) (1 diff)
-
css/style.css (modified) (1 diff)
-
inc/AdminPage.php (modified) (1 diff)
-
inc/Exception.php (modified) (1 diff)
-
inc/Map.php (modified) (1 diff)
-
inc/Options.php (modified) (6 diffs)
-
inc/SitemapShortcode.php (modified) (3 diffs)
-
inc/Utilities.php (modified) (1 diff)
-
js/wp-html-sitemap.options.js (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wp-html-sitemap.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-html-sitemap/trunk/css/sitemap.css
r513643 r514819 1 1 /* 2 WP HTML Sitemap v1. 02 WP HTML Sitemap v1.1 3 3 Contact: Bill Edgar (bill.edgar@oaktondata.com) 4 4 http://www.oaktondata.com/wordpress-html-sitemap -
wp-html-sitemap/trunk/css/style.css
r513643 r514819 1 1 /* 2 WP HTML Sitemap v1. 02 WP HTML Sitemap v1.1 3 3 Contact: Bill Edgar (bill.edgar@oaktondata.com) 4 4 http://www.oaktondata.com/wordpress-html-sitemap -
wp-html-sitemap/trunk/inc/AdminPage.php
r513643 r514819 2 2 3 3 /* 4 WP HTML Sitemap v1. 04 WP HTML Sitemap v1.1 5 5 Contact: Bill Edgar (bill.edgar@oaktondata.com) 6 6 http://www.oaktondata.com/wordpress-html-sitemap -
wp-html-sitemap/trunk/inc/Exception.php
r513643 r514819 2 2 3 3 /* 4 WP HTML Sitemap v1. 04 WP HTML Sitemap v1.1 5 5 Contact: Bill Edgar (bill.edgar@oaktondata.com) 6 6 http://www.oaktondata.com/wordpress-html-sitemap -
wp-html-sitemap/trunk/inc/Map.php
r513643 r514819 2 2 3 3 /* 4 WP HTML Sitemap v1. 04 WP HTML Sitemap v1.1 5 5 Contact: Bill Edgar (bill.edgar@oaktondata.com) 6 6 http://www.oaktondata.com/wordpress-html-sitemap -
wp-html-sitemap/trunk/inc/Options.php
r513643 r514819 2 2 3 3 /* 4 WP HTML Sitemap v1. 04 WP HTML Sitemap v1.1 5 5 Contact: Bill Edgar (bill.edgar@oaktondata.com) 6 6 http://www.oaktondata.com/wordpress-html-sitemap … … 200 200 $this->OPTIONS['wp-html-sitemap-general']['defaults'] = array( 201 201 'title' => 'Sitemap', 202 'name' => ' sitemap',202 'name' => 'html-sitemap', 203 203 'template' => 'default', 204 204 'type' => 'page', … … 226 226 function add_options() { 227 227 228 // load settings from external file 229 $return = $this->load_file_input( 230 $file = WP_HTML_SITEMAP_ADD_OPTIONS, 231 $object = $this, 232 $target = 'settings', 233 $pattern = "/obj=/", 234 $delimiter = "/[\s]+/", 235 $operator = "/=/" 236 ); 228 try { 229 // load settings from external file 230 $return = $this->load_file_input( 231 $file = WP_HTML_SITEMAP_ADD_OPTIONS, 232 $object = $this, 233 $target = 'settings', 234 $pattern = "/obj=/", 235 $delimiter = "/[\s]+/", 236 $operator = "/=/" 237 ); 238 } catch ( wp_html_sitemap_Exception $e ) { 239 echo $e->getError(); 240 die( '<p>WP HTML Sitemap exiting.</p>' ); 241 } 237 242 238 243 // verify load, report error … … 335 340 // loop for each file 336 341 foreach ( $loads as $key => $value ) { 337 // load external file 338 $return = $this->load_file_input( 339 $file = $value, 340 $object = $this, 341 $target = $key, 342 $pattern = "/obj=/", 343 $delimiter = "/[\s]+/", 344 $operator = "/=/" 345 ); 346 // verify load, report error 347 if ( !$return['retval'] ) { 348 die( $return['msg'] ); 342 try { 343 // load external file 344 $return = $this->load_file_input( 345 $file = $value, 346 $object = $this, 347 $target = $key, 348 $pattern = "/obj=/", 349 $delimiter = "/[\s]+/", 350 $operator = "/=/" 351 ); 352 } catch ( wp_html_sitemap_Exception $e ) { 353 echo $e->getError(); 354 die( '<p>WP HTML Sitemap exiting.</p>' ); 349 355 } 350 356 } … … 439 445 // if input file is not able to be read, alert 440 446 if ( !$input_stream ) { 441 return array( 'retval' => false, 'msg' => "error: unable to load $file." );447 throw new wp_html_sitemap_Exception( "Unable to load $file." ); 442 448 // otherwise proceed 443 449 } else { … … 454 460 return array( 'retval' => true, 'msg' => "info: loaded $file." ); 455 461 } else { 456 return array( 'retval' => false, 'msg' => "error: unable to load$file." );462 throw new wp_html_sitemap_Exception( "Unable to load file contents from $file." ); 457 463 } 458 464 } -
wp-html-sitemap/trunk/inc/SitemapShortcode.php
r513643 r514819 2 2 3 3 /* 4 WP HTML Sitemap v1. 04 WP HTML Sitemap v1.1 5 5 Contact: Bill Edgar (bill.edgar@oaktondata.com) 6 6 http://www.oaktondata.com/wordpress-html-sitemap … … 214 214 */ 215 215 // section header 216 global $wpdb; 217 $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'"); 218 if ( $numposts < 0 ) { 219 $numposts = 100; 220 } 216 221 $html = '<div id="wp_html_sitemap_posts" class="wp_html_sitemap_posts"><h2>Posts</h2><ul>'; 217 222 // retrieve categories list … … 227 232 'category' => '', 228 233 'exclude' => '', 229 'numberposts' => '',234 'numberposts' => $numposts, 230 235 'order' => 'DESC', 231 236 'orderby' => 'post_date', -
wp-html-sitemap/trunk/inc/Utilities.php
r513643 r514819 2 2 3 3 /* 4 WP HTML Sitemap v1. 04 WP HTML Sitemap v1.1 5 5 Contact: Bill Edgar (bill.edgar@oaktondata.com) 6 6 http://www.oaktondata.com/wordpress-html-sitemap -
wp-html-sitemap/trunk/js/wp-html-sitemap.options.js
r513643 r514819 1 1 /* 2 WP HTML Sitemap v1. 02 WP HTML Sitemap v1.1 3 3 Contact: Bill Edgar (bill.edgar@oaktondata.com) 4 4 http://www.oaktondata.com/wordpress-html-sitemap 5 5 6 Copyright (c) 201 1, Oakton Data LLC6 Copyright (c) 2012, Oakton Data LLC 7 7 All rights reserved. 8 8 -
wp-html-sitemap/trunk/readme.txt
r513643 r514819 5 5 Requires at least: 2.9 6 6 Tested up to: 3.3.1 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 9 9 Add a WordPress HTML sitemap that is fully customizable to improve your website SEO and enable easy navigation for your users. … … 72 72 == Changelog == 73 73 74 = 1.1 = 75 * Updated default options to avoid conflicts with XML sitemaps in WordPress document root. 76 * Added more robust error handling for loading of WP functions required for load of sitemap. 77 * Fixed bug with automatic sitemap generation for non-administrative users. 78 74 79 = 1.0 = 75 80 * Initial release … … 77 82 == Upgrade Notice == 78 83 84 = 1.1 = 85 * Updated default options to avoid conflicts with XML sitemaps, minor bug fixes, and enhanced error handling. 86 79 87 = 1.0 = 80 88 * Initial release -
wp-html-sitemap/trunk/wp-html-sitemap.php
r513643 r514819 5 5 Plugin Name: WP HTML Sitemap 6 6 Plugin URI: http://oaktondata.com/wordpress-html-sitemap/ 7 Version: 1. 07 Version: 1.1 8 8 Author: Bill Edgar 9 9 Author URI: http://oaktondata.com … … 44 44 45 45 // define constants 46 define( 'WP_HTML_SITEMAP_VERSION', '1. 0' );46 define( 'WP_HTML_SITEMAP_VERSION', '1.1' ); 47 47 define( 'WP_HTML_SITEMAP_BASE_URL', network_site_url() ); 48 48 … … 93 93 } catch ( Exception $e ) { 94 94 echo "<p>" . $e->getMessage() . "</p>"; 95 die( "<p>Unable to include $class_name. WP HTML Sitemap exiting.</p>" ); 95 96 } 96 97 } … … 142 143 wp_html_sitemap__autoinclude( WP_HTML_SITEMAP_SHORTCODE_CLASS ); 143 144 145 try { 146 $this->include_wp_functions(); 147 } catch ( wp_html_sitemap_Exception $e ) { 148 echo $e->getMessage(); 149 die( "<p>WP HTML Sitemap exiting.</p>" ); 150 } 151 144 152 $this->addShortcodes(); 145 153 … … 157 165 wp_html_sitemap__autoinclude( WP_HTML_SITEMAP_OPTIONS_CLASS ); 158 166 wp_html_sitemap__autoinclude( WP_HTML_SITEMAP_ADMINPAGE_CLASS ); 159 $wp_admin_includes = strstr( WP_HTML_SITEMAP_INCLUDES, 'wp-content', true ) . 'wp-admin/includes/';160 include_once( $wp_admin_includes . 'theme.php' ); // for WP get_page_templates function161 include_once( $wp_admin_includes . 'plugin.php' ); // for WP get_plugins function162 167 163 168 // runs when plugin is activated … … 236 241 * @TODO must be updated to include additonal option groups for WP HTML Sitemap Pro 237 242 */ 238 return $options; 243 if ( $version == '1.0' ) { 244 return $options; 245 } 239 246 } // end method do_option_upgrade 247 248 function include_wp_functions() { 249 $wp_admin_includes = strstr( WP_HTML_SITEMAP_INCLUDES, 'wp-content', true ) . 'wp-admin/includes/'; 250 if ( is_file( $wp_admin_includes . 'theme.php' ) ) { 251 if ( !function_exists( 'get_page_templates' ) ) { 252 if ( !include_once( $wp_admin_includes . 'theme.php' ) ) { // for WP get_page_templates function 253 throw new wp_html_sitemap_Exception( 'get_page_templates function not defined.</p>' ); 254 } 255 } 256 } else { 257 throw new wp_html_sitemap_Exception( $wp_admin_includes . 'theme.php file not found.' ); 258 } 259 if ( is_file( $wp_admin_includes . 'plugin.php' ) ) { 260 if ( !function_exists( 'get_plugins' ) ) { 261 if ( !include_once( $wp_admin_includes . 'plugin.php' ) ) { // for WP get_plugins function 262 throw new wp_html_sitemap_Exception( 'get_plugins function not defined</p>' ); 263 } 264 } else { 265 throw new wp_html_sitemap_Exception( $wp_admin_includes . 'plugin.php file not found.' ); 266 } 267 } 268 } 240 269 241 270 // method to check options to upgrade plugin options, if necessary … … 253 282 // check to see if option array exists 254 283 if ( $options !== false ) { 284 $this->do_option_upgrade( '1.0', $group, $options ); 255 285 // check and upgrade options if necessary 256 286 } 287 // update new options in wordpress database 288 update_option( 289 $option_name = $group, 290 $newvalue = $options 291 ); 257 292 } 258 293 } // end method upgrade_options
Note: See TracChangeset
for help on using the changeset viewer.