예제 #1
0
    $video->video_delete_selected($start, $videos_per_page, $sort, $where);
}
// GET TOTAL VIDEOS
$total_videos = $video->video_total($where);
// MAKE VIDEO PAGES
$page_vars = make_page($total_videos, $videos_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 VIDEO ARRAY
$videos = $video->video_list($page_vars[0], $videos_per_page, $sort, $where);
// ASSIGN VARIABLES AND SHOW VIEW VIDEOS PAGE
$smarty->assign('total_videos', $total_videos);
$smarty->assign('pages', $page_array);
$smarty->assign('videos', $videos);
$smarty->assign('f_title', $f_title);
$smarty->assign('f_owner', $f_owner);
$smarty->assign('i', $i);
$smarty->assign('t', $t);
$smarty->assign('u', $u);
$smarty->assign('f', $f);
$smarty->assign('su', $su);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('s', $s);
include "admin_footer.php";
예제 #2
0
            $database->database_query("UPDATE se_videos SET video_cache_rating='{$new_rating}', video_cache_rating_weighted='{$new_rating_weighted}', video_cache_rating_total='{$new_total}' WHERE video_id='{$video_info['video_id']}'");
            $allowed_to_rate = 0;
            $video_info['video_rating_full'] = floor($new_rating);
            $video_info['video_rating_part'] = $new_rating - $video_info['video_rating_full'] == 0 ? 0 : 1;
            $video_info['video_rating_none'] = 5 - $video_info['video_rating_full'] - $video_info['video_rating_part'];
            $video_info['video_rating_total'] = $new_total;
        }
    }
    $response_array = array('allowed_to_rate' => (bool) $allowed_to_rate, 'rating_full' => (int) $video_info['video_rating_full'], 'rating_part' => (int) $video_info['video_rating_part'], 'rating_none' => (int) $video_info['video_rating_none'], 'rating_total' => (int) $video_info['video_rating_total']);
    // OUTPUT JSON
    echo json_encode($response_array);
    exit;
}
// GET USER'S VIDEOS FOR CAROUSEL
$total_videos = $video->video_total("(video_is_converted='1')");
$video_array = $video->video_list(0, $video->video_total(), "video_id DESC", "(video_is_converted='1')", 1);
// GET VIDEO COMMENTS
$comment = new se_comment('video', 'video_id', $video_info['video_id']);
$total_comments = $comment->comment_total();
// UPDATE VIDEO VIEWS
if ($user->user_info['user_id'] != $owner->user_info['user_id']) {
    $video_views_new = $video_info['video_views'] + 1;
    $database->database_query("UPDATE se_videos SET video_views='{$video_views_new}' WHERE video_id='{$video_info['video_id']}' LIMIT 1");
}
// UPDATE NOTIFICATIONS
if ($user->user_info['user_id'] == $owner->user_info['user_id']) {
    $database->database_query("DELETE FROM se_notifys USING se_notifys LEFT JOIN se_notifytypes ON se_notifys.notify_notifytype_id=se_notifytypes.notifytype_id WHERE se_notifys.notify_user_id='{$owner->user_info['user_id']}' AND se_notifytypes.notifytype_name='videocomment' AND notify_object_id='{$video_info['video_id']}'");
}
// SET GLOBAL PAGE TITLE
$global_page_title[0] = 5500151;
$global_page_title[1] = $owner->user_displayname;
예제 #3
0
}
if ($user->user_exists && ($user->level_info['level_video_allow'] || $user->level_info['level_youtube_allow'])) {
    $plugin_vars['menu_user'] = array('file' => 'user_video.php', 'icon' => 'video_video16.gif', 'title' => 5500098);
}
// SET PROFILE MENU VARS
if (($owner->level_info['level_video_allow'] || $owner->level_info['level_youtube_allow']) && $page == "profile") {
    // START VIDEO
    $video = new se_video($owner->user_info['user_id']);
    $sort = "video_id DESC";
    // GET PRIVACY LEVEL AND SET WHERE
    $video_privacy_max = $owner->user_privacy_max($user);
    $where = "video_is_converted=1 AND (video_privacy & {$video_privacy_max})";
    // GET TOTAL VIDEOS
    $total_videos = $video->video_total($where);
    // GET VIDEO ARRAY
    $videos = $video->video_list(0, $total_videos, $sort, $where);
    // ASSIGN VIDEOS SMARY VARIABLE
    $smarty->assign('videos', $videos);
    $smarty->assign('total_videos', $total_videos);
    // SET PROFILE MENU VARS
    if ($total_videos) {
        $plugin_vars['menu_profile_tab'] = array('file' => 'profile_video_tab.tpl', 'title' => 5500098, 'name' => 'video');
    }
}
// Use template hooks
if (is_a($smarty, 'SESmarty')) {
    $plugin_vars['uses_tpl_hooks'] = TRUE;
    if (!empty($plugin_vars['menu_main'])) {
        $smarty->assign_hook('menu_main', $plugin_vars['menu_main']);
    }
    if (!empty($plugin_vars['menu_user'])) {