\t} \telse { \t\t\$(this).button("option", "icons", { primary: "ui-icon-check" }); \t\t\$("#loadhere").children("#tracks").find(".item."+\$(this).val().toLowerCase()).show(); \t} }); </script> EOT; } else { if ($page == "search") { header("Content-type: application/json"); $q = urldecode($_GET["q"]); $pagenumber = !empty($_GET["pagenumber"]) ? $_GET["pagenumber"] : 0; $n = $pagenumber * LIMIT; $youtube->video_search($q); $items = $youtube->getItems($n); echo json_encode($items); } else { header("Content-type: application/json"); $pagenumber = !empty($_GET["pagenumber"]) ? $_GET["pagenumber"] : 0; $n = $pagenumber * LIMIT; // $items = array_merge($reddit->getItems($n)); // $items = array_merge($reddit->getItems($n), $soundcloud->getItems($n)); // $items = array_merge($reddit->getItems($n), $soundcloud->getItems($n)); // $lastfm = new LastFM("chart.getHypedTracks"); $items = array_merge($reddit->getItems($n), $soundcloud->getItems($n)); // $items = $reddit->getItems($n); shuffle($items); echo json_encode($items); } }