require 'app/sequencer.php'; $autoplay = 0; if (isset($_GET['random'])) { $id = db_result(db_query('SELECT id FROM sequences WHERE deleted=0 AND scale>=0 AND LENGTH(data) > 500 ORDER BY RAND() LIMIT 1'), 0); $autoplay = 1; } if ($id != 0) { $result = db_query('SELECT * FROM sequences WHERE deleted=0 AND id="' . e_mysql($id) . '" LIMIT 1'); if (mysqli_num_rows($result) == 0) { output_message('Error', 'Unknown sequence: ' . e_html($id)); exit; } $row = mysqli_fetch_array($result); $title = formatSequenceTitle($row); $nav_right = formatSequenceInfo($row); } if ($id != 0) { $cname = $id; } if ($id == 0) { $showFeatured = true; } output_header($id == 0 ? 'Make music online' : $title, false, $id); ?> <style type="text/css"> #main { bottom: 0; } </style> <div id="middle">
<?php if (!defined('IN_SITE')) { require '../inc/init.php'; } $id = intval($_GET['id']); $row = mysqli_fetch_array(db_query('SELECT * FROM sequences WHERE id="' . $id . '"')); db_query('UPDATE sequences SET accesscount=accesscount+1 WHERE id="' . $id . '"'); $dataString = str_replace(array('<', '>', '"', "'"), '', $row['data']); header('Content-type: text/plain'); $data = array(); $data['title'] = $row['title']; $data['windowTitle'] = formatSequenceTitle($row); $data['data'] = $dataString; $data['navRight'] = formatSequenceInfo($row); echo json_encode($data);