get_results("SELECT * FROM $wpdb->wordtube WHERE counter >0 ORDER BY counter DESC LIMIT 10"); // Otherwise gets mp3 } elseif ($playlist_id == 'music') { $themediafiles = $wpdb->get_results("SELECT * FROM $wpdb->wordtube WHERE file LIKE '%.mp3%' ORDER BY vid DESC"); // Otherwise gets flv } elseif ($playlist_id == 'video') { $themediafiles = $wpdb->get_results("SELECT * FROM $wpdb->wordtube WHERE file LIKE '%.flv%' ORDER BY vid DESC"); // Shows all files when 0 } elseif ($playlist_id == '0') { $themediafiles = $wpdb->get_results( $wpdb->prepare ("SELECT * FROM $wpdb->wordtube ORDER BY vid DESC {$limit}") ); // Otherwise gets playlist } else { // Remove all evil code $playlist_id = intval($_GET['id']); $playlist = $wpdb->get_row("SELECT * FROM $wpdb->wordtube_playlist WHERE pid = '$playlist_id'"); if ($playlist) { $select = " SELECT * FROM {$wpdb->wordtube} w"; $select .= " INNER JOIN {$wpdb->wordtube_med2play} m"; $select .= " WHERE (m.playlist_id = '$playlist_id'" ; $select .= " AND m.media_id = w.vid) GROUP BY w.vid "; $select .= " ORDER BY m.porder ".$playlist->playlist_order." ,w.vid ".$playlist->playlist_order; $themediafiles = $wpdb->get_results( $wpdb->prepare( $select ) ); $title = $playlist->playlist_name; } } // Create XML / XSPF output header("content-type:text/xml;charset=utf-8"); echo "\n".""; echo "\n\t".'' . esc_attr($title) . ''; echo "\n\t".''; if (is_array ($themediafiles)){ foreach ($themediafiles as $media) { $creator = esc_attr(stripslashes($media->creator)); if ($creator == '') $creator = 'Unknown'; if ($media->image == '') $image = get_option('siteurl') . '/wp-content/plugins/' . dirname( plugin_basename(__FILE__) ) . '/images/wordtube.jpg'; else $image = $media->image; $file = pathinfo($media->file); // Added by MT starts $mediafile = $media->file; if (substr($mediafile, 0, 4) == 'rtmp') { preg_match('/^(.+)\?id=(.+)/', $mediafile, $match); if (!empty ($match)) { $streamer = $match[1]; $mediafile = $match[2]; } } // ends echo "\n\t\t".''; echo "\n\t\t\t".'' . esc_attr( stripslashes($media->name) ) . ''; echo "\n\t\t\t".'' . esc_attr($creator) . ''; echo "\n\t\t\t".'' . esc_attr($mediafile) . ''; //modified by MT // Added by MT if(!empty($streamer)): echo "\n\t\t\t".'' . esc_attr($streamer) . ''; endif; // ends echo "\n\t\t\t".'' . esc_attr($image) . ''; echo "\n\t\t\t".'' . esc_attr( stripslashes($media->description) ) . ''; echo "\n\t\t\t".'' . $media->vid . ''; echo "\n\t\t\t".'' . $media->counter . ''; echo "\n\t\t\t".'' . esc_attr($media->link) . ''; echo "\n\t\t".''; } } echo "\n\t".''; echo "\n"."\n"; ?>