'', ), $atts ) ); global $maxrows; global $tabwidth; global $headheight; global $rowheight; global $headcolor; global $prirow; global $altrow; global $showno; global $showsize; global $showlength; global $noheader; global $nameheader; global $playerheader; global $sizeheader; global $lengthheader; global $downloadheader; global $downloading; include_once( DWP_PATH . "library/getid3.php"); $dp = get_option('dew_display_options'); $maxrows = $dp['max_rows']; $tabwidth = $dp['table_width']; $headheight = $dp['header_height']; $rowheight = $dp['row_height']; $headcolor = $dp['table_header_color']; $prirow = $dp['primary_row_color']; $altrow = $dp['alt_row_color']; $showno = $dp['show_no_column']; $showsize = $dp['show_size_column']; $showlength = $dp['show_duration_column']; $noheader = $dp['header_name_for_no']; $nameheader = $dp['header_name_for_name']; $playerheader = $dp['header_name_for_player']; $sizeheader = $dp['header_name_for_size']; $lengthheader = $dp['header_name_for_duration']; $downloadheader = $dp['header_name_for_download']; $downloading = $dp['download_img']; if ( $handle = opendir( ABSPATH . $path ) ) { $count = 1; $getID3 = new getID3; $getID3->encoding = 'UTF-8'; $tabWidth = ( isset( $tabwidth ) && $tabwidth > 0 ) ? $tabwidth : '100%'; $headHeight = ( isset( $headheight ) && $headheight > 0 ) ? $headheight : '100%'; $rowHeight = ( isset( $rowheight ) && $rowheight > 0 ) ? $rowheight : '100%'; $headColor = isset( $headcolor ) ? $headcolor : '#eeeeee'; $priRow = isset( $prirow ) ? $prirow : '#fff'; $altRow = isset( $altrow ) ? $altrow : '#fff'; $html = ''; $html .= ''; $html .= ''; $html .= ''; if ( '1' == $showno ) { $html .= ''; } $html .= ''; if ( '1' == $showsize ) { $html .= ''; } if ( '1' == $showlength ) { $html .= ''; } $html .= ''; while ( false !== ($file = readdir( $handle )) ) { $dirFiles[] = $file; } closedir( $handle ); } sort( $dirFiles ); foreach ( $dirFiles as $file ) { if ( $file == "." || $file == ".." ) continue; if ( strtolower( substr( strrchr( $file, "." ), 1 ) ) != 'mp3' ) continue; $name = substr( str_replace( '_', ' ', $file ), 0, -4 ); $ThisFileInfo = $getID3->analyze( ABSPATH . $path . $file ); $playtime = $ThisFileInfo ['playtime_string']; $size = round( (filesize( ABSPATH . $path . $file )) / (1024 * 1024), 2 ); $html .= ''; if ( '1' == $showno ) { $html .= ''; } $html .= ''; $html .= ''; if ( '1' == $showsize ) { $html .= ''; } if ( '1' == $showlength ) { $html .= ''; } $html .= ''; $html .= ''; if ( isset( $maxrows ) ) { if ( $count == $maxrows ) { break; } } $count++; } $html .= ''; $html .= '
' . $noheader . '' . $nameheader . '' . $playerheader . '' . $sizeheader . '' . $lengthheader . '' . $downloadheader . '
' . $count . '' . $name . ' ' . $size . ' MB ' . $playtime . '
'; return $html; } } // construct an instance so that the actions get loaded $dwp_service = new DWP_Service();