Exemple #1
0
}
echo "<h3>Flagged for Censorship</h3>";
echo "<strong>To flag a track for censorship, search for it in the music library, click the " . Bootstrap::glyphicon("info-sign") . " and click the \"Flag for censorship\" button.</strong>";
if ($flagged = Tracks::get_flagged()) {
    echo "\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($flagged as $flag) {
        echo "\n\t<tr id=\"" . $flag->get_id() . "\">\n\t\t<td class=\"icon\">\n\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $flag->get_id() . "\" class=\"track-info\">\n\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t</a>\n\t\t\t<div class=\"hover-info\">\n\t\t\t\t<strong>Artist:</strong> " . $flag->get_artists_str() . "<br />\n\t\t\t\t<strong>Album:</strong> " . $flag->get_album()->get_name() . "<br />\n\t\t\t\t<strong>Year:</strong> " . $flag->get_year() . "<br />\n\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($flag->get_length()) . "<br />\n\t\t\t\t<strong>Origin:</strong> " . $flag->get_origin() . "<br />\n\t\t\t\t" . ($flag->get_reclibid() ? "<strong>Reclib ID:</strong> " . $flag->get_reclibid() . "<br />" : "") . "\n\t\t\t</div>\n\t\t</td>\n\t\t<td class=\"artist\">" . $flag->get_artists_str() . "</td>\n\t\t<td class=\"title\">" . $flag->get_title() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?censor=" . $flag->get_id() . "\" class=\"censor\" title=\"Approve censorship\" rel=\"twipsy\">" . Bootstrap::glyphicon("ok-sign") . "</td>\n\t\t<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?unflag=" . $flag->get_id() . "\" class=\"unflag\" title=\"Remove flag\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
    }
    echo "\n</table>";
} else {
    echo "<h4>No tracks currently flagged for censorship.</h4>";
}
$limit = isset($_REQUEST['n']) ? $_REQUEST['n'] : 10;
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
$num_of_censored = Tracks::count_censored();
if ($censored = Tracks::get_censored($limit, ($page - 1) * $limit)) {
    $pages = new Paginator();
    $pages->items_per_page = $limit;
    $pages->querystring = NULL;
    $pages->mid_range = 5;
    $pages->items_total = $num_of_censored;
    $pages->paginate();
    $low = ($page - 1) * $limit + 1;
    $high = $low + $limit - 1 > $num_of_censored ? $num_of_censored : $low + $limit - 1;
    echo "\n<h3>Censored Tracks</h3>\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($censored as $censor) {
        echo "\n\t<tr id=\"" . $censor->get_id() . "\">\n\t\t<td class=\"icon\">\n\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $censor->get_id() . "\" class=\"track-info\">\n\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t</a>\n\t\t\t<div class=\"hover-info\">\n\t\t\t\t<strong>Artist:</strong> " . $censor->get_artists_str() . "<br />\n\t\t\t\t<strong>Album:</strong> " . $censor->get_album()->get_name() . "<br />\n\t\t\t\t<strong>Year:</strong> " . $censor->get_year() . "<br />\n\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($censor->get_length()) . "<br />\n\t\t\t\t<strong>Origin:</strong> " . $censor->get_origin() . "<br />\n\t\t\t\t" . ($censor->get_reclibid() ? "<strong>Reclib ID:</strong> " . $censor->get_reclibid() . "<br />" : "") . "\n\t\t\t</div>\n\t\t</td>\n\t\t<td class=\"artist\">" . $censor->get_artists_str() . "</td>\n\t\t<td class=\"title\">" . $censor->get_title() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?uncensor=" . $censor->get_id() . "\" class=\"uncensor\" title=\"Uncensor this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
    }
    echo "\n</table>";
    echo $pages->return;
} else {