Всем доброго времени суток! Возникла потребность добавить на сайт mp3-плеер с возможностью изменения пользователем своего плейлиста (в идеале перетаскиванием). http://sofya-sofiya.narod.ru/index-3-2.html - плеер, которым я решил воспользоваться. Так выглядит xml-плейлист: Код (Text): <?xml version="1.0" encoding="UTF-8"?> <content> <spectrum_colors>#000000,#6596FF,#2A0069,#78D2FF,#00ffff</spectrum_colors> <auto_play>no</auto_play> <loop>yes</loop> <show_spectrum>yes</show_spectrum> <volume>80</volume> <artist> <song_title><![CDATA[In The Morning]]></song_title> <artist_name><![CDATA[Gwen Stefani]]></artist_name> <image_path>load/images/1.jpg</image_path> <mp3_path>mp3/1.mp3</mp3_path> <url target="_blank" open="yes">mp3/Gwen_Stefani_-4_In_The_Morning.mp3</url> </artist> <artist> <song_title><![CDATA[Cool]]></song_title> <artist_name><![CDATA[Gwen Stefani]]></artist_name> <image_path>load/images/1.jpg</image_path> <mp3_path>mp3/1.mp3</mp3_path> <url target="_blank" open="yes">mp3/Cool.mp3</url> </artist> </content> Вопрос: есть ли живые примеры кода, которые помогут работать с плейлистом?
Решил проблему с перетаскиванием с помощью jQuery и Sortable. Теперь вопрос: как сохранить новый порядок?
Попробовал следующее, только в БД ничего не меняется в итоге Код (Text): <script type="text/javascript"> $(document).ready(function(){ function slideout(){ setTimeout(function(){ $("#music_music1").slideUp("slow", function () { }); }, 2000);} $(function() { $("#list ul").sortable({ opacity: 0.8, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&update=update'; $.post("/includes/src/updateList.php", order, function(theResponse){ $("#music_music1").html(theResponse); $("#music_music1").slideDown('slow'); slideout(); }); } }); }); }); </script> Код (Text): <?php $dbcnx = mysql_connect($dblocation, $dbuser, $dbpasswd); mysql_select_db($dbname,$dbcnx); $array = $_POST['arrayorder']; if ($_POST['update'] == "update"){ $count = 1; foreach ($array as $idval) { $query = "UPDATE system_files_records SET order = " . $count . " WHERE id = " . $idval; mysql_query($query) or die('Ошибка'); $count ++; } echo 'Информация сохранена!'; } ?>