芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/www/blog/wp-content/plugins/youtube-embed/includes/aye-generate-transcript-code.php
1 ) { return aye_error( $embed_type ); } else { return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) ); } } // Get general options $general = aye_set_general_defaults(); // Check to see if cache is available if ( $general[ 'transcript_cache' ] != 0 ) { $cache_key = 'aye_transcript_'.$id; $output = get_transient( $cache_key ); if ( $output !== false) { return $output; } } // Get transcript file $return = aye_get_file( 'http://video.google.com/timedtext?lang=en&v=' . $id ); $xml = $return[ 'file' ]; $output = ''; // If transcript file exists, strip and output if ( $return[ 'rc' ] == 0 ) { $output = "\n"; $pos = 0; $eof = false; while ( !$eof ) { $text_start = strpos( $xml, '
', $text_start ) + 1; $text_end = strpos( $xml, '
', $text_start ) - 1; $text = substr( $xml, $text_start, $text_end - $text_start + 1 ); // Now return the output $output .= "
" . $start . "
" . htmlspecialchars_decode( $text ) . "
\n"; $pos = $text_end + 7; } else { $eof = true; } } $output .= "\n"; } // Save the cache if ( $general[ 'transcript_cache' ] != 0 ) { set_transient( $cache_key, $output, 3600 * $general[ 'transcript_cache' ] ); } return $output; } ?>