コード例 #1
0
ファイル: channel.php プロジェクト: tleonard2/durablegbFeb
 /**
  * Function mySubscriberDetailsModel is used to get my subscribed user channel details
  * @param int $userID user id
  * @return array
  */
 public function mySubscriberDetailsModel($userID)
 {
     global $wpdb;
     $mySubscriberID = json_decode(getSubscriberId($userID), true);
     if (!empty($userID) && !empty($mySubscriberID)) {
         return $wpdb->get_results('SELECT * FROM ' . WVG_CHANNEL . ' WHERE user_id IN(' . implode(',', $mySubscriberID) . ')');
     } else {
         return '';
     }
     exitAction('');
 }
コード例 #2
0
}
/** 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 */
$playListId = $playlistOBJ->_playListId;
$searchMsg = $playlistOBJ->_playlistsearchQuery;
$searchBtn = $playlistOBJ->_searchBtn;
$status = $playlistOBJ->_status;
$update = $playlistOBJ->_update;
/** Call function with PlaylistController object */
$playlistOBJ->add_playlist();
/** Call function to delete playlist data */
$playlistOBJ->get_delete();
/** Call function to display playlist data in grid section */
$gridPlaylist = $playlistOBJ->playlist_data();
/** Call function to count playlist data */
$playlist_count = $playlistOBJ->playlist_count($searchMsg, $searchBtn);
コード例 #3
0
/**
 * Video Detail Page action Ends Here
 *
 * Function for adding video ends
 *
 * @param unknown $youtube_media
 * @return void|unknown
 */
function hd_getsingleyoutubevideo($youtube_media)
{
    /** Check YouTube video id is exist */
    if ($youtube_media == '') {
        /** If not then return empty */
        return;
    }
    /** Get YouTube Api key form settings */
    $setting_youtube = getPlayerColorArray();
    $youtube_api_key = $setting_youtube['youtube_key'];
    /** Check Api key is applied in settings */
    if (!empty($youtube_api_key)) {
        /** Get URL to get Youtube video details */
        $url = 'https://www.googleapis.com/youtube/v3/videos?id=' . $youtube_media . '&part=contentDetails,snippet,statistics&key=' . $youtube_api_key;
        /** Call function to get detila from the given URL */
        $video_details = hd_getyoutubepage($url);
        /** Decode json data and get details */
        $decoded_data = json_decode($video_details);
        /** return YouTube video details */
        return get_object_vars($decoded_data);
    } else {
        /** If key is not applied, then dipslya error message */
        render_error(__('Could not retrieve Youtube video information. API Key is missing', APPTHA_VGALLERY));
    }
    exitAction('');
}
コード例 #4
0
 /**
  * Function to clear a watch history video
  * This function has userId to hold current user id
  * This function has videoId to hold video id to delete
  * This function has table to hold watch history details table name
  * This function has where variable as a array for query condition
  * This function delete a watch history video of current user
  * This function return delete result boolean value as a json encoded format
  * @param int $userId user id
  * @param int $videoId video id
  * @return string if success checkResult is true if not success checkResult is false
  */
 function clear_watch_history_video_model($userId, $videoId)
 {
     global $wpdb;
     /** table to hold watch history details table name */
     $table = WVG_WATCH_HISTORY_DETAILS;
     /** where hold query condition */
     $where = array('userid' => $userId, 'vid' => $videoId);
     /** format hold data format */
     $format = array('%d', '%d');
     /** deleteResult hold boolean value */
     $deleteResult = $wpdb->delete($table, $where, $format);
     if ($deleteResult) {
         echo json_encode(array('checkResult' => true));
         exitAction('');
     } else {
         echo json_encode(array('checkResult' => false));
         exitAction('');
     }
 }
コード例 #5
0
ファイル: playlist.php プロジェクト: tleonard2/durablegbFeb
 /**
  * Function clearPlaylist is used to delete all playlist of current user
  * This function has userId to hold current user id
  * This function has playlistId to hold playlist id
  * This function delete required playlist of current user
  * This function has exit statement to stop flow
  * @param int $userId user id
  * @param int $playlistId playlist id
  * @return array
  */
 public function clearPlaylist($userId, $playlistId)
 {
     global $wpdb;
     $table = $this->userPlaylistTable;
     $where = array('userid' => $userId, 'id' => $playlistId);
     $format = array('%d', '%d');
     $result = $wpdb->delete($table, $where, $format);
     $detailsTable = $this->userPlaylistDetailTable;
     $where = array('userid' => $userId, 'pid' => $playlistId);
     $format = array('%d', '%d');
     $wpdb->delete($detailsTable, $where, $format);
     if ($result) {
         echo json_encode(array('checkResult' => true));
         exitAction('');
     } else {
         echo json_encode(array('checkResult' => false));
         exitAction('');
     }
 }
コード例 #6
0
ファイル: channel.php プロジェクト: tleonard2/durablegbFeb
        /**
         * Function to display my subscriber details.
         * @return  string
         */
        public function mySubscriberTemplate()
        {
            $mySubscribeDetails = $this->mySubscribeUserDetails;
            $channelLink = channelPageLink();
            if (!empty($mySubscribeDetails)) {
                foreach ($mySubscribeDetails as $mySubscribeDetail) {
                    $jsonDetailsForSubscriber = json_decode($mySubscribeDetail->user_content, true);
                    $getProfileImage = $jsonDetailsForSubscriber['profileImage'];
                    $profileImage = $getProfileImage != '' && file_exists(APPTHA_VGALLERY_BASEDIR . "/images/channel/banner/profile/" . $getProfileImage) ? APPTHA_VGALLERY_BASEURL . "images/channel/banner/profile/" . $getProfileImage : APPTHA_VGALLERY_BASEURL . "images/channel/" . 'subs.png';
                    $subscriberLink = add_query_arg(array('ukey' => $mySubscribeDetail->user_key), $channelLink);
                    $subsName = strlen($mySubscribeDetail->user_name) > 20 ? substr($mySubscribeDetail->user_name, 0, 20) . ".." : $mySubscribeDetail->user_name;
                    $result .= '<div class="mysubscription" style="position:relative">
                <a href="' . $subscriberLink . '" style="text-decoration:none !important" target="_blank"><img src="' . $profileImage . '" style="width:160px;height:160px;"></a>
                <a href="' . $subscriberLink . '" style="text-decoration:none !important;" target="_blank"><h3 class="subscripeTitle" style="padding-left:5px;">' . $subsName . '</h3></a>
                <div class="closeSubscripe" style="cursor:pointer" onclick="closemysubscripers(this)"><img src="' . APPTHA_VGALLERY_BASEURL . 'images/channel/playerclose.png" title="Delete subscriber"></div>
                <input type="hidden" class="msid" value="' . $mySubscribeDetail->user_id . '">
		        </div>';
                }
                echo $result;
            } else {
                echo "<p class='novideostext'>" . __('No subscription', APPTHA_VGALLERY) . "</p><div style='clear:both'></div>";
            }
            exitAction('');
        }
コード例 #7
0
function admin_youtube_deatils()
{
    $act1 = youtubeurl();
    echo json_encode($act1);
    exitAction('');
}
コード例 #8
0
 /**
  * Function to publish googleadsense details.
  */
 public function googleadsense_publish($googleadsenseId, $status)
 {
     /** Get parameters from the request */
     $details = $this->videogoogleadsense_edit($googleadsenseId);
     $serialize = unserialize($details->googleadsense_details);
     $googleadsense_code = $serialize['googleadsense_code'];
     $googleadsense_title = $serialize['googleadsense_title'];
     $googleadsense_option = $serialize['adsense_option'];
     $adsense_reopen = $serialize['adsense_reopen'];
     $adsense_reopen_time = $serialize['adsense_reopen_time'];
     $adsenseshow_time = $serialize['adsenseshow_time'];
     $status = $status;
     /** Store all parameters in single array */
     $videoadData = array('googleadsense_code' => $googleadsense_code, 'publish' => $status, 'adsense_option' => $googleadsense_option, 'adsense_reopen' => $adsense_reopen, 'adsense_reopen_time' => $adsense_reopen_time, 'adsenseshow_time' => $adsenseshow_time, 'googleadsense_title' => $googleadsense_title);
     /** Serialize the form data and make an array */
     $videogoogleadData = serialize($videoadData);
     $googleadsenseData = array('googleadsense_details' => $videogoogleadData);
     $video_data_format = array('%s');
     /** Update status into google adsense table */
     $update = $this->videogoogleadsense_update($googleadsenseId, $googleadsenseData, $video_data_format);
     if ($update) {
         switch ($status) {
             case 0:
                 $this->redirectGadsPage($update, 'status', '');
                 break;
             case 1:
                 $this->redirectGadsPage($update, 'status', '1');
                 break;
             default:
                 break;
         }
     }
     exitAction('');
 }
コード例 #9
0
/**  
 * Video Image, Video, Subtitle srt file uploads.
 *
 * @category   Apptha
 * @package    Contus video Gallery
 * @version    3.0
 * @author     Apptha Team <*****@*****.**>
 * @copyright  Copyright (C) 2015 Apptha. All rights reserved.
 * @license    GNU General Public License http://www.gnu.org/copyleft/gpl.html 
 */
/** Get wp token for file upload */
$nonce = $_REQUEST['_wpnonce'];
/** Verify form token */
if (!wp_verify_nonce($nonce, 'upload-video')) {
    exitAction('Security block');
} else {
    /** Variable decalration and initialization */
    global $errorcode, $allowedExtensions, $file, $errorcode, $file_name;
    $file_name = $error = '';
    $errorcode = 12;
    $pro = 1;
    /** Initializing error messages while uploading files */
    $errormsg[0] = '<b>' . __('Upload Success', APPTHA_VGALLERY) . ':</b>' . __('File Uploaded Successfully', APPTHA_VGALLERY);
    $errormsg[1] = '<b>' . __('Upload Cancelled', APPTHA_VGALLERY) . ':</b>' . __('Cancelled by user', APPTHA_VGALLERY);
    $errormsg[2] = '<b>' . __('Upload Failed', APPTHA_VGALLERY) . ':</b>' . __('Invalid File type specified', APPTHA_VGALLERY);
    $errormsg[3] = '<b>' . __('Upload Failed', APPTHA_VGALLERY) . ':</b>' . __('Your File Exceeds Server Limit size', APPTHA_VGALLERY);
    $errormsg[4] = '<b>' . __('Upload Failed', APPTHA_VGALLERY) . ':</b>' . __('Unknown Error Occured', APPTHA_VGALLERY);
    $errormsg[5] = '<b>' . __('Upload Failed', APPTHA_VGALLERY) . ':</b>' . __('The uploaded file exceeds the upload_max_filesize directive in php.ini', APPTHA_VGALLERY);
    $errormsg[6] = '<b>' . __('Upload Failed', APPTHA_VGALLERY) . ':</b>' . __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', APPTHA_VGALLERY);
    $errormsg[7] = '<b>' . __('Upload Failed', APPTHA_VGALLERY) . ':</b>' . __('The uploaded file was only partially uploaded', APPTHA_VGALLERY);
コード例 #10
0
ファイル: watchlater.php プロジェクト: tleonard2/durablegbFeb
 /**
  * Function watchLaterStatusModel update watch later video status to -2
  * Function call update_watch_later method to update watch later video
  * This function has userId to hold current user id
  * This function has data variable to hold status details
  * This function has videoId to hold video id
  * This function update video status
  * This function has exit statement to stop flow
  * @param int $userId user id
  * @param int $videoId video id
  * @return string if success checkResult is true if not success checkResult is false
  */
 public function watchLaterStatusModel($userId, $videoId)
 {
     global $wpdb;
     /** dateTime to hold current time */
     $data = array('status' => -2);
     /** where hold query condition */
     $where = array('userid' => $userId, 'vid' => $videoId);
     /** format hold data format */
     $format = array('%d');
     /** whereFormat hold where format */
     $whereFormat = array('%d', '%d');
     /** result has boolean value */
     $checkResult = $wpdb->update($this->watchDetailsTable, $data, $where, $format, $whereFormat);
     if ($checkResult) {
         echo json_encode(array('checkResult' => true));
     } else {
         echo json_encode(array('checkResult' => false));
     }
     exitAction('');
 }
コード例 #11
0
 * If the wp-load.php file is not found, then an error will be displayed
 * wp-content\plugins\contus-video-gallery\hdflv-config.php
 * Define the server path to the file wp-config here, if you placed WP-CONTENT outside the classic file structure
 */
$path = '';
/**
 * Check whether the default WordPress 
 * load path is defined 
 */
if (!defined('WP_LOAD_PATH')) {
    /**
     * Classic root path if wp-content and plugins is below wp-config.php
     * It should be end with a trailing slash
     */
    $classic_root = dirname(dirname(dirname(dirname(__FILE__)))) . '/';
    /**
     * Define wp-load.php file path
     * If it is not found then die with the message 
     */
    if (file_exists($classic_root . 'wp-load.php')) {
        define('WP_LOAD_PATH', $classic_root);
    } else {
        if (file_exists($path . 'wp-load.php')) {
            define('WP_LOAD_PATH', $path);
        } else {
            exitAction('Could not find the file');
        }
    }
}
/** Let's load WordPress */
require_once WP_LOAD_PATH . 'wp-load.php';