Пример #1
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
require_once 'lib/init.php';
if (!isset($_REQUEST['action']) || empty($_REQUEST['action'])) {
    debug_event("stream.php", "Asked without action. Exiting...", 5);
    exit;
}
if (!defined('NO_SESSION')) {
    /* If we are running a demo, quick while you still can! */
    if (AmpConfig::get('demo_mode') || !Access::check('interface', '25')) {
        UI::access_denied();
        exit;
    }
}
$media_ids = array();
$web_path = AmpConfig::get('web_path');
debug_event("stream.php", "Asked for {" . $_REQUEST['action'] . "}.", 5);
/**
 * action switch
 */
switch ($_REQUEST['action']) {
    case 'basket':
        // Pull in our items (multiple types)
        $media_ids = $GLOBALS['user']->playlist->get_items();
        // Check to see if 'clear' was passed if it was then we need to reset the basket
        if ($_REQUEST['playlist_method'] == 'clear' || AmpConfig::get('playlist_method') == 'clear') {
Пример #2
0
 public static function display_from_request()
 {
     if (!Access::check('interface', '50')) {
         UI::access_denied();
     } else {
         $user_id = $_REQUEST['user_id'];
         $object_type = $_REQUEST['object_type'];
         $object_id = $_REQUEST['object_id'];
         $end_date = $_REQUEST['end_date'] ? strtotime($_REQUEST['end_date']) : time();
         $f_end_date = date("Y-m-d H:i", $end_date);
         $start_date = $_REQUEST['start_date'] ? strtotime($_REQUEST['start_date']) : $end_date - 864000;
         $f_start_date = date("Y-m-d H:i", $start_date);
         $zoom = $_REQUEST['zoom'] ?: 'day';
         $gtypes = array();
         $gtypes[] = 'user_hits';
         if ($object_type == null || $object_type == 'song' || $object_type == 'video') {
             $gtypes[] = 'user_bandwidth';
         }
         if (!$user_id && !$object_id) {
             $gtypes[] = 'catalog_files';
             $gtypes[] = 'catalog_size';
         }
         $blink = '';
         if ($object_id) {
             if (Core::is_library_item($object_type)) {
                 $libitem = new $object_type($object_id);
                 $libitem->format();
                 if (isset($libitem->f_link)) {
                     $blink = $libitem->f_link;
                 }
             }
         } else {
             if ($user_id) {
                 $u = new User($user_id);
                 $u->format();
                 $blink = $u->f_link;
             }
         }
         require_once AmpConfig::get('prefix') . '/templates/show_graphs.inc.php';
     }
 }