ya com // // Simple PHP Version: 0.4.4 // RSS Version: 0.4.4 // Include Required Functions require_once('scripts/sb_functions.php'); read_config(); require_once('languages/' . $blog_config[ 'blog_language' ] . '/strings.php'); sb_language( 'index' ); // Read entries by month, year and/or day. Generate HTML output. // // Used for the main Index page. global $lang_string, $blog_config, $user_colors, $sb_info; $entry_file_array = blog_entry_listing(); if ( ( dirname($_SERVER[ 'PHP_SELF' ]) == '\\' || dirname($_SERVER[ 'PHP_SELF' ]) == '/' ) ) { // Hosted at root. $base_url = 'http://' . $_SERVER[ 'HTTP_HOST' ] . '/'; } else { // Hosted in sub-directory. $base_url = 'http://' . $_SERVER[ 'HTTP_HOST' ].dirname($_SERVER[ 'PHP_SELF' ]) . '/'; } header('Content-type: application/xml'); echo "\n"; echo "\n"; write_map( $base_url . 'atom.php', gmdate( 'Y-m-d', time() ), 'always', 0.9 ); write_map( $base_url . 'contact.php', gmdate( 'Y-m-d', time() ), 'monthly', 0.1 ); write_map( $base_url . 'index.php', gmdate( 'Y-m-d', time() ), 'always', 0.9 ); write_map( $base_url . 'login.php', gmdate( 'Y-m-d', time() ), 'monthly', 0.1 ); write_map( $base_url . 'rdf.php', gmdate( 'Y-m-d', time() ), 'always', 0.9 ); write_map( $base_url . 'rss.php', gmdate( 'Y-m-d', time() ), 'always', 0.9 ); write_map( $base_url . 'search.php', gmdate( 'Y-m-d', time() ), 'monthly', 0.1 ); write_map( $base_url . 'stats.php', gmdate( 'Y-m-d', time() ), 'daily', 0.1 ); //Add more static pages here // Read entry files $max_entries=min( 10000, count( $entry_file_array ) ); $i=0; while ( $i<$max_entries ) { list( $entry_filename, $year_dir, $month_dir ) = explode( '|', $entry_file_array[ $i ] ); $contents=blog_entry_to_array( 'content/' . $year_dir . '/' . $month_dir . '/' . $entry_filename ); write_map( $base_url . 'index.php?entry=' . sb_strip_extension( $entry_filename ), gmdate( 'Y-m-d', $contents[ 'DATE' ] ), 'weekly', 0.5 ); if ( $blog_config[ 'blog_enable_comments' ] ) { write_map( $base_url . 'comments.php?y=' . $year_dir . '&m=' . $month_dir . '&entry=' . sb_strip_extension( $entry_filename ), gmdate( 'Y-m-d', time() ), 'daily', 0.7 ); } if ( $blog_config[ 'blog_enable_trackbacks' ] ) { write_map( $base_url . 'trackback.php?y=' . $year_dir . '&m=' . $month_dir . '&entry=' . sb_strip_extension( $entry_filename ) . '&__mode=html', gmdate( 'Y-m-d', time() ), 'daily', 0.1 ); } $i++; } //Need to dump static pages echo ""; function write_map( $loc, $lastmod, $changefreq, $priority ) { echo "\t\n"; echo "\t\t" . $loc . "\n"; echo "\t\t" . $lastmod . "\n"; echo "\t\t" . $changefreq . "\n"; echo "\t\t" . $priority . "\n"; echo "\t\n"; } ?>