From aae8560982112593e6c023846000dd4e6f13b3d7 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 29 Jun 2020 09:50:11 -0300 Subject: [PATCH 1/5] frameBorder="0" --- plugin/WWBN/page/wwbn_signup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/WWBN/page/wwbn_signup.php b/plugin/WWBN/page/wwbn_signup.php index c17cd44b518c..54d02ee85748 100644 --- a/plugin/WWBN/page/wwbn_signup.php +++ b/plugin/WWBN/page/wwbn_signup.php @@ -24,7 +24,7 @@ include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
- +
Date: Mon, 29 Jun 2020 09:57:02 -0300 Subject: [PATCH 2/5] --- .gitignore | 1 + plugin/API/API.php | 154 ++++++++-- plugin/YPTWallet/Objects/Wallet.php | 1 + plugin/YPTWallet/YPTWallet.php | 5 +- .../plugins/YPTWalletStripe/confirmButton.php | 53 ++-- view/js/flipdown/flipdown.css | 283 ++++++++++++++++++ view/js/flipdown/flipdown.js | 277 +++++++++++++++++ view/js/flipdown/flipdown.min.css | 1 + view/js/flipdown/flipdown.min.js | 1 + view/js/flipdown/small.css | 68 +++++ 10 files changed, 801 insertions(+), 43 deletions(-) create mode 100644 view/js/flipdown/flipdown.css create mode 100644 view/js/flipdown/flipdown.js create mode 100644 view/js/flipdown/flipdown.min.css create mode 100644 view/js/flipdown/flipdown.min.js create mode 100644 view/js/flipdown/small.css diff --git a/.gitignore b/.gitignore index a76abbb4fbe6..c16742f652c1 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ /plugin/CreateUserManager/ /plugin/ImportFromOtherVideoPlatform/ /plugin/PayPerView/ +/plugin/PayPerViewLive/ /plugin/VideoHLS/ /plugin/Chat2/ /plugin/User_Controll/ diff --git a/plugin/API/API.php b/plugin/API/API.php index ca7bc9e60d6a..6923ccc1cfcc 100644 --- a/plugin/API/API.php +++ b/plugin/API/API.php @@ -124,7 +124,7 @@ public function get_api_category($parameters) { $obj->rows = $rows; return new ApiObject("", false, $obj); } - + /** * @param type $parameters * 'APISecret' to list all videos @@ -133,40 +133,40 @@ public function get_api_category($parameters) { * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&playlists_id=1&index=2&APISecret={APISecret} * @return \ApiObject */ - public function get_api_video_from_program($parameters){ + public function get_api_video_from_program($parameters) { global $global; $playlists = AVideoPlugin::loadPlugin("PlayLists"); - if(empty($parameters['playlists_id'])){ + if (empty($parameters['playlists_id'])) { return new ApiObject("Playlist ID is empty", true, $parameters); } $videos = PlayLists::getOnlyVideosAndAudioIDFromPlaylistLight($parameters['playlists_id']); - - if(empty($videos)){ + + if (empty($videos)) { return new ApiObject("There are no videos for this playlist", true, $parameters); } - - if(empty($parameters['index'])){ + + if (empty($parameters['index'])) { $parameters['index'] = 0; } - - if(empty($videos[$parameters['index']])){ + + if (empty($videos[$parameters['index']])) { $video = $videos[0]; - }else{ + } else { $video = $videos[$parameters['index']]; } - - $parameters['nextIndex'] = $parameters['index']+1; - - if(empty($videos[$parameters['nextIndex']])){ + + $parameters['nextIndex'] = $parameters['index'] + 1; + + if (empty($videos[$parameters['nextIndex']])) { $parameters['nextIndex'] = 0; } $videoPath = Video::getHigherVideoPathFromID($video['id']); $parameters['videos_id'] = $video['id']; $parameters['path'] = $videoPath; - + return new ApiObject("", false, $parameters); } - + /** * @param type $parameters * 'APISecret' to list all videos @@ -174,13 +174,13 @@ public function get_api_video_from_program($parameters){ * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&videos_id=1&APISecret={APISecret} * @return \ApiObject */ - public function get_api_video_file($parameters){ + public function get_api_video_file($parameters) { global $global; $obj = $this->startResponseObject($parameters); $obj->video_file = Video::getHigherVideosPathsFromID($videos_id); return new ApiObject("", false, $obj); } - + /** * @param type $parameters * ['APISecret' to list all videos] @@ -430,12 +430,12 @@ public function get_api_channels($parameters) { $obj->photo = User::getPhoto($value['id']); $obj->channelLink = User::getChannelLink($value['id']); $obj->name = User::getNameIdentificationById($value['id']); - + $list[] = $obj; } return new ApiObject("", false, $list); } - + /** * @param type $parameters * Return all Programs (Playlists) on this site @@ -463,7 +463,7 @@ public function get_api_programs($parameters) { } return new ApiObject("", false, $list); } - + /** * @param type $parameters * Return all categories on this site @@ -716,6 +716,118 @@ private function favorite($parameters, $add) { exit; } + /** + * @param type $parameters + * Try this API here + * 'message' the message for the chat + * ['users_id'] User's ID to what this message will be sent to (send the users_id or room_users_id) + * ['room_users_id'] User's ID from the channel where this message will be sent to (send the users_id or room_users_id) + * 'message' URL encoded message + * 'user' usename of the user + * 'pass' password of the user + * 'encodedPass' tell the script id the password submited is raw or encrypted + * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&message=HelloWorld&users_id=2&room_users_id=4&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true + * @return type + */ + public function set_api_chat2_message($parameters) { + global $global; + $plugin = AVideoPlugin::loadPluginIfEnabled("Chat2"); + if (empty($plugin)) { + return new ApiObject("Plugin disabled"); + } + if (!User::isLogged()) { + return new ApiObject("User must be logged"); + } + $_POST['message'] = $parameters['message']; + $_GET['users_id'] = $parameters['users_id']; + $_GET['room_users_id'] = $parameters['room_users_id']; + include $global['systemRootPath'] . 'plugin/Chat2/sendMessage.json.php'; + exit; + } + + + /** + * @param type $parameters + * The sample here will return 10 messages + * Try this API here + * ['to_users_id'] User's ID where this message was private sent to + * ['lower_then_id'] Chat message ID to filter the message search. will only return messages before that chat id + * ['greater_then_id'] Chat message ID to filter the message search. will only return messages after that chat id + * 'message' URL encoded message + * 'user' usename of the user + * 'pass' password of the user + * 'encodedPass' tell the script id the password submited is raw or encrypted + * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&greater_then_id=88&lower_then_id=98&to_users_id=2&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true + * @return type + */ + public function get_api_chat2_chat($parameters) { + global $global; + $plugin = AVideoPlugin::loadPluginIfEnabled("Chat2"); + if (empty($plugin)) { + return new ApiObject("Plugin disabled"); + } + if (!User::isLogged()) { + return new ApiObject("User must be logged"); + } + $_GET['to_users_id'] = $parameters['to_users_id']; + $_GET['lower_then_id'] = $parameters['lower_then_id']; + + if(!empty($parameters['greater_then_id'])){ + if(empty($_SESSION['chatLog'])){ + $_SESSION['chatLog'] = array(); + } + if(empty($_SESSION['chatLog'][$_GET['to_users_id']])){ + $_SESSION['chatLog'][$_GET['to_users_id']] = array(); + } + $_SESSION['chatLog'][$_GET['to_users_id']][0]['id'] = $parameters['greater_then_id']; + } + + include $global['systemRootPath'] . 'plugin/Chat2/getChat.json.php'; + exit; + } + + + + /** + * @param type $parameters + * The sample here will return 10 messages id greater then 88 and lower then 98 + * Try this API here + * ['room_users_id'] User's ID (channel) where this message was public sent to + * ['lower_then_id'] Chat message ID to filter the message search. will only return messages before that chat id + * ['greater_then_id'] Chat message ID to filter the message search. will only return messages after that chat id + * 'message' URL encoded message + * 'user' usename of the user + * 'pass' password of the user + * 'encodedPass' tell the script id the password submited is raw or encrypted + * @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&greater_then_id=88&lower_then_id=98&room_users_id=2&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true + * @return type + */ + public function get_api_chat2_room($parameters) { + global $global; + $plugin = AVideoPlugin::loadPluginIfEnabled("Chat2"); + if (empty($plugin)) { + return new ApiObject("Plugin disabled"); + } + if (!User::isLogged()) { + return new ApiObject("User must be logged"); + } + $_GET['room_users_id'] = $parameters['room_users_id']; + $_GET['lower_then_id'] = $parameters['lower_then_id']; + + if(!empty($parameters['greater_then_id'])){ + if(empty($_SESSION['chatLog'])){ + $_SESSION['chatLog'] = array(); + } + if(empty($_SESSION['chatLog'][$_GET['to_users_id']])){ + $_SESSION['chatLog'][$_GET['to_users_id']] = array(); + } + $_SESSION['chatLog'][$_GET['to_users_id']][0]['id'] = $parameters['greater_then_id']; + } + + include $global['systemRootPath'] . 'plugin/Chat2/getRoom.json.php'; + exit; + } + } class ApiObject { diff --git a/plugin/YPTWallet/Objects/Wallet.php b/plugin/YPTWallet/Objects/Wallet.php index ad8777690fd9..eaea180d73f8 100644 --- a/plugin/YPTWallet/Objects/Wallet.php +++ b/plugin/YPTWallet/Objects/Wallet.php @@ -72,6 +72,7 @@ static function getFromUser($users_id) { $res = $global['mysqli']->query($sql); if ($res) { $row = $res->fetch_assoc(); + $res->free();// do not cache the result } else { $row = false; } diff --git a/plugin/YPTWallet/YPTWallet.php b/plugin/YPTWallet/YPTWallet.php index 83ab2a7fa557..11a4e40495dc 100644 --- a/plugin/YPTWallet/YPTWallet.php +++ b/plugin/YPTWallet/YPTWallet.php @@ -228,6 +228,9 @@ public function saveBalance($users_id, $value) { public function transferBalanceToSiteOwner($users_id_from, $value, $description = "", $forceTransfer = false) { $obj = $this->getDataObject(); + if(empty($obj->manualWithdrawFundsTransferToUserId)){ + _error_log("YPTWallet::transferBalanceToSiteOwner site owner is not defined in the plugin, define it on the option manualWithdrawFundsTransferToUserId", AVideoLog::$ERROR); + } return $this->transferBalance($users_id_from, $obj->manualWithdrawFundsTransferToUserId, $value, $description, $forceTransfer); } @@ -271,7 +274,7 @@ public function transferBalance($users_id_from, $users_id_to, $value, $forceDesc $balance = $wallet->getBalance(); $newBalance = $balance - $value; if ($newBalance < 0) { - _error_log("transferBalance: you dont have balance, $users_id_from,$users_id_to, $value"); + _error_log("transferBalance: you dont have balance, $users_id_from,$users_id_to, $value (Balance: {$balance}) (New Balance: {$newBalance})"); return false; } $identificationFrom = User::getNameIdentificationById($users_id_from); diff --git a/plugin/YPTWallet/plugins/YPTWalletStripe/confirmButton.php b/plugin/YPTWallet/plugins/YPTWalletStripe/confirmButton.php index efca31284fc2..6eb1c6b01665 100644 --- a/plugin/YPTWallet/plugins/YPTWalletStripe/confirmButton.php +++ b/plugin/YPTWallet/plugins/YPTWalletStripe/confirmButton.php @@ -1,5 +1,6 @@ - + -