Пример #1
0
    $where = "(" . $where . ")";
}
// GET TOTAL ENTRIES
$total_music = $music->music_list_total(NULL, NULL, $where);
// MAKE ENTRY PAGES
$page_vars = make_page($total_music, $entries_per_page, $p);
$page_array = array();
for ($x = 0; $x <= $page_vars[2] - 1; $x++) {
    if ($x + 1 == $page_vars[1]) {
        $link = "1";
    } else {
        $link = "0";
    }
    $page_array[$x] = array('page' => $x + 1, 'link' => $link);
}
// GET SONG LIST ARRAY
$music_list = $music->music_list($page_vars[0], $entries_per_page, $sort, $where);
// ASSIGN VARIABLES AND SHOW VIEW ENTRIES PAGE
$smarty->assign('total_music', $total_music);
$smarty->assign('pages', $page_array);
$smarty->assign('entries', $music_list);
$smarty->assign('f_title', $f_title);
$smarty->assign('f_owner', $f_owner);
$smarty->assign('i', $i);
$smarty->assign('t', $t);
$smarty->assign('o', $o);
$smarty->assign('v', $v);
$smarty->assign('d', $d);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('s', $s);
include "admin_footer.php";
Пример #2
0
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_music_allow'] && $page == "profile") {
    // GET USER SETTINGS
    $user->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
    $owner->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
    // GET SKIN INFO
    $owner_music = new se_music($owner->user_info['user_id']);
    $skin_info = $owner_music->skin_info($user->usersetting_info['usersetting_xspfskin_id']);
    if (!empty($skin_info)) {
        $smarty->assign('skin_title', $skin_info['xspfskin_title']);
        $smarty->assign('skin_height', $skin_info['xspfskin_height']);
        $smarty->assign('skin_width', $skin_info['xspfskin_width']);
    }
    // AUTOPLAY
    // Rules: +USER+OWNER -> TRUE, +USER-OWNER -> FALSE, -USER+OWNER -> FALSE, -USER-OWNER -> FALSE
    $smarty->assign('autoplay', $user->usersetting_info['usersetting_music_site_autoplay'] && $owner->usersetting_info['usersetting_music_profile_autoplay']);
    // SET PROFILE MENU VARS
    $owner_music_list = $owner_music->music_list();
    if (!empty($owner_music_list)) {
        $smarty->assign('music_allow', TRUE);
        $plugin_vars['menu_profile_tab'] = "";
        $plugin_vars['menu_profile_side'] = array('file' => 'profile_music.tpl', 'title' => 4000004);
    }
}
// SET SEARCH HOOK
if ($page == "search") {
    SE_Hook::register("se_search_do", "search_music");
}
// SET USER DELETION HOOK
SE_Hook::register("se_user_delete", "deleteuser_music");
Пример #3
0
$task = !empty($_POST['task']) ? $_POST['task'] : (!empty($_GET['task']) ? $_GET['task'] : NULL);
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : (!empty($_GET['user_id']) ? $_GET['user_id'] : NULL);
$music_id = !empty($_POST['music_id']) ? $_POST['music_id'] : (!empty($_GET['music_id']) ? $_GET['music_id'] : NULL);
$music_order = !empty($_POST['music_order']) ? $_POST['music_order'] : (!empty($_GET['music_order']) ? $_GET['music_order'] : NULL);
$music_title = !empty($_POST['music_title']) ? $_POST['music_title'] : (!empty($_GET['music_title']) ? $_GET['music_title'] : NULL);
// Fix the question mark thingy for the flashplayer
if ($user_id && strpos($user_id, '?') !== FALSE) {
    $tmp_user_id_arr = explode("?", $user_id);
    $user_id = $tmp_user_id_arr[0];
}
$is_error = FALSE;
// GENERATE PLAYLIST
if ($task == "playlist" || !$task) {
    // GET MUSIC
    $music = new se_music($user_id);
    $musiclist = $music->music_list();
    $user_dir = $url->url_userdir($user_id);
    // GENERATE PLAYLIST
    $tracklist_xml = "";
    foreach ($musiclist as $song) {
        $tracklist_xml .= <<<EOF
     <track>
      <location>{$user_dir}{$song['music_id']}.{$song['music_ext']}</location>
      <annotation>{$song['music_title']}</annotation>
     </track>

EOF;
    }
    // OUTPUT
    ob_end_clean();
    echo <<<EOF
Пример #4
0
// ENSURE SORT/VIEW ARE VALID
if ($s != "music_date DESC" && $s != "music_track_num ASC") {
    $s = "music_date DESC";
}
if ($v != "0" && $v != "1") {
    $v = 0;
}
// ONLY MY FRIENDS' MUSIC
if ($v == "1" && $user->user_exists) {
    // SET WHERE CLAUSE
    $where = "(\r\n    SELECT\r\n      TRUE\r\n    FROM\r\n      se_friends\r\n    WHERE\r\n      friend_user_id1={$user->user_info[user_id]} &&\r\n      friend_user_id2=se_music.music_user_id &&\r\n      friend_status=1\r\n    ) \r\n  ";
}
// CREATE ALBUM OBJECT
$music_object = new se_music();
// GET TOTAL ALBUMS
$browse_music_total = $music_object->music_list_total(NULL, NULL, $where);
// MAKE ENTRY PAGES
$music_per_page = 20;
$page_vars = make_page($browse_music_total, $music_per_page, $p);
// GET ALBUM ARRAY
$browse_music_list = $music_object->music_list($page_vars[0], $music_per_page, $s, $where);
// ASSIGN SMARTY VARIABLES AND DISPLAY MUSIC PAGE
$smarty->assign('browse_music_list', $browse_music_list);
$smarty->assign('browse_music_total', $browse_music_total);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0] + 1);
$smarty->assign('p_end', $page_vars[0] + count($browse_music_list));
$smarty->assign('s', $s);
$smarty->assign('v', $v);
include "footer.php";