Exemplo n.º 1
0
        $button = $song->enabled ? 'disable' : 'enable';
        $results[$id] = Ajax::button('?page=song&action=flip_state&song_id=' . $song->id, $button, T_(ucfirst($button)), 'flip_state_' . $song->id);
        break;
    case 'shouts':
        ob_start();
        $type = $_REQUEST['object_type'];
        $id = $_REQUEST['object_id'];
        if ($type == "song") {
            $media = new Song($id);
            $shouts = Shoutbox::get_shouts($type, $id);
            echo "<script type='text/javascript'>\r\n";
            echo "shouts = {};\r\n";
            foreach ($shouts as $id) {
                $shout = new Shoutbox($id);
                $shout->format();
                $key = intval($shout->data);
                echo "if (shouts['" . $key . "'] == undefined) { shouts['" . $key . "'] = new Array(); }\r\n";
                echo "shouts['" . $key . "'].push('" . addslashes($shout->get_display(false)) . "');\r\n";
                echo "\$('.waveform-shouts').append('<div style=\\'position:absolute; width: 3px; height: 3px; background-color: #2E2EFE; top: 15px; left: " . ($shout->data / $media->time * 400 - 1) . "px;\\' />');\r\n";
            }
            echo "</script>\r\n";
        }
        $results['shouts_data'] = ob_get_clean();
        break;
    default:
        $results['rfc3514'] = '0x1';
        break;
}
// switch on action;
// We always do this
echo xoutput_from_array($results);
Exemplo n.º 2
0
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
UI::show_box_top(T_('Shoutbox'));
?>
<div id="shoutbox">
<?php 
foreach ($shouts as $shout_id) {
    $shout = new Shoutbox($shout_id);
    $shout->format();
    ?>
<div id="shout<?php 
    echo $shout->id;
    ?>
" class="shout <?php 
    echo UI::flip_class();
    ?>
">
    <?php 
    echo $shout->get_display(true, true);
    ?>
</div>
<?php 
}
?>
</div>
<?php 
UI::show_box_bottom();
Exemplo n.º 3
0
     // end switch on button
     ob_start();
     $_SESSION['state']['sidebar_tab'] = $button;
     require_once AmpConfig::get('prefix') . '/templates/sidebar.inc.php';
     $results['sidebar'] = ob_get_contents();
     ob_end_clean();
     break;
 case 'shoutbox':
     ob_start();
     $since = $_REQUEST['since'];
     if ($since) {
         $shouts = Shoutbox::get_shouts_since(intval($since / 1000));
         echo "<script language='javascript' type='text/javascript'>";
         foreach ($shouts as $id) {
             $shout = new Shoutbox($id);
             echo "noty({text: '" . addslashes($shout->get_display(true)) . "',\n                    type: 'alert', layout: 'bottomRight',\n                    template: '<div class=\"noty_message noty_ampache\"><span class=\"noty_text noty_ampache\"></span><div class=\"noty_close noty_ampache\"></div></div>',\n                });";
         }
         echo "</script>";
     }
     $results['live_shoutbox'] = ob_get_clean();
     break;
 case 'start_channel':
     if (Access::check('interface', '75')) {
         ob_start();
         $channel = new Channel($_REQUEST['id']);
         if ($channel->id) {
             if ($channel->check_channel()) {
                 $channel->stop_channel();
             }
             $channel->start_channel();
             sleep(1);