\n"; echo "\n"; echo " $val\n"; if( $val > 0 ) { echo " $msg\n"; } echo "\n"; exit; } if ( ( dirname($_SERVER[ 'PHP_SELF' ]) == '\\' || dirname($_SERVER[ 'PHP_SELF' ]) == '/' ) ) { // Hosted at root. $base_url = '://' . $_SERVER[ 'HTTP_HOST' ]; } else { // Hosted in sub-directory. $base_url = '://' . $_SERVER[ 'HTTP_HOST' ].dirname($_SERVER[ 'PHP_SELF' ]); } // trackback ping contains entry in the URI $redirect = true; if ( isset( $_GET[ 'y' ] ) && isset( $_GET[ 'm' ] ) && isset( $_GET[ 'entry' ] ) ) { $entry_id = 'content/'.$_GET[ 'y' ].'/'.$_GET[ 'm' ].'/'.$_GET[ 'entry' ]; $entry = $_GET[ 'entry' ]; $year = $_GET[ 'y' ]; $month = $_GET[ 'm' ]; if ( file_exists( $entry_id . '.txt' ) ) { $redirect = false; } elseif ( file_exists( $entry_id . '.txt.gz' ) ) { $redirect = false; } } // trackback is done by a POST $tb_url = $_POST[ 'url' ]; $title = $_POST[ 'title' ]; $excerpt = $_POST[ 'excerpt' ]; $blog_name = $_POST[ 'blog_name' ]; // No such entry exists OR trackback is disabled if ( ($redirect === true ) || ( !$blog_config[ 'blog_trackback_enabled' ] ) ) { redirect_to_url( 'index.php' ); } if ( ( strlen('' . $entry ) ) && ( empty( $_GET[ '__mode' ] ) ) && ( strlen( '' . $tb_url ) ) && ( strpos( sb_read_file( $tb_url ), $base_url ) !== false ) ) { @header('Content-Type: text/xml'); $tb_url = addslashes($tb_url); $title = strip_tags($title); $title = ( strlen($title) > 127 ? substr( $title, 0, 124 ) . '...' : $title ); $excerpt = strip_tags($excerpt); $excerpt = ( strlen($excerpt) > 127 ? substr( $excerpt, 0, 124 ) . '...' : $excerpt ); $blog_name = htmlspecialchars($blog_name); $blog_name = ( strlen($blog_name) > 127 ? substr( $blog_name, 0, 124 ) . '...' : $blog_name ); $user_ip = $HTTP_SERVER_VARS[ 'REMOTE_ADDR' ]; $user_domain = @gethostbyaddr($user_ip); $ok = write_trackback( $_GET[ 'y' ], $_GET[ 'm' ], $entry = $_GET[ 'entry' ], $tb_url, $title, $excerpt, $blog_name, $user_ip, $user_domain ); if (!$ok) { trackback_response(1, $lang_string[ 'error_add' ] ); } else { trackback_response(0, ''); } } else if( $_GET[ '__mode' ] === 'html' ) { // // Mode HTML: display in the style of the sphpblog // ?> <?php echo($blog_config[ 'blog_title' ]); ?> - <?php echo( $lang_string[ 'title' ] ); ?> ' . '' . "

\n"; echo ( theme_blogentry( $tb ) ); echo ( read_trackbacks ( $_GET[ 'y' ], $_GET[ 'm' ], $_GET[ 'entry' ], $logged_in, true ) ); echo "

\n"; } global $blog_config; if ( $blog_config[ 'blog_comments_popup' ] == 1 ) { theme_popuplayout(); } else { theme_pagelayout(); } ?> '."\n"; echo "\n"; echo "0\n"; echo ''."\n"; echo "" . $blog_config[ 'blog_title' ] . "\n"; echo "" . $base_url . "index.php\n"; echo "". $blog_config[ 'blog_footer' ] . "\n"; echo "" . str_replace( '_', '-', $lang_string[ 'locale' ] ) . "\n"; $results = read_trackbacks ( $year, $month, $entry, $logged_in, false ); for ( $i = 0; $i <= count( $results ) - 1; $i++ ) { echo "\n"; echo "" . $results[$i][ 'title' ] . "\n"; echo "" . $results[$i][ 'url' ] . "\n"; echo "" . $results[$i][ 'excerpt' ] . "\n"; echo "\n"; } echo "\n"; echo "\n"; } ?>