if ($playlistActionup || $playlistActiondown == 'playlistdelete') { if (is_array($playListcheckId)) { $playListId = implode(',', $playListcheckId); $deleteflag = $this->playlist_delete($playListId); if (!$deleteflag) { $this->admin_redirect('admin.php?page=playlist&del=0'); } else { $this->admin_redirect('admin.php?page=playlist&del=1'); } } } } } } } $playlistOBJ = new PlaylistController(); // creating object for VideoadController class $playlistOBJ->add_playlist(); $playlistOBJ->get_delete(); $playListId = $playlistOBJ->_playListId; $searchMsg = $playlistOBJ->_playlistsearchQuery; $searchBtn = $playlistOBJ->_searchBtn; $status = $playlistOBJ->_status; $update = $playlistOBJ->_update; $gridPlaylist = $playlistOBJ->playlist_data(); $playlist_count = $playlistOBJ->playlist_count($searchMsg, $searchBtn); if (!empty($playListId)) { if (isset($_GET['status']) || isset($_GET['update'])) { $playlistEdit = ''; } else { $playlistEdit = $playlistOBJ->playlist_edit($playListId);
return $wpdb->get_results($wpdb->prepare("SELECT id,playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare_user_playlist WHERE userid=%d ORDER BY ID desc", $userId)); } /** * Function getSearchPlaylistDetails is used to get searched playlist details * @return array */ public function getSearchPlaylistDetails($userId, $playlistName) { global $wpdb; return $wpdb->get_results($wpdb->prepare("SELECT id,playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare_user_playlist WHERE userid=%d AND playlist_name=%sORDER BY ID desc", $userId, $playlistName)); } } /** Checking playlist controller class if ends */ } /** Creating object for PlaylistController class */ $playlistOBJ = new PlaylistController(); if ($adminPage == 'userplaylist') { $userDetails = $playlistOBJ->getUserDetailsController(); $userId = isset($_POST['uid']) && $_POST['uid'] != '' ? intval($_POST['uid']) : ''; $searchMsg = isset($_POST['PlaylistssearchQuery']) && $_POST['PlaylistssearchQuery'] != '' ? strip_tags($_POST['PlaylistssearchQuery']) : ''; if (!empty($userId) && !empty($searchMsg)) { $playlistDetails = $playlistOBJ->getSearchPlaylistDetails($userId, $searchMsg); } elseif (!empty($userId)) { $playlistDetails = $playlistOBJ->getPlaylistDetails($userId); } else { $playlistDetails = ''; } require_once APPTHA_VGALLERY_BASEDIR . DS . 'admin/views/playlist/userplaylist.php'; exitAction(''); } /** Assign class variables into local variables */
/** * Function to display playlist page * This function is used to include controller file for watch later and watch history features * This function has playlist_page to hold current page details * This function has link to hold current page permalink * This function has userID to hold current user id * This function include watch.min.css file * This function include playlistscroll script file * This function include playlistcontroller controller file * This function create object for PlaylistController class * This function call displayController method on controller file * @return void */ function show_playlist($attr) { global $frontControllerPath, $frontModelPath, $frontViewPath, $wpdb; $playlist_page = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "posts WHERE post_content=%s AND post_status=%s", "[showplaylist]", "publish")); if (get_option('permalink_structure')) { $link = get_site_url() . '/' . $playlist_page[0]->post_name; } else { $link = $playlist_page[0]->guid; } if (!empty($attr['user'])) { $userID = get_user_by('login', $attr['user'])->ID; } else { $userID = ''; } if (is_user_logged_in()) { wp_register_style('watch_history', plugins_url('css/watch.min.css', __FILE__)); wp_enqueue_style('watch_history'); wp_register_script('playlistscroll_js', plugins_url('/js/playlistscroll.min.js', __FILE__)); wp_enqueue_script('playlistscroll_js'); include_once $frontControllerPath . 'playlistcontroller.php'; $controllerObj = new PlaylistController($userID); $controllerObj->displayController(); } else { header('location:' . get_site_url() . '/wp-login.php?redirect_to=' . urlencode($link)); } }