echo $error_array["SessionName"][0]; ?> </font> </td> </tr> <?php if (!areSessionTracksEnabled()) { ?> <tr> <td> Track </td> <td> <select name="TrackID"> <?php $tracks = get_tracks(); foreach ($tracks as $track) { ?> <option value="<?php echo $track->TrackID; ?> " <?php if ($vars["TrackID"] == $track->TrackID) { echo "selected"; } ?> > <?php echo $track->TrackName; ?> </option>
require_once "../includes/inc.includes.php"; // Include necessary files $search = $_GET['search']; $value = html_entity_decode(stripslashes($_GET['value']), ENT_COMPAT, "UTF-8"); $limit = 10; if ($search == "artist") { $json = json_decode(get_artists("tracks")); if ($json) { foreach ($json as $result) { $results['artist'][] = html_entity_decode($result->artist, ENT_COMPAT, "UTF-8"); } } } if ($search == "title") { $json = json_decode(get_tracks()); if ($json) { foreach ($json as $result) { $results['title'][] = html_entity_decode($result->title, ENT_COMPAT, "UTF-8"); } } } if ($search == "album") { $json = json_decode(get_albums()); if ($json) { foreach ($json as $result) { $results['albums'][] = html_entity_decode($result->title, ENT_COMPAT, "UTF-8"); } } } $found = array();
<p style="float: right"> <a href="?page=<?php echo $pagenumprev; ?> ">« prev</a> | <a href="?page=<?php echo $pagenumnext; ?> ">next »</a> </p> <table id="tracks" style="clear: both"> <?php $dbitems = get_tracks($offset, $rowsperpage); if (isset($dbitems)) { foreach ($dbitems as $row) { echo "<tr>\n"; echo "<td><a href=\"" . $row['urlartist'] . "\">" . substr($row['artist'], 0, 80) . "</a> - "; echo "<a href=\"" . $row['urltrack'] . "\">" . substr($row['name'], 0, 120) . "</a></td>\n"; echo "<td class=\"date\">" . date("F j, Y, g:i a", (int) $row['dateuts']) . "</td>\n"; echo "</tr>\n"; } } else { echo "<tr><td colspan=\"2\">Sorry, nothing to display...</td></tr>"; } ?> </table>
<?php require_once 'alfredtweet.php'; require_once 'workflows.php'; $w = new Workflows(); // Array of all supported players $supported_players = array('iTunes', 'Ecoute', 'Rdio', 'Spotify'); $results = array(); $running_players = check_running($supported_players); if (!empty($running_players)) { // players running $players_playing = check_playing($running_players); if (!empty($players_playing)) { //players are playing $tracks = get_tracks($players_playing); foreach ($tracks as $track) { $w->result(time(), 'Now playing ' . $track['track'] . ' on album ' . $track['album'] . ' by ' . $track['artist'] . ' in ' . $track['player'] . ' #alfredtweet.', $track['player'] . ': ' . $track['track'] . ' by ' . $track['artist'], 'Now playing ' . $track['track'] . ' on album ' . $track['album'] . ' by ' . $track['artist'] . ' in ' . $track['player'] . ' #alfredtweet.', 'icon.png'); } } else { // no players are playing $w->result(time(), '', 'No players playing', 'No players are currently playing tracks', 'icon.png', 'no'); } } else { // no players running $w->result(time(), '', 'No players running', 'No players are currently running', 'icon.png', 'no'); } echo $w->toxml(); /** * Description: * Accepts an array of currently supported players and then checks * to see which players are actually running.
} $select_ppp = array(); foreach ($bb_cfg['allowed_posts_per_page'] as $ppp) { $select_ppp[$ppp] = $ppp; } } if (isset($_REQUEST['single'])) { $posts_per_page = 1; } else { $start = floor($start / $posts_per_page) * $posts_per_page; } if (!$topic_id && !$post_id) { bb_die($lang['TOPIC_POST_NOT_EXIST']); } $tracking_topics = get_tracks('topic'); $tracking_forums = get_tracks('forum'); // Find topic id if user requested a newer or older topic if ($topic_id && isset($_GET['view']) && ($_GET['view'] == 'next' || $_GET['view'] == 'previous')) { $sql_condition = $_GET['view'] == 'next' ? '>' : '<'; $sql_ordering = $_GET['view'] == 'next' ? 'ASC' : 'DESC'; $sql = "SELECT t.topic_id\n\t\tFROM " . BB_TOPICS . " t, " . BB_TOPICS . " t2\n\t\tWHERE t2.topic_id = {$topic_id}\n\t\t\tAND t.forum_id = t2.forum_id\n\t\t\tAND t.topic_moved_id = 0\n\t\t\tAND t.topic_last_post_id {$sql_condition} t2.topic_last_post_id\n\t\tORDER BY t.topic_last_post_id {$sql_ordering}\n\t\tLIMIT 1"; if ($row = DB()->fetch_row($sql)) { $next_topic_id = $topic_id = $row['topic_id']; } else { $message = $_GET['view'] == 'next' ? $lang['NO_NEWER_TOPICS'] : $lang['NO_OLDER_TOPICS']; bb_die($message); } } // Get forum/topic data if ($topic_id) { $sql = "SELECT t.*, f.*, tw.notify_status\n\t\tFROM " . BB_TOPICS . " t\n\t\tLEFT JOIN " . BB_FORUMS . " f USING(forum_id)\n\t\tLEFT JOIN " . BB_TOPICS_WATCH . " tw ON(tw.topic_id = t.topic_id AND tw.user_id = {$userdata['user_id']})\n\t\tWHERE t.topic_id = {$topic_id}\n\t";
print "</div>\n"; if (isset($level0) && $level2 == "" && $level1 == "" || $level2 != "") { # artist / level 2 specified? print "<div class='searchresults border-left'>\n"; $tracklist = json_decode(get_tracks()); write_tracklist($tracklist, $level2); print "</div>\n"; } print "</div>\n"; } /// Tracks by Title if (strcmp($level0, "tr-ti") == 0) { write_alphabet("browse.php?level0=tr-ti&level1=", $level1); print "<div class='results'>\n"; print "<div class='searchresults'>\n"; $tracklist = json_decode(get_tracks()); write_tracklist($tracklist, null, $level1); print "</div>\n"; print "</div>\n"; } /// Albums by Artist if (strcmp($level0, "al-ar") == 0) { $trackrow_param->artist = FALSE; write_alphabet("browse.php?level0=al-ar&level1=", $level1); // print alphabet into container print "<div class='results'>\n"; print "<div class='searchresults'>\n"; $json = json_decode(get_artists("albums", $level1)); print "<table borders=\"0\">\n"; print "<th class='brslist_level2'>Artists</th>"; if ($json) {
/** * Gets a release from the database by the release's slug. * * @author Alex Andrews <*****@*****.**> * @param int $release_id The slug of the release. * @param bool $tracks If true add the tracks to our release. * @param bool $reviews If true add reviews of the release to it. * @return array Associative array with data about the release. */ function get_release_by_slug($release_slug, $tracks = true, $reviews = true) { global $wpdb; $now_date = gmdate('Y-m-d'); $query = "SELECT * FROM {$wpdb->ribcage_releases} WHERE release_slug = '{$release_slug}' AND release_date <= '{$now_date}'"; if ($wpdb->query($query) == false or $wpdb->query($query) == 0) { return new WP_Error('ribcage-release-not-found', __("We can't find a release with {$release_slug}.")); } $return = $wpdb->get_row($query, ARRAY_A); if ($tracks == true) { $return['release_tracks'] = get_tracks($return['release_id']); } if ($reviews == true) { $return['release_reviews'] = get_reviews($return['release_id']); } return $return; }
<?php if (empty($bb_cfg['topic_notify_enabled'])) { bb_die($lang['DISABLED']); } $page_cfg['use_tablesorter'] = true; $page_cfg['include_bbcode_js'] = true; $tracking_topics = get_tracks('topic'); $user_id = $userdata['user_id']; $start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0; $per_page = $bb_cfg['topics_per_page']; if (isset($_POST['topic_id_list'])) { $topic_ids = implode(",", $_POST['topic_id_list']); $sql = "DELETE FROM " . BB_TOPICS_WATCH . " WHERE topic_id IN(" . $topic_ids . ") AND user_id = {$user_id}"; if (!($result = DB()->sql_query($sql))) { bb_die('Could not delete topic watch information #1'); } } $template->assign_vars(array('PAGE_TITLE' => $lang['WATCHED_TOPICS'], 'S_FORM_ACTION' => BB_ROOT . 'profile.php?mode=watch')); $sql = "SELECT COUNT(topic_id) as watch_count FROM " . BB_TOPICS_WATCH . " WHERE user_id = {$user_id}"; if (!($result = DB()->sql_query($sql))) { bb_die('Could not obtain watch topic information #2'); } $row = DB()->sql_fetchrow($result); $watch_count = $row['watch_count'] ? $row['watch_count'] : 0; DB()->sql_freeresult($result); if ($watch_count > 0) { $sql = "SELECT w.*, t.*, f.*, u.*, u2.username as last_username, u2.user_id as last_user_id,\n\t\tu2.user_level as last_user_level, u2.user_rank as last_user_rank\n\tFROM " . BB_TOPICS_WATCH . " w, " . BB_TOPICS . " t, " . BB_USERS . " u, " . BB_FORUMS . " f, " . BB_POSTS . " p, " . BB_USERS . " u2\n\tWHERE w.topic_id = t.topic_id\n\t\tAND t.forum_id = f.forum_id\n\t\tAND p.post_id = t.topic_last_post_id\n\t\tAND p.poster_id = u2.user_id\n\t\tAND t.topic_poster = u.user_id\n\t\tAND w.user_id = {$user_id}\n\tGROUP BY t.topic_last_post_time DESC\n\tLIMIT {$start}, {$per_page}"; if (!($result = DB()->sql_query($sql))) { bb_die('Could not obtain watch topic information #3'); }
function get_release_by_slug($release_slug, $tracks = true, $reviews = true) { global $wpdb; $now_date = gmdate('Y-m-d'); $return = $wpdb->get_row("SELECT * FROM {$wpdb->ribcage_releases} WHERE release_slug = '{$release_slug}' AND release_date <= '{$now_date}'", ARRAY_A); if ($tracks == true) { $return['release_tracks'] = get_tracks($return['release_id']); } if ($reviews == true) { $return['release_reviews'] = get_reviews($return['release_id']); } return $return; }