1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Merge remote-tracking branch 'origin/master' into julzxcapz-yp

This commit is contained in:
Julius 2023-07-24 13:46:51 +00:00
commit e97ef28c31
29 changed files with 2982 additions and 4340 deletions

24
composer.lock generated
View file

@ -281,16 +281,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.275.7",
"version": "3.276.3",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903"
"reference": "c8b38cfab677a3ec98e3f40bccd1a2bf851a014f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/54dcef3349c81b46c0f5f6e54b5f9bfb5db19903",
"reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c8b38cfab677a3ec98e3f40bccd1a2bf851a014f",
"reference": "c8b38cfab677a3ec98e3f40bccd1a2bf851a014f",
"shasum": ""
},
"require": {
@ -370,9 +370,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.275.7"
"source": "https://github.com/aws/aws-sdk-php/tree/3.276.3"
},
"time": "2023-07-13T18:21:04+00:00"
"time": "2023-07-21T18:30:18+00:00"
},
{
"name": "brick/math",
@ -3988,16 +3988,16 @@
},
{
"name": "stripe/stripe-php",
"version": "v10.17.0",
"version": "v10.18.0",
"source": {
"type": "git",
"url": "https://github.com/stripe/stripe-php.git",
"reference": "73383b44de153f4d602b90dad3ef075259bcecef"
"reference": "c32549e443a619d1b885b99d624568ecae82d6a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/73383b44de153f4d602b90dad3ef075259bcecef",
"reference": "73383b44de153f4d602b90dad3ef075259bcecef",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/c32549e443a619d1b885b99d624568ecae82d6a0",
"reference": "c32549e443a619d1b885b99d624568ecae82d6a0",
"shasum": ""
},
"require": {
@ -4043,9 +4043,9 @@
],
"support": {
"issues": "https://github.com/stripe/stripe-php/issues",
"source": "https://github.com/stripe/stripe-php/tree/v10.17.0"
"source": "https://github.com/stripe/stripe-php/tree/v10.18.0"
},
"time": "2023-07-13T22:12:18+00:00"
"time": "2023-07-20T16:59:49+00:00"
},
{
"name": "symfony/console",

File diff suppressed because it is too large Load diff

View file

@ -1648,9 +1648,10 @@ if (!class_exists('Video')) {
$created = !empty($_POST['sort']['v.created']) ? $_POST['sort']['v.created'] : $_POST['sort']['created'];
unset($_POST['sort']);
$_POST['sort'] = array();
$_POST['sort']['v.`order`'] = 'IS NOT NULL DESC';
$_POST['sort']['`order`'] = 'ASC';
if(strtoupper($created) === 'DESC'){
$_POST['sort']['v.`order`'] = 'IS NOT NULL DESC';
$_POST['sort']['`order`'] = 'ASC';
}
$_POST['sort']['v.created'] = $created;
}
@ -1700,7 +1701,7 @@ if (!class_exists('Video')) {
}
}
//echo $sql;//var_dump($_REQUEST['doNotShowCatChilds']);exit;
//echo $sql;//exit;
//_error_log("getAllVideos($status, $showOnlyLoggedUserVideos , $ignoreGroup , ". json_encode($videosArrayId).")" . $sql);
$timeLogName = TimeLogStart("video::getAllVideos");

View file

@ -63,7 +63,19 @@ if ($seconds_watching_video < 0) {
$seconds_watching_video = 0;
}
// Comparison and update
$current_time = time();
if (isset($_SESSION['addViewCount'][$_REQUEST['id']]['last_update_time'])) {
$elapsed_time = $current_time - $_SESSION['addViewCount'][$_REQUEST['id']]['last_update_time'];
if ($seconds_watching_video > $elapsed_time) {
$seconds_watching_video = $elapsed_time;
}
}
$_SESSION['addViewCount'][$_REQUEST['id']]['last_update_time'] = $current_time;
$obj2->seconds_watching_video = $seconds_watching_video;
if (empty($_SESSION['addViewCount'][$_REQUEST['id']]['time'])) {
//_error_log("videos_statistics addView {$_REQUEST['id']} {$_SERVER['HTTP_USER_AGENT']} ".json_encode($_SESSION['addViewCount']));
$resp = $obj->addView();

View file

@ -20,6 +20,6 @@ Video::resetOrder();
foreach ($_REQUEST['videos'] as $key => $value) {
$obj->responses[] = Video::updateOrder($value['videos_id'], $value['order']);
}
$obj->error = empty($obj->responses);
$obj->error = empty($obj->responses) && !empty($_REQUEST['videos']);
mysqlCommit();
echo json_encode($obj);

View file

@ -22,6 +22,7 @@ class VideoStatistic extends ObjectYPT {
protected $seconds_watching_video;
protected $json;
protected $rewarded;
protected $created_php_time;
public static function getSearchFieldsNames() {
return ['json', 'ip', 'when', 'user', 'name', 'email', 'channelName'];
@ -105,6 +106,10 @@ class VideoStatistic extends ObjectYPT {
$vs->setWhen(date("Y-m-d h:i:s"));
} else {
$vs = new VideoStatistic($lastStatistic['id']);
$elapsedTime = time() - $vs->created_php_time;
if ($seconds_watching_video > $elapsedTime) {
$seconds_watching_video = $elapsedTime;
}
}
$vs->setLastVideoTime($lastVideoTime);
$vs->setIp(getRealIpAddr());

289
package-lock.json generated
View file

@ -16,7 +16,7 @@
"flickity": "^3.0.0",
"flickity-bg-lazyload": "^2.0.0",
"fontawesome-free": "^1.0.4",
"hls.js": "^1.4.9",
"hls.js": "^1.4.10",
"infinite-scroll": "^4.0.1",
"inputmask": "^5.0.8",
"jquery": "^3.7.0",
@ -32,13 +32,13 @@
"p2p-media-loader-hlsjs": "^0.6.2",
"pouchdb": "^8.0.0",
"sweetalert": "^2.1.2",
"tinymce": "^6.4.2",
"tinymce": "^6.6.0",
"tinymce-langs": "^1.0.0",
"video.js": "^8.3.0",
"videojs-contrib-ads": "^7.2.0",
"videojs-contrib-ads": "^7.3.2",
"videojs-contrib-quality-levels": "^4.0.0",
"videojs-font": "^4.1.0",
"videojs-ima": "^2.1.0",
"videojs-ima": "^2.2.0",
"videojs-landscape-fullscreen": "^11.1111.0",
"videojs-overlay": "^3.1.0",
"videojs-playlist": "^5.1.0",
@ -801,9 +801,9 @@
}
},
"node_modules/hls.js": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.9.tgz",
"integrity": "sha512-i2BuNh7C7sd+wpW1V9p+P37KKCWNc6Ph/3BiPr+8nfJ7eZdtQQvSQUn2QwKU+7Fvc7b5BpS/lM6RJ3LUf+XbWg=="
"version": "1.4.10",
"resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.10.tgz",
"integrity": "sha512-wAVSj4Fm2MqOHy5+BlYnlKxXvJlv5IuZHjlzHu18QmjRzSDFQiUDWdHs5+NsFMQrgKEBwuWDcyvaMC9dUzJ5Uw=="
},
"node_modules/ieee754": {
"version": "1.2.1",
@ -1731,9 +1731,9 @@
}
},
"node_modules/tinymce": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.4.2.tgz",
"integrity": "sha512-te+4c8PoAwTKPMBQtMQehnSZlOO9Ay5tDgaRFJKBehYb6SlX2PYZ0v3oe/cmiv5EfqdwZLkEMXk2MNOeApZZLg=="
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.6.0.tgz",
"integrity": "sha512-b9Mb7z8ryFOwLm8WCmlpwzdgOt1xD1u5Jjdh68B4QjkIyTLyHRBsfsrbiCUGonnVTymDlkexPkaP8sj24zexKQ=="
},
"node_modules/tinymce-langs": {
"version": "1.0.0",
@ -1911,9 +1911,9 @@
}
},
"node_modules/videojs-contrib-ads": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/videojs-contrib-ads/-/videojs-contrib-ads-7.2.0.tgz",
"integrity": "sha512-5DAO8BpD4mm/xKCGm4JhmIkjYOC+TByiO0XXInoc981Gr71xcFpO2wxPHMFrojhKROmYGWnYKcLsKNMkvYOWHg==",
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/videojs-contrib-ads/-/videojs-contrib-ads-7.3.2.tgz",
"integrity": "sha512-O5zSqP9GePr8XDUgCKQoRdDr5dUX5GEbNx7s2R7LC/Pxn8L10x3RNCrijzO56bli7Vr5wAlTJgAk1dR5lqQ44A==",
"dependencies": {
"global": "^4.3.2"
},
@ -1946,143 +1946,22 @@
"integrity": "sha512-X1LuPfLZPisPLrANIAKCknZbZu5obVM/ylfd1CN+SsCmPZQ3UMDPcvLTpPBJxcBuTpHQq2MO1QCFt7p8spnZ/w=="
},
"node_modules/videojs-ima": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/videojs-ima/-/videojs-ima-2.1.0.tgz",
"integrity": "sha512-Zb+J4by0d4FbserGOiSbdNo0U4vXSDuiPVCKFMksbaj4DO3mC8IpmvZ9Vci3tUwOhb/ladmUdhif9euSwq92Sw==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/videojs-ima/-/videojs-ima-2.2.0.tgz",
"integrity": "sha512-VKg7mZsaiW89ko2Sjfz/sDcCbCTjj2OAkg8CakvCs9ZiVg20g6QYVtEWj249V/HTm0/1X01GEPk9hnIrRzgd+A==",
"dependencies": {
"@hapi/cryptiles": "^5.1.0",
"can-autoplay": "^3.0.2",
"extend": ">=3.0.2",
"videojs-contrib-ads": "^6.9.0"
"videojs-contrib-ads": "^6.9.0 || ^7"
},
"engines": {
"node": ">=0.8.0"
},
"peerDependencies": {
"video.js": "^5.19.2 || ^6 || ^7"
"video.js": "^5.19.2 || ^6 || ^7 || ^8"
}
},
"node_modules/videojs-ima/node_modules/@videojs/http-streaming": {
"version": "2.16.2",
"resolved": "https://registry.npmjs.org/@videojs/http-streaming/-/http-streaming-2.16.2.tgz",
"integrity": "sha512-etPTUdCFu7gUWc+1XcbiPr+lrhOcBu3rV5OL1M+3PDW89zskScAkkcdqYzP4pFodBPye/ydamQoTDScOnElw5A==",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "3.0.5",
"aes-decrypter": "3.1.3",
"global": "^4.4.0",
"m3u8-parser": "4.8.0",
"mpd-parser": "^0.22.1",
"mux.js": "6.0.1",
"video.js": "^6 || ^7"
},
"engines": {
"node": ">=8",
"npm": ">=5"
},
"peerDependencies": {
"video.js": "^6 || ^7"
}
},
"node_modules/videojs-ima/node_modules/@videojs/http-streaming/node_modules/video.js": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/video.js/-/video.js-7.21.4.tgz",
"integrity": "sha512-R5e57M/5uqxQMQpFpybNbd8GtiRwFJPqkHjrhv0QTJ2tqnesbjETbck5kU5dhFr1FevsJRFhjBG4hAnvRGnXbw==",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@videojs/http-streaming": "2.16.2",
"@videojs/vhs-utils": "^3.0.4",
"@videojs/xhr": "2.6.0",
"aes-decrypter": "3.1.3",
"global": "^4.4.0",
"keycode": "^2.2.0",
"m3u8-parser": "4.8.0",
"mpd-parser": "0.22.1",
"mux.js": "6.0.1",
"safe-json-parse": "4.0.0",
"videojs-font": "3.2.0",
"videojs-vtt.js": "^0.15.4"
}
},
"node_modules/videojs-ima/node_modules/aes-decrypter": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/aes-decrypter/-/aes-decrypter-3.1.3.tgz",
"integrity": "sha512-VkG9g4BbhMBy+N5/XodDeV6F02chEk9IpgRTq/0bS80y4dzy79VH2Gtms02VXomf3HmyRe3yyJYkJ990ns+d6A==",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "^3.0.5",
"global": "^4.4.0",
"pkcs7": "^1.0.4"
}
},
"node_modules/videojs-ima/node_modules/mpd-parser": {
"version": "0.22.1",
"resolved": "https://registry.npmjs.org/mpd-parser/-/mpd-parser-0.22.1.tgz",
"integrity": "sha512-fwBebvpyPUU8bOzvhX0VQZgSohncbgYwUyJJoTSNpmy7ccD2ryiCvM7oRkn/xQH5cv73/xU7rJSNCLjdGFor0Q==",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "^3.0.5",
"@xmldom/xmldom": "^0.8.3",
"global": "^4.4.0"
},
"bin": {
"mpd-to-m3u8-json": "bin/parse.js"
}
},
"node_modules/videojs-ima/node_modules/mux.js": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/mux.js/-/mux.js-6.0.1.tgz",
"integrity": "sha512-22CHb59rH8pWGcPGW5Og7JngJ9s+z4XuSlYvnxhLuc58cA1WqGDQPzuG8I+sPm1/p0CdgpzVTaKW408k5DNn8w==",
"dependencies": {
"@babel/runtime": "^7.11.2",
"global": "^4.4.0"
},
"bin": {
"muxjs-transmux": "bin/transmux.js"
},
"engines": {
"node": ">=8",
"npm": ">=5"
}
},
"node_modules/videojs-ima/node_modules/videojs-contrib-ads": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/videojs-contrib-ads/-/videojs-contrib-ads-6.9.0.tgz",
"integrity": "sha512-nzKz+jhCGMTYffSNVYrmp9p70s05v6jUMOY3Z7DpVk3iFrWK4Zi/BIkokDWrMoHpKjdmCdKzfJVBT+CrUj6Spw==",
"dependencies": {
"global": "^4.3.2",
"video.js": "^6 || ^7"
},
"engines": {
"node": ">=8",
"npm": ">=5"
}
},
"node_modules/videojs-ima/node_modules/videojs-contrib-ads/node_modules/video.js": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/video.js/-/video.js-7.21.4.tgz",
"integrity": "sha512-R5e57M/5uqxQMQpFpybNbd8GtiRwFJPqkHjrhv0QTJ2tqnesbjETbck5kU5dhFr1FevsJRFhjBG4hAnvRGnXbw==",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@videojs/http-streaming": "2.16.2",
"@videojs/vhs-utils": "^3.0.4",
"@videojs/xhr": "2.6.0",
"aes-decrypter": "3.1.3",
"global": "^4.4.0",
"keycode": "^2.2.0",
"m3u8-parser": "4.8.0",
"mpd-parser": "0.22.1",
"mux.js": "6.0.1",
"safe-json-parse": "4.0.0",
"videojs-font": "3.2.0",
"videojs-vtt.js": "^0.15.4"
}
},
"node_modules/videojs-ima/node_modules/videojs-font": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/videojs-font/-/videojs-font-3.2.0.tgz",
"integrity": "sha512-g8vHMKK2/JGorSfqAZQUmYYNnXmfec4MLhwtEFS+mMs2IDY398GLysy6BH6K+aS1KMNu/xWZ8Sue/X/mdQPliA=="
},
"node_modules/videojs-landscape-fullscreen": {
"version": "11.1111.0",
"resolved": "https://registry.npmjs.org/videojs-landscape-fullscreen/-/videojs-landscape-fullscreen-11.1111.0.tgz",
@ -2805,9 +2684,9 @@
}
},
"hls.js": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.9.tgz",
"integrity": "sha512-i2BuNh7C7sd+wpW1V9p+P37KKCWNc6Ph/3BiPr+8nfJ7eZdtQQvSQUn2QwKU+7Fvc7b5BpS/lM6RJ3LUf+XbWg=="
"version": "1.4.10",
"resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.10.tgz",
"integrity": "sha512-wAVSj4Fm2MqOHy5+BlYnlKxXvJlv5IuZHjlzHu18QmjRzSDFQiUDWdHs5+NsFMQrgKEBwuWDcyvaMC9dUzJ5Uw=="
},
"ieee754": {
"version": "1.2.1",
@ -3491,9 +3370,9 @@
}
},
"tinymce": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.4.2.tgz",
"integrity": "sha512-te+4c8PoAwTKPMBQtMQehnSZlOO9Ay5tDgaRFJKBehYb6SlX2PYZ0v3oe/cmiv5EfqdwZLkEMXk2MNOeApZZLg=="
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.6.0.tgz",
"integrity": "sha512-b9Mb7z8ryFOwLm8WCmlpwzdgOt1xD1u5Jjdh68B4QjkIyTLyHRBsfsrbiCUGonnVTymDlkexPkaP8sj24zexKQ=="
},
"tinymce-langs": {
"version": "1.0.0",
@ -3644,9 +3523,9 @@
}
},
"videojs-contrib-ads": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/videojs-contrib-ads/-/videojs-contrib-ads-7.2.0.tgz",
"integrity": "sha512-5DAO8BpD4mm/xKCGm4JhmIkjYOC+TByiO0XXInoc981Gr71xcFpO2wxPHMFrojhKROmYGWnYKcLsKNMkvYOWHg==",
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/videojs-contrib-ads/-/videojs-contrib-ads-7.3.2.tgz",
"integrity": "sha512-O5zSqP9GePr8XDUgCKQoRdDr5dUX5GEbNx7s2R7LC/Pxn8L10x3RNCrijzO56bli7Vr5wAlTJgAk1dR5lqQ44A==",
"requires": {
"global": "^4.3.2"
}
@ -3665,120 +3544,14 @@
"integrity": "sha512-X1LuPfLZPisPLrANIAKCknZbZu5obVM/ylfd1CN+SsCmPZQ3UMDPcvLTpPBJxcBuTpHQq2MO1QCFt7p8spnZ/w=="
},
"videojs-ima": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/videojs-ima/-/videojs-ima-2.1.0.tgz",
"integrity": "sha512-Zb+J4by0d4FbserGOiSbdNo0U4vXSDuiPVCKFMksbaj4DO3mC8IpmvZ9Vci3tUwOhb/ladmUdhif9euSwq92Sw==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/videojs-ima/-/videojs-ima-2.2.0.tgz",
"integrity": "sha512-VKg7mZsaiW89ko2Sjfz/sDcCbCTjj2OAkg8CakvCs9ZiVg20g6QYVtEWj249V/HTm0/1X01GEPk9hnIrRzgd+A==",
"requires": {
"@hapi/cryptiles": "^5.1.0",
"can-autoplay": "^3.0.2",
"extend": ">=3.0.2",
"videojs-contrib-ads": "^6.9.0"
},
"dependencies": {
"@videojs/http-streaming": {
"version": "2.16.2",
"resolved": "https://registry.npmjs.org/@videojs/http-streaming/-/http-streaming-2.16.2.tgz",
"integrity": "sha512-etPTUdCFu7gUWc+1XcbiPr+lrhOcBu3rV5OL1M+3PDW89zskScAkkcdqYzP4pFodBPye/ydamQoTDScOnElw5A==",
"requires": {
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "3.0.5",
"aes-decrypter": "3.1.3",
"global": "^4.4.0",
"m3u8-parser": "4.8.0",
"mpd-parser": "^0.22.1",
"mux.js": "6.0.1",
"video.js": "^6 || ^7"
},
"dependencies": {
"video.js": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/video.js/-/video.js-7.21.4.tgz",
"integrity": "sha512-R5e57M/5uqxQMQpFpybNbd8GtiRwFJPqkHjrhv0QTJ2tqnesbjETbck5kU5dhFr1FevsJRFhjBG4hAnvRGnXbw==",
"requires": {
"@babel/runtime": "^7.12.5",
"@videojs/http-streaming": "2.16.2",
"@videojs/vhs-utils": "^3.0.4",
"@videojs/xhr": "2.6.0",
"aes-decrypter": "3.1.3",
"global": "^4.4.0",
"keycode": "^2.2.0",
"m3u8-parser": "4.8.0",
"mpd-parser": "0.22.1",
"mux.js": "6.0.1",
"safe-json-parse": "4.0.0",
"videojs-font": "3.2.0",
"videojs-vtt.js": "^0.15.4"
}
}
}
},
"aes-decrypter": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/aes-decrypter/-/aes-decrypter-3.1.3.tgz",
"integrity": "sha512-VkG9g4BbhMBy+N5/XodDeV6F02chEk9IpgRTq/0bS80y4dzy79VH2Gtms02VXomf3HmyRe3yyJYkJ990ns+d6A==",
"requires": {
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "^3.0.5",
"global": "^4.4.0",
"pkcs7": "^1.0.4"
}
},
"mpd-parser": {
"version": "0.22.1",
"resolved": "https://registry.npmjs.org/mpd-parser/-/mpd-parser-0.22.1.tgz",
"integrity": "sha512-fwBebvpyPUU8bOzvhX0VQZgSohncbgYwUyJJoTSNpmy7ccD2ryiCvM7oRkn/xQH5cv73/xU7rJSNCLjdGFor0Q==",
"requires": {
"@babel/runtime": "^7.12.5",
"@videojs/vhs-utils": "^3.0.5",
"@xmldom/xmldom": "^0.8.3",
"global": "^4.4.0"
}
},
"mux.js": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/mux.js/-/mux.js-6.0.1.tgz",
"integrity": "sha512-22CHb59rH8pWGcPGW5Og7JngJ9s+z4XuSlYvnxhLuc58cA1WqGDQPzuG8I+sPm1/p0CdgpzVTaKW408k5DNn8w==",
"requires": {
"@babel/runtime": "^7.11.2",
"global": "^4.4.0"
}
},
"videojs-contrib-ads": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/videojs-contrib-ads/-/videojs-contrib-ads-6.9.0.tgz",
"integrity": "sha512-nzKz+jhCGMTYffSNVYrmp9p70s05v6jUMOY3Z7DpVk3iFrWK4Zi/BIkokDWrMoHpKjdmCdKzfJVBT+CrUj6Spw==",
"requires": {
"global": "^4.3.2",
"video.js": "^6 || ^7"
},
"dependencies": {
"video.js": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/video.js/-/video.js-7.21.4.tgz",
"integrity": "sha512-R5e57M/5uqxQMQpFpybNbd8GtiRwFJPqkHjrhv0QTJ2tqnesbjETbck5kU5dhFr1FevsJRFhjBG4hAnvRGnXbw==",
"requires": {
"@babel/runtime": "^7.12.5",
"@videojs/http-streaming": "2.16.2",
"@videojs/vhs-utils": "^3.0.4",
"@videojs/xhr": "2.6.0",
"aes-decrypter": "3.1.3",
"global": "^4.4.0",
"keycode": "^2.2.0",
"m3u8-parser": "4.8.0",
"mpd-parser": "0.22.1",
"mux.js": "6.0.1",
"safe-json-parse": "4.0.0",
"videojs-font": "3.2.0",
"videojs-vtt.js": "^0.15.4"
}
}
}
},
"videojs-font": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/videojs-font/-/videojs-font-3.2.0.tgz",
"integrity": "sha512-g8vHMKK2/JGorSfqAZQUmYYNnXmfec4MLhwtEFS+mMs2IDY398GLysy6BH6K+aS1KMNu/xWZ8Sue/X/mdQPliA=="
}
"videojs-contrib-ads": "^6.9.0 || ^7"
}
},
"videojs-landscape-fullscreen": {

View file

@ -11,7 +11,7 @@
"flickity": "^3.0.0",
"flickity-bg-lazyload": "^2.0.0",
"fontawesome-free": "^1.0.4",
"hls.js": "^1.4.9",
"hls.js": "^1.4.10",
"infinite-scroll": "^4.0.1",
"inputmask": "^5.0.8",
"jquery": "^3.7.0",
@ -27,13 +27,13 @@
"p2p-media-loader-hlsjs": "^0.6.2",
"pouchdb": "^8.0.0",
"sweetalert": "^2.1.2",
"tinymce": "^6.4.2",
"tinymce": "^6.6.0",
"tinymce-langs": "^1.0.0",
"video.js": "^8.3.0",
"videojs-contrib-ads": "^7.2.0",
"videojs-contrib-ads": "^7.3.2",
"videojs-contrib-quality-levels": "^4.0.0",
"videojs-font": "^4.1.0",
"videojs-ima": "^2.1.0",
"videojs-ima": "^2.2.0",
"videojs-landscape-fullscreen": "^11.1111.0",
"videojs-overlay": "^3.1.0",
"videojs-playlist": "^5.1.0",

View file

@ -245,12 +245,12 @@ class ADs extends PluginAbstract
{
global $global;
if (isBot()) {
return false;
return array();
}
$paths = self::getAdsPath($type, $is_regular_user);
if (empty($paths)) {
return false;
return array();
}
$files = _glob($paths['path'], '/.png$/');
@ -280,10 +280,8 @@ class ADs extends PluginAbstract
{
global $global;
$emptyAd = ['adCode' => '', 'label' => '', 'paths' => array()];
if (isBot()) {
return $emptyAd;
return ['adCode' => '', 'label' => '', 'paths' => array()];
}
if (empty($videos_id)) {
@ -298,9 +296,15 @@ class ADs extends PluginAbstract
$users_id = 0;
}
return self::getAdsFromUsersId($type, $users_id);
}
public static function getAdsFromUsersId($type, $users_id)
{
$ad = AVideoPlugin::getObjectDataIfEnabled('ADs');
if(empty($ad->$type)){
return $emptyAd;
return ['adCode' => '', 'label' => '', 'paths' => array()];
}
$label = '';
eval("\$label = \$ad->{$type}Label;");
@ -325,7 +329,6 @@ class ADs extends PluginAbstract
return ['adCode' => $adCode, 'label' => $label, 'paths' => $array['paths']];
}
public static function getAdsCode($type)
{
global $global;
@ -349,6 +352,34 @@ class ADs extends PluginAbstract
return $adCode;
}
public static function getAdsCodeReason($type)
{
$reasons = array();
if (isBot()) {
$reasons[] = 'Is a bot';
}
$videos_id = 0;
if (empty($videos_id)) {
$videos_id = getVideos_id();
}
$reasons[] = 'videos_id='.$videos_id;
$ad = AVideoPlugin::getObjectDataIfEnabled('ADs');
if (!empty($ad)) {
if (isMobile()) {
$type = $type . 'Mobile';
}
$adC = self::getAdsFromVideosId($type, $videos_id);
$reasons[] = 'type='.$type;
$reasons[] = 'label='.$adC['label'];
if(empty($adC['adCode'])){
$reasons[] = 'adCode is empty';
}
}else{
$reasons[] = 'ADs plugin disabled';
}
return $reasons;
}
public static function getSize($type)
{
$obj = AVideoPlugin::getObjectData("ADs");

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,6 @@
<?php
saveRequestVars();
?>
<div class="row mainArea">
<?php
if (!empty($currentCat)) {
@ -162,4 +165,7 @@
include $global['systemRootPath'] . 'view/include/notfound.php';
}
?>
</div>
</div>
<?php
restoreRequestVars();
?>

View file

@ -1,72 +1,45 @@
<?php
if(empty($obj) || !isset($obj->categoriesTopButtonsFluid)){
if (empty($obj) || !isset($obj->categoriesTopButtonsFluid)) {
$obj = AVideoPlugin::loadPlugin('Layout');
}
?>
<style>
.categoriesTobButtons{
border: none;
global $advancedCustom;
$_rowCount = getRowCount();
$current = getCurrentPage();
$_REQUEST['rowCount'] = 1000;
$_REQUEST['current'] = 1;
$parsed_cats = array();
$categories = Category::getAllCategories();
$_REQUEST['rowCount'] = $_rowCount;
$_REQUEST['current'] = $current;
$items = array();
foreach ($categories as $value) {
if ($value['parentId']) {
continue;
}
.categoriesTobButtons li a{
border-radius:23px;
if ($advancedCustom->ShowAllVideosOnCategory) {
$total = $value['fullTotal'];
} else {
$total = $value['total'];
}
</style>
<div class="container-fluid">
<div class="row">
<div class="<?php echo empty($obj->categoriesTopButtonsFluid) ? '' : 'col-lg-10 col-lg-offset-1'; ?>">
<center>
<ul class="nav nav-tabs nav-tabs-horizontal categoriesTobButtons" >
<?php
global $advancedCustom;
$_rowCount = getRowCount();
$current = getCurrentPage();
$_REQUEST['rowCount'] = 1000;
$_REQUEST['current'] = 1;
$parsed_cats = array();
$categories = Category::getAllCategories();
foreach ($categories as $value) {
if ($value['parentId']) {
continue;
}
if ($advancedCustom->ShowAllVideosOnCategory) {
$total = $value['fullTotal'];
} else {
$total = $value['total'];
}
if (empty($total)) {
continue;
}
if (in_array($value['id'], $parsed_cats)) {
continue;
}
?>
<li data-toggle="tooltip" title="<?php echo __($value['name']); ?>" data-placement="bottom"
class="<?php echo ($value['clean_name'] == @$_REQUEST['catName'] ? "active" : ""); ?>">
<a href="<?php echo Category::getCategoryLinkFromName($value['clean_name']); ?>" >
<?php
echo '<i class="' . (empty($value['iconClass']) ? "fa fa-folder" : $value['iconClass']) . '"></i> '
. '<span class="">' . __($value['name']) . '</span>';
if (!empty($obj->categoriesTopButtonsShowVideosCount)) {
echo ' <span class="badge">' . $total . '</span>';
}
?>
</a>
</li>
<?php
}
$_REQUEST['rowCount'] = $_rowCount;
$_REQUEST['current'] = $current;
/*
for ($i = 0; $i < 100; $i++) {
?> <li data-toggle="tooltip" title="<?php echo __($i); ?>" data-placement="bottom"> <a href="#"> <?php echo '<i class="fa fa-folder"></i> <span class="hidden-xs">' . $i . '</span>';
if (!empty($obj->categoriesTopButtonsShowVideosCount)) {
echo ' <span class="badge">' . $i . '</span>';
} ?> </a> </li> <?php }
*/
?>
</ul>
</center>
</div>
</div>
</div>
if (empty($total)) {
continue;
}
if (in_array($value['id'], $parsed_cats)) {
continue;
}
$label = '<i class="' . (empty($value['iconClass']) ? "fa fa-folder" : $value['iconClass']) . '"></i> '
. '<span class="">' . __($value['name']) . '</span>';
if (!empty($obj->categoriesTopButtonsShowVideosCount)) {
$label .= ' <span class="badge">' . $total . '</span>';
}
$items[] = array(
'href' => Category::getCategoryLinkFromName($value['clean_name']),
'tooltip' => __($value['name']),
'onclick' => '',
'label' => $label,
'isActive' => $value['clean_name'] == @$_REQUEST['catName'],
'clean_name' => $value['clean_name']
);
}
//var_dump($_REQUEST['catName'], $items);exit;
generateHorizontalFlickity($items);

View file

@ -122,4 +122,70 @@ foreach ($rows as $key => $value) {
}
}
});
</script>
</script>
<?php
$videosData = [];
foreach ($data as $value) {
$videosId = $value['videos_id'];
$reward = $value['total_reward'];
$title = $value['title'];
// If this videos_id is already in the $videosData array, update its reward, otherwise add it as a new entry.
if (isset($videosData[$videosId])) {
$videosData[$videosId]['reward'] += $reward;
} else {
$videosData[$videosId] = [
'reward' => $reward,
'title' => $title,
];
}
}
$videosIds = [];
$rewards = [];
$titles = [];
foreach ($videosData as $videosId => $videoInfo) {
$videosIds[] = $videosId;
$rewards[] = $videoInfo['reward'];
$titles[] = $videoInfo['title'];
}
?>
<div class="container">
<div class="panel">
<div class="panel-body">
<canvas id="rewardChart2" style="width:100%; height:400px;"></canvas>
</div>
</div>
</div>
<script>
let videosIds = <?php echo json_encode($videosIds); ?>;
let rewards2 = <?php echo json_encode($rewards); ?>;
let titles = <?php echo json_encode($titles); ?>;
new Chart(document.getElementById("rewardChart2"), {
type: 'bar',
data: {
labels: titles, // Use the video titles as labels
datasets: [{
data: rewards2,
label: "Money Made",
backgroundColor: "#3e95cd",
}]
},
options: {
title: {
display: true,
text: 'Money Made per Video'
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
}
}]
}
}
});
</script>

View file

@ -169,7 +169,6 @@ class PlayerSkins extends PluginAbstract {
$htmlMediaTag .= '<video '.self::getPlaysinline().' id="mainVideo" style="display: none; height: 0;width: 0;" ></video>';
//$htmlMediaTag .= '<div id="main-video" class="embed-responsive-item">';
$htmlMediaTag .= '<iframe class="embed-responsive-item" scrolling="no" '.Video::$iframeAllowAttributes.' src="' . $url . '"></iframe>';
$htmlMediaTag .= '<script>$(document).ready(function () {addView(' . intval($video['id']) . ', 0);});</script>';
//$htmlMediaTag .= '</div>';
} else {
// youtube!
@ -650,18 +649,14 @@ class PlayerSkins extends PluginAbstract {
$url = Video::getURLFriendly($videos_id);
$js .= "
player.on('play', function () {
addView({$videos_id}, this.currentTime());
_addViewBeaconAdded = false;
sendAVideoMobileMessage('play', this.currentTime());
});
player.on('ended', function () {
var time = Math.round(this.currentTime());
addView({$videos_id}, time);
sendAVideoMobileMessage('ended', time);
});
player.on('pause', function () {
var time = Math.round(this.currentTime());
addView({$videos_id}, time);
sendAVideoMobileMessage('pause', time);
});
player.on('volumechange', function () {
@ -683,13 +678,6 @@ class PlayerSkins extends PluginAbstract {
$('#linkCurrentTime, .linkCurrentTime').val(url);
if (time >= 5 && time % 1 === 0) {
addView({$videos_id}, time);
} else {
addViewFromCookie();
addViewSetCookie(PHPSESSID, {$videos_id}, time, seconds_watching_video);
}
sendAVideoMobileMessage('timeupdate', time);
});
;";

View file

@ -22,9 +22,6 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
cursor: move;
}
.playingShorts .scrtabs-tab-container {
display: none;
}
body.playingShorts {
overflow: hidden;
@ -162,6 +159,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
#buttonsCarousel {
bottom: 50px;
}
.circleCarouselBtn {
width: 35px;
height: 35px;
@ -177,7 +175,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
<div id="buttonsCarousel">
<?php
if (empty($advancedCustom->removeThumbsUpAndDown)) {
?>
?>
<button id="likeCarousel" class="circleCarouselBtn" onclick="carouselPlayerLike()">
<i class="fas fa-thumbs-up"></i>
<br>
@ -188,21 +186,21 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
<br>
<span class="votes badge"></span>
</button>
<?php
<?php
}
if (isShareEnabled()) {
?>
?>
<button id="shareCarousel" class="circleCarouselBtn" onclick="iframe[0].contentWindow.postMessage('togglePlayerSocial', '*');">
<i class="fas fa-share"></i>
</button>
<?php
<?php
}
if (User::canComment() && false) {
?>
?>
<button id="commentCarousel" class="circleCarouselBtn">
<i class="fas fa-comment"></i>
</button>
<?php
<?php
}
?>
</div>
@ -220,7 +218,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
carouselPlayerResetLikesResponse();
$.ajax({
url: url,
success: function (response) {
success: function(response) {
carouselPlayerProcessLikesResponse(response)
}
});
@ -277,10 +275,10 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
$.ajax({
url: url,
success: function (response) {
success: function(response) {
carouselPlayerProcessLikesResponse(response)
},
complete: function (response) {
complete: function(response) {
modal.hidePleaseWait();
}
});
@ -290,7 +288,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
function shortsOpen(index) {
shortIsOpen = true;
$('body').addClass('playingShorts');
<?php echo $shortsOpen; ?>
<?php echo $shortsOpen; ?>
console.log('shortsPlay', index);
$('#ShortsPlayerContent').show();
$('#ShortsPlayer').flickity('destroy');
@ -305,11 +303,11 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
if (typeof currentCell != 'undefined') {
currentCell.html('');
}
console.log('shortsClose 1');
setTimeout(function () {
console.log('shortsClose 1');
setTimeout(function() {
console.log('shortsClose 2');
$('body').removeClass('playingShorts');
<?php echo $shortsClose; ?>
<?php echo $shortsClose; ?>
$('#ShortsPlayerContent').hide();
$('#ShortsPlayerContent').removeClass('animate__bounceOutLeft');
}, 100);
@ -319,8 +317,8 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
var $carouselPlayer = $('#ShortsPlayer');
var newCarouselCell = $('<div>').addClass('carousel-cell');
var newCarouselCellContent = $('<div>')
.addClass('carousel-cell-content')
.attr('data-flickity-bg-lazyload', video.images.poster);
.addClass('carousel-cell-content')
.attr('data-flickity-bg-lazyload', video.images.poster);
newCarouselCellContent.append($('<strong>').text(video.title));
newCarouselCell.append(newCarouselCellContent);
$carouselPlayer.flickity('append', newCarouselCell);
@ -336,6 +334,10 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
var iframe;
var currentShortsPlayerIndex = -1;
function playNextShorts() {
$('#ShortsPlayer').flickity('next');
}
function createShortsPlayerFlickity(initialIndex) {
var $carouselPlayer = $('#ShortsPlayer');
@ -348,7 +350,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
adaptiveHeight: true,
cellSelector: '.carousel-cell',
});
$carouselPlayer.on('scroll.flickity', function (event, progress) {
$carouselPlayer.on('scroll.flickity', function(event, progress) {
if (typeof currentCell != 'undefined') {
currentCell.html('');
}
@ -356,7 +358,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
loadShorts();
}
});
$carouselPlayer.on('settle.flickity', function (event, index) {
$carouselPlayer.on('settle.flickity', function(event, index) {
if (isSettling) {
return;
}
@ -369,7 +371,7 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
if (typeof currentCell != 'undefined') {
currentCell.html('');
}
timeoutId = setTimeout(function () {
timeoutId = setTimeout(function() {
var index2 = $('#ShortsPlayer .carousel-cell.is-selected').index();
if (currentShortsPlayerIndex !== index2) {
carouselPlayerGetLikes();
@ -406,22 +408,22 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
resetPlayerFlickity(); // reset the timeoutId
});
$carouselPlayer.on('change.flickity', function (event, index) {
$carouselPlayer.on('change.flickity', function(event, index) {
console.log('Slide changed to ' + index)
});
$carouselPlayer.on('select.flickity', function (event, index) {
$carouselPlayer.on('select.flickity', function(event, index) {
if (shortIsOpen) {
var browserWidth = $(window).width();
<?php
foreach ($totalFlickityCells as $key => $value) {
if (empty($key)) {
echo "var newIndex = Math.floor(index/{$value});";
} else {
echo "if(browserWidth<{$key}){newIndex = Math.floor(index/{$value});}";
}
}
?>
<?php
foreach ($totalFlickityCells as $key => $value) {
if (empty($key)) {
echo "var newIndex = Math.floor(index/{$value});";
} else {
echo "if(browserWidth<{$key}){newIndex = Math.floor(index/{$value});}";
}
}
?>
$('#Shorts').flickity('select', newIndex);
console.log('Flickity select ' + index)
}
@ -430,10 +432,20 @@ foreach ($totalFlickityCells as $key => $value) {
}
$(document).ready(function () {
$(document).ready(function() {
createShortsPlayerFlickity();
$('#closeCarousel').on('click', function () {
$('#closeCarousel').on('click', function() {
shortsClose();
});
});
// Event listener to receive messages from the iframe
window.addEventListener('message', function(event) {
if (event.data === 'playNextShorts') {
// Call the function
playNextShorts();
} else {
// Execute another code if the function doesn't exist
console.log("playNextShorts() does not exist in the parent page");
}
});
</script>

View file

@ -1,65 +0,0 @@
/**
* jquery-bootstrap-scrolling-tabs
* @version v2.6.1
* @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs
* @author Mike Jacobson <michaeljjacobson1@gmail.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
.scrtabs-tab-container * {
box-sizing: border-box; }
.scrtabs-tab-container {
height: 42px; }
.scrtabs-tab-container .tab-content {
clear: left; }
.scrtabs-tab-container.scrtabs-bootstrap4 .scrtabs-tabs-movable-container > .navbar-nav {
-ms-flex-direction: row;
flex-direction: row; }
.scrtabs-tabs-fixed-container {
float: left;
height: 42px;
overflow: hidden;
width: 100%; }
.scrtabs-tabs-movable-container {
position: relative; }
.scrtabs-tabs-movable-container .tab-content {
display: none; }
.scrtabs-tab-container.scrtabs-rtl .scrtabs-tabs-movable-container > ul.nav-tabs {
padding-right: 0; }
.scrtabs-tab-scroll-arrow {
border: 1px solid #dddddd;
border-top: none;
color: #428bca;
display: none;
float: left;
font-size: 12px;
height: 42px;
margin-bottom: -1px;
padding-left: 2px;
padding-top: 13px;
width: 20px; }
.scrtabs-tab-scroll-arrow:hover {
background-color: #eeeeee; }
.scrtabs-tab-scroll-arrow,
.scrtabs-tab-scroll-arrow .scrtabs-click-target {
cursor: pointer; }
.scrtabs-tab-scroll-arrow.scrtabs-with-click-target {
cursor: default; }
.scrtabs-tab-scroll-arrow.scrtabs-disable,
.scrtabs-tab-scroll-arrow.scrtabs-disable .scrtabs-click-target {
color: #ddd;
cursor: default; }
.scrtabs-tab-scroll-arrow.scrtabs-disable:hover {
background-color: initial; }
.scrtabs-tabs-fixed-container ul.nav-tabs > li {
white-space: nowrap; }

View file

@ -1,8 +0,0 @@
/**
* jquery-bootstrap-scrolling-tabs
* @version v2.6.1
* @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs
* @author Mike Jacobson <michaeljjacobson1@gmail.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
.scrtabs-tab-container *{box-sizing:border-box}.scrtabs-tab-container{height:42px}.scrtabs-tab-container .tab-content{clear:left}.scrtabs-tab-container.scrtabs-bootstrap4 .scrtabs-tabs-movable-container>.navbar-nav{-ms-flex-direction:row;flex-direction:row}.scrtabs-tabs-fixed-container{float:left;height:42px;overflow:hidden;width:100%}.scrtabs-tabs-movable-container{position:relative}.scrtabs-tabs-movable-container .tab-content{display:none}.scrtabs-tab-container.scrtabs-rtl .scrtabs-tabs-movable-container>ul.nav-tabs{padding-right:0}.scrtabs-tab-scroll-arrow{border:1px solid #ddd;border-top:none;color:#428bca;display:none;float:left;font-size:12px;height:42px;margin-bottom:-1px;padding-left:2px;padding-top:13px;width:20px}.scrtabs-tab-scroll-arrow:hover{background-color:#eee}.scrtabs-tab-scroll-arrow,.scrtabs-tab-scroll-arrow .scrtabs-click-target{cursor:pointer}.scrtabs-tab-scroll-arrow.scrtabs-with-click-target{cursor:default}.scrtabs-tab-scroll-arrow.scrtabs-disable,.scrtabs-tab-scroll-arrow.scrtabs-disable .scrtabs-click-target{color:#ddd;cursor:default}.scrtabs-tab-scroll-arrow.scrtabs-disable:hover{background-color:initial}.scrtabs-tabs-fixed-container ul.nav-tabs>li{white-space:nowrap}

File diff suppressed because one or more lines are too long

View file

@ -17,4 +17,8 @@ span.selection > span.select2-selection--single{
border-right-color: rgb(204, 204, 204);
border-bottom-color: rgb(204, 204, 204);
border-left-color: rgb(204, 204, 204);
}
#filterDropdown label{
color: #333;
}

File diff suppressed because it is too large Load diff

View file

@ -219,7 +219,7 @@ li.navsub-toggle a + ul {
@media screen and (min-width: 992px) {
body.youtube>div.container-fluid{
body.youtube{
margin-left: 300px;
}
body.youtube div.container-fluid .col-sm-10.col-sm-offset-1.list-group-item{

View file

@ -78,7 +78,6 @@ $jsFiles[] = "view/js/webui-popover/jquery.webui-popover.min.js";
$jsFiles[] = "view/js/bootstrap-list-filter/bootstrap-list-filter.min.js";
$jsFiles[] = "node_modules/js-cookie/dist/js.cookie.js";
$jsFiles[] = "node_modules/jquery-toast-plugin/dist/jquery.toast.min.js";
$jsFiles[] = "view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.js";
$jsFiles[] = "view/js/BootstrapMenu.min.js";
$jsFiles = array_merge($jsFiles, AVideoPlugin::getJSFiles());

View file

@ -94,7 +94,6 @@ if (!isBot()) {
?>
<link href="<?php echo getURL('view/css/font-awesome-animation.min.css'); ?>" rel="stylesheet" type="text/css" onload="this.media = 'all'" />
<link href="<?php echo getURL('node_modules/jquery-toast-plugin/dist/jquery.toast.min.css'); ?>" rel="stylesheet" type="text/css" onload="this.media = 'all'" />
<link href="<?php echo getURL('view/bootstrap/jquery-bootstrap-scrolling-tabs/jquery.scrolling-tabs.min.css'); ?>" rel="stylesheet" type="text/css" onload="this.media = 'all'" />
<link href="<?php echo getURL('view/js/webui-popover/jquery.webui-popover.min.css'); ?>" rel="stylesheet" type="text/css" onload="this.media = 'all'" />
<link href="<?php echo getURL('view/js/bootgrid/jquery.bootgrid.css'); ?>" rel="stylesheet" type="text/css" onload="this.media = 'all'" />
<link href="<?php echo getURL('node_modules/jquery-ui-dist/jquery-ui.min.css'); ?>" rel="stylesheet" type="text/css" media="print" onload="this.media = 'all'" />

View file

@ -1,11 +1,31 @@
var last_videos_id = 0;
var last_currentTime = -1;
var videoViewAdded = false;
var addViewBeaconTimeout;
var _addViewCheck = false;
var isVideoPlaying = false;
// Create an encapsulation for seconds_watching_video
var VideoWatchTime = (function () {
var seconds_watching_video = 0;
return {
increment: function() {
if (isVideoPlaying) {
seconds_watching_video++;
}
},
reset: function() {
seconds_watching_video = 0;
},
getValue: function() {
return seconds_watching_video;
}
};
})();
// Modify the addView function
function addView(videos_id, currentTime) {
addViewSetCookie(PHPSESSID, videos_id, currentTime, seconds_watching_video);
addViewSetCookie(PHPSESSID, videos_id, currentTime, VideoWatchTime.getValue());
if (_addViewCheck) {
return false;
@ -15,15 +35,12 @@ function addView(videos_id, currentTime) {
return false;
}
if (currentTime > 5 && currentTime % 30 !== 0) { // only update each 30 seconds
return false;
}
// Removed the currentTime condition
_addViewCheck = true;
last_videos_id = videos_id;
last_currentTime = currentTime;
_addView(videos_id, currentTime, seconds_watching_video);
_addView(videos_id, currentTime, VideoWatchTime.getValue());
setTimeout(function() {
_addViewCheck = false;
@ -41,7 +58,6 @@ function _addView(videos_id, currentTime, seconds_watching_video) {
}
console.log('_addView 2', videos_id, currentTime, seconds_watching_video);
isVideoAddViewCount = true;
if (typeof PHPSESSID === 'undefined') {
PHPSESSID = '';
@ -52,23 +68,29 @@ function _addView(videos_id, currentTime, seconds_watching_video) {
if (empty(PHPSESSID)) {
return false;
}
isVideoAddViewCount = true;
console.log('_addView 3', videos_id, currentTime, seconds_watching_video);
url = addGetParam(url, 'PHPSESSID', PHPSESSID);
// reset seconds_watching_video
var seconds_watching_video_to_send = seconds_watching_video;
VideoWatchTime.reset();
//console.trace();
$.ajax({
url: url,
method: 'POST',
data: {
id: videos_id,
currentTime: currentTime,
seconds_watching_video: seconds_watching_video
seconds_watching_video: seconds_watching_video_to_send
},
success: function(response) {
console.log('_addView 4', response);
isVideoAddViewCount = false;
$('.view-count' + videos_id).text(response.countHTML);
PHPSESSID = response.session_id;
}, complete: function(response) {
console.log('_addView 5', response);
isVideoAddViewCount = false;
}
});
}
@ -122,6 +144,49 @@ async function addViewSetCookie(PHPSESSID, videos_id, playerCurrentTime, seconds
Cookies.set('addView_seconds_watching_video', seconds_watching_video, { path: '/', expires: 1 });
}
$(document).ready(function() {
async function startAddViewCountInPlayer(){
if(typeof player !== 'undefined' && typeof mediaId !== 'undefined'){
player.on('play', function () {
isVideoPlaying = true;
addView(mediaId, this.currentTime());
});
player.on('pause', function () {
isVideoPlaying = false;
var time = Math.round(this.currentTime());
addView(mediaId, time);
});
player.on('ended', function () {
isVideoPlaying = false;
var time = Math.round(this.currentTime());
addView(mediaId, time);
});
player.on('timeupdate', function() {
var time = Math.round(this.currentTime());
if (time === 0 || time % 30 === 0) {
addView(mediaId, time);
}
});
} else {
setTimeout(function() {
startAddViewCountInPlayer();
}, 5000);
}
}
// Add beforeunload event
window.addEventListener('beforeunload', (event) => {
addViewFromCookie();
});
$(document).ready(function() {
// Use setInterval to update seconds_watching_video every second
setInterval(function () {
VideoWatchTime.increment();
}, 1000);
// Call addViewFromCookie on the next page load
addViewFromCookie();
startAddViewCountInPlayer();
});

View file

@ -125,8 +125,6 @@ async function openLeftMenu() {
closeRightMenu();
closeSearchMenu();
}
var selector = '#buttonMenu svg';
$(selector).addClass('active');
YPTSidebarOpen();
}
@ -213,6 +211,8 @@ function YPTSidebarIsOpen() {
return $('body').hasClass('youtube');
}
async function YPTSidebarOpen() {
var selector = '#buttonMenu svg';
$(selector).addClass('active');
$("#sidebar").removeClass('animate__bounceOutLeft');
$("#sidebar").show();
$("#sidebar").addClass('animate__animated animate__bounceInLeft');

View file

@ -266,8 +266,6 @@ async function lazyImage() {
}
var pauseIfIsPlayinAdsInterval;
var seconds_watching_video = 0;
var _startCountPlayingTime;
async function setPlayerListners() {
if (typeof player !== 'undefined') {
player.on('pause', function () {
@ -275,7 +273,6 @@ async function setPlayerListners() {
//console.log("setPlayerListners: pause");
//userIsControling = true;
clearInterval(pauseIfIsPlayinAdsInterval);
clearInterval(_startCountPlayingTime);
});
player.on('play', function () {
isTryingToPlay = false;
@ -291,10 +288,6 @@ async function setPlayerListners() {
pauseIfIsPlayinAdsInterval = setInterval(function () {
pauseIfIsPlayinAds();
}, 500);
clearInterval(_startCountPlayingTime);
_startCountPlayingTime = setInterval(function () {
seconds_watching_video++;
}, 1000);
});
$("#mainVideo .vjs-mute-control").click(function () {
Cookies.set('muted', player.muted(), {
@ -849,7 +842,11 @@ function playNext(url) {
}, 1000);
} else if (isPlayNextEnabled()) {
modal.showPleaseWait();
if (typeof autoPlayAjax == 'undefined' || !autoPlayAjax) {
if (window.parent && typeof window.parent.playNextShorts === 'function') {
// Function exists, send a message to call it
console.log(" window.parent.postMessage(playNextShorts ");
window.parent.postMessage('playNextShorts', '*');
} else if (typeof autoPlayAjax == 'undefined' || !autoPlayAjax) {
//console.log("playNext changing location " + url);
document.location = url;
} else {
@ -2832,17 +2829,6 @@ $(document).ready(function () {
expires: 365
});
tabsCategoryDocumentHeight = $(document).height();
if (typeof $('.nav-tabs-horizontal').scrollingTabs == 'function') {
$('.nav-tabs-horizontal').scrollingTabs();
//$('.nav-tabs-horizontal').fadeIn();
}
setInterval(function () {
if (tabsCategoryDocumentHeightChanged()) {
if (typeof $('.nav-tabs-horizontal').scrollingTabs == 'function') {
$('.nav-tabs-horizontal').scrollingTabs('refresh');
}
}
}, 2000);
modal = getPleaseWait();
try {
$('[data-toggle="popover"]').popover();

View file

@ -14,9 +14,11 @@ foreach ($userGroups as $value) {
$users_tabs[] = ['selector' => 'userGroupGrid' . $value['id'], 'queryString' => '?status=a&user_groups_id=' . $value['id'], 'icon' => 'fas fa-users', 'title' => $value['group_name'], 'active' => '', 'userGroupID' => $value['id']];
}
?>
<link href="<?php echo getURL('node_modules/flickity/dist/flickity.min.css'); ?>" rel="stylesheet" type="text/css" />
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<div class="btn-group pull-right" >
<div class="btn-group pull-right">
<button type="button" class="btn btn-default" id="addUserBtn">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php echo __("New User"); ?>
</button>
@ -34,30 +36,27 @@ foreach ($userGroups as $value) {
</div>
</div>
<div class="clearfix"></div>
<ul class="nav nav-tabs nav-tabs-horizontal">
<?php
foreach ($users_tabs as $value) {
?>
<li class="<?php echo $value['active']; ?>">
<a data-toggle="tab" href="#<?php echo $value['selector']; ?>Tab" onclick="startUserGrid('#<?php echo $value['selector']; ?>', '<?php echo $value['queryString']; ?>', <?php echo intval($value['userGroupID']); ?>);">
<i class="<?php echo $value['icon']; ?>"></i> <?php echo __($value['title']); ?>
</a>
</li>
<?php
}
?>
</ul>
<?php
$_REQUEST['rowCount'] = $_rowCount;
$_REQUEST['current'] = $current;
$items = array();
foreach ($users_tabs as $value) {
$label = "<i class=\"{$value['icon']}\"></i> " . __($value['title']);
$items[] = array('href' => "#{$value['selector']}Tab", 'tooltip' => __($value['title']), 'onclick' => "startUserGrid('#{$value['selector']}', '{$value['queryString']}', " . intval($value['userGroupID']) . ");", 'label' => $label);
}
generateHorizontalFlickity($items);
?>
</div>
<div class="panel-body">
<div class="tab-content">
<?php
foreach ($users_tabs as $value) {
?>
?>
<div id="<?php echo $value['selector']; ?>Tab" class="tab-pane fade in <?php echo $value['active']; ?>">
<?php
if (!empty($value['userGroupID'])) {
?>
?>
<div class="btn-group pull-left" id="filterButtonsUG<?php echo $value['userGroupID']; ?>">
<div class="btn-group ">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
@ -69,7 +68,7 @@ foreach ($userGroups as $value) {
</ul>
</div>
</div>
<?php
<?php
}
?>
<table id="<?php echo $value['selector']; ?>" class="table table-condensed table-hover table-striped">
@ -78,17 +77,17 @@ foreach ($userGroups as $value) {
<th data-column-id="id" data-width="80px"><?php echo __("#"); ?></th>
<th data-column-id="user" data-formatter="user"><?php echo __("User"); ?></th>
<th data-column-id="name" data-order="desc"><?php echo __("Name"); ?></th>
<th data-column-id="email" ><?php echo __("E-mail"); ?></th>
<th data-column-id="phone" ><?php echo __("Phone"); ?></th>
<th data-column-id="created" ><?php echo __("Created"); ?></th>
<th data-column-id="modified" ><?php echo __("Modified"); ?></th>
<th data-column-id="tags" data-formatter="tags" data-sortable="false" ><?php echo __("Tags"); ?></th>
<th data-column-id="email"><?php echo __("E-mail"); ?></th>
<th data-column-id="phone"><?php echo __("Phone"); ?></th>
<th data-column-id="created"><?php echo __("Created"); ?></th>
<th data-column-id="modified"><?php echo __("Modified"); ?></th>
<th data-column-id="tags" data-formatter="tags" data-sortable="false"><?php echo __("Tags"); ?></th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false" data-width="200px"></th>
</tr>
</thead>
</table>
</div>
<?php
<?php
}
?>
</div>
@ -104,28 +103,28 @@ foreach ($userGroups as $value) {
<h4 class="modal-title"><?php echo __("User Form"); ?></h4>
</div>
<div class="modal-body">
<form class="form-compact" id="updateUserForm" onsubmit="">
<input type="hidden" id="inputUserId" >
<form class="form-compact" id="updateUserForm" onsubmit="">
<input type="hidden" id="inputUserId">
<label for="inputUser" class="sr-only"><?php echo __("User"); ?></label>
<input type="text" id="inputUser" class="form-control first" placeholder="<?php echo __("User"); ?>" autofocus required="required" data-toggle="tooltip" title="<?php echo __('User'); ?>">
<input type="text" id="inputUser" class="form-control first" placeholder="<?php echo __("User"); ?>" autofocus required="required" data-toggle="tooltip" title="<?php echo __('User'); ?>">
<?php
getInputPassword("inputPassword", 'class="form-control" required="required" autocomplete="off"', __("Password"));
?>
<label for="inputEmail" class="sr-only"><?php echo __("E-mail"); ?></label>
<input type="email" id="inputEmail" class="form-control" placeholder="<?php echo __("E-mail"); ?>" data-toggle="tooltip" title="<?php echo __('E-mail'); ?>">
<input type="email" id="inputEmail" class="form-control" placeholder="<?php echo __("E-mail"); ?>" data-toggle="tooltip" title="<?php echo __('E-mail'); ?>">
<label for="inputName" class="sr-only"><?php echo __("Name"); ?></label>
<input type="text" id="inputName" class="form-control " placeholder="<?php echo __("Name"); ?>" data-toggle="tooltip" title="<?php echo __('Name'); ?>">
<input type="text" id="inputName" class="form-control " placeholder="<?php echo __("Name"); ?>" data-toggle="tooltip" title="<?php echo __('Name'); ?>">
<label for="inputChannelName" class="sr-only"><?php echo __("Channel Name"); ?></label>
<input type="text" id="inputChannelName" class="form-control" placeholder="<?php echo __("Channel Name"); ?>" data-toggle="tooltip" title="<?php echo __('Channel Name'); ?>">
<input type="text" id="inputChannelName" class="form-control" placeholder="<?php echo __("Channel Name"); ?>" data-toggle="tooltip" title="<?php echo __('Channel Name'); ?>">
<label for="inputPhone" class="sr-only"><?php echo __("Phone"); ?></label>
<input type="text" id="inputPhone" class="form-control" placeholder="<?php echo __("Phone"); ?>" data-toggle="tooltip" title="<?php echo __('Phone'); ?>" >
<input type="text" id="inputPhone" class="form-control" placeholder="<?php echo __("Phone"); ?>" data-toggle="tooltip" title="<?php echo __('Phone'); ?>">
<label for="inputAnalyticsCode" class="sr-only"><?php echo __("Analytics Code"); ?></label>
<input type="text" id="inputAnalyticsCode" class="form-control last" placeholder="Google Analytics Code: UA-123456789-1" data-toggle="tooltip" title="<?php echo __('Analytics Code'); ?>">
<input type="text" id="inputAnalyticsCode" class="form-control last" placeholder="Google Analytics Code: UA-123456789-1" data-toggle="tooltip" title="<?php echo __('Analytics Code'); ?>">
<small>Do not paste the full javascript code, paste only the gtag id</small>
<br>
<?php
if (empty($advancedCustomUser->disableCompanySignUp) || !empty($advancedCustomUser->enableAffiliation)) {
?>
?>
<label for="is_company" class="sr-only"><?php echo __("is a Company"); ?></label>
<select name="is_company" id="is_company" class="form-control last">
<?php
@ -144,49 +143,49 @@ foreach ($userGroups as $value) {
<li class="list-group-item <?php echo User::isAdmin() ? "" : "hidden"; ?>">
<?php echo __("is Admin"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="isAdmin" id="isAdmin"/>
<input type="checkbox" value="isAdmin" id="isAdmin" />
<label for="isAdmin" class="label-success"></label>
</div>
</li>
<li class="list-group-item">
<?php echo __("Can Stream Videos"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="canStream" id="canStream"/>
<input type="checkbox" value="canStream" id="canStream" />
<label for="canStream" class="label-success"></label>
</div>
</li>
<li class="list-group-item">
<?php echo __("Can Upload Videos"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="canUpload" id="canUpload"/>
<input type="checkbox" value="canUpload" id="canUpload" />
<label for="canUpload" class="label-success"></label>
</div>
</li>
<li class="list-group-item">
<?php echo __("Can view chart"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="canViewChart" id="canViewChart"/>
<input type="checkbox" value="canViewChart" id="canViewChart" />
<label for="canViewChart" class="label-success"></label>
</div>
</li>
<li class="list-group-item">
<?php echo __("Can create meet"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="canCreateMeet" id="canCreateMeet"/>
<input type="checkbox" value="canCreateMeet" id="canCreateMeet" />
<label for="canCreateMeet" class="label-success"></label>
</div>
</li>
<li class="list-group-item">
<?php echo __("E-mail Verified"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="isEmailVerified" id="isEmailVerified"/>
<input type="checkbox" value="isEmailVerified" id="isEmailVerified" />
<label for="isEmailVerified" class="label-success"></label>
</div>
</li>
<li class="list-group-item">
<?php echo __("is Active"); ?>
<div class="material-switch pull-right">
<input type="checkbox" value="status" id="status"/>
<input type="checkbox" value="status" id="status" />
<label for="status" class="label-success"></label>
</div>
</li>
@ -197,22 +196,22 @@ foreach ($userGroups as $value) {
<ul class="list-group">
<li class="list-group-item active">
<?php echo __("User Groups"); ?>
<a href="#" class="btn btn-info btn-xs pull-right" data-toggle="popover" title="<?php echo __("What is User Groups"); ?>" data-placement="bottom" data-content="<?php echo __("By associating groups with this user, they will be able to see all the videos that are related to this group"); ?>"><span class="fa fa-question-circle" aria-hidden="true"></span> <?php echo __("Help"); ?></a>
<a href="#" class="btn btn-info btn-xs pull-right" data-toggle="popover" title="<?php echo __("What is User Groups"); ?>" data-placement="bottom" data-content="<?php echo __("By associating groups with this user, they will be able to see all the videos that are related to this group"); ?>"><span class="fa fa-question-circle" aria-hidden="true"></span> <?php echo __("Help"); ?></a>
</li>
<?php
foreach ($userGroups as $value) {
?>
?>
<li class="list-group-item usergroupsLi" id="usergroupsLi<?php echo $value['id']; ?>">
<span class="fa fa-unlock"></span>
<?php echo $value['group_name']; ?>
<span class="label label-info"><?php echo $value['total_videos']; ?> <?php echo __("Videos linked"); ?></span>
<span class="label label-warning dynamicLabel"><i class="fas fa-link"></i> <?php echo __("Dynamic group"); ?></span>
<div class="material-switch pull-right">
<input id="userGroup<?php echo $value['id']; ?>" type="checkbox" value="<?php echo $value['id']; ?>" class="userGroups"/>
<input id="userGroup<?php echo $value['id']; ?>" type="checkbox" value="<?php echo $value['id']; ?>" class="userGroups" />
<label for="userGroup<?php echo $value['id']; ?>" class="label-warning"></label>
</div>
</li>
<?php
<?php
}
?>
</ul>
@ -240,7 +239,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="first_name" class="form-control" type="text" readonly >
<input id="first_name" class="form-control" type="text" readonly>
</div>
</div>
</div>
@ -250,7 +249,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="last_name" class="form-control" readonly >
<input id="last_name" class="form-control" readonly>
</div>
</div>
</div>
@ -260,7 +259,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="address" class="form-control" readonly >
<input id="address" class="form-control" readonly>
</div>
</div>
</div>
@ -270,7 +269,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="zip_code" class="form-control" readonly>
<input id="zip_code" class="form-control" readonly>
</div>
</div>
</div>
@ -280,7 +279,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="country" class="form-control" readonly>
<input id="country" class="form-control" readonly>
</div>
</div>
</div>
@ -289,7 +288,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="region" class="form-control" readonly>
<input id="region" class="form-control" readonly>
</div>
</div>
</div>
@ -298,7 +297,7 @@ foreach ($userGroups as $value) {
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input id="city" class="form-control" readonly>
<input id="city" class="form-control" readonly>
</div>
</div>
</div>
@ -307,7 +306,7 @@ foreach ($userGroups as $value) {
<label class="col-md-4 control-label"><?php echo __("Document"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<img src="" class="img img-responsive img-thumbnail" id="documentImage"/>
<img src="" class="img img-responsive img-thumbnail" id="documentImage" />
</div>
</div>
</div>
@ -317,6 +316,8 @@ foreach ($userGroups as $value) {
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script src="<?php echo getURL('node_modules/flickity/dist/flickity.pkgd.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo getURL('node_modules/flickity-bg-lazyload/bg-lazyload.js'); ?>" type="text/javascript"></script>
<script>
function isAnalytics() {
@ -325,10 +326,10 @@ foreach ($userGroups as $value) {
//return str === '' || (/^ua-\d{4,9}-\d{1,4}$/i).test(str.toString());
}
$(document).ready(function () {
$(document).ready(function() {
startUserGrid("#<?php echo $users_tabs[0]['selector']; ?>", "<?php echo $users_tabs[0]['queryString']; ?>", <?php echo intval($users_tabs[0]['userGroupID']); ?>);
$('#addUserBtn').click(function (evt) {
$('#addUserBtn').click(function(evt) {
$('#inputUserId').val('');
$('#inputUser').val('');
$('#inputPassword').val('');
@ -346,71 +347,70 @@ foreach ($userGroups as $value) {
$('.userGroups').prop('checked', false);
$('#status').prop('checked', true);
$('#isEmailVerified').prop('checked', false);
<?php
print AVideoPlugin::addUserBtnJS();
?>
<?php
print AVideoPlugin::addUserBtnJS();
?>
$('#userFormModal').modal();
});
$('#saveUserBtn').click(function (evt) {
$('#saveUserBtn').click(function(evt) {
$('#updateUserForm').submit();
});
$('#updateUserForm').submit(function (evt) {
evt.preventDefault();
if (!isAnalytics()){
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your analytics code is wrong"); ?>", "error");
$('#updateUserForm').submit(function(evt) {
evt.preventDefault();
if (!isAnalytics()) {
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your analytics code is wrong"); ?>", "error");
$('#inputAnalyticsCode').focus();
return false;
}
}
modal.showPleaseWait();
var selectedUserGroups = [];
$('.userGroups:checked').each(function () {
selectedUserGroups.push($(this).val());
});
$.ajax({
modal.showPleaseWait();
var selectedUserGroups = [];
$('.userGroups:checked').each(function() {
selectedUserGroups.push($(this).val());
});
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/userAddNew.json.php',
data: {
<?php
print AVideoPlugin::updateUserFormJS();
?>
"id": $('#inputUserId').val(),
"user": $('#inputUser').val(),
"pass": $('#inputPassword').val(),
"email": $('#inputEmail').val(),
"name": $('#inputName').val(),
"phone": $('#inputPhone').val(),
"channelName": $('#inputChannelName').val(),
"analyticsCode": $('#inputAnalyticsCode').val(),
"isAdmin": $('#isAdmin').is(':checked'),
"canStream": $('#canStream').is(':checked'),
"is_company": $('#is_company').val(),
"canUpload": $('#canUpload').is(':checked'),
"canViewChart": $('#canViewChart').is(':checked'),
"canCreateMeet": $('#canCreateMeet').is(':checked'),
"status": $('#status').is(':checked') ? 'a' : 'i',
"isEmailVerified": $('#isEmailVerified').is(':checked'),
"userGroups": selectedUserGroups,
"do_not_login": 1,
"securityToken": '<?php echo getToken(3600); ?>'
},
type: 'post',
success: function (response) {
if(!response.error){
$('#userFormModal').modal('hide');
$('.bootgrid-table').bootgrid("reload");
}
avideoResponse(response);
console.log('user save', response);
modal.hidePleaseWait();
}
});
return false;
}
);
data: {
<?php
print AVideoPlugin::updateUserFormJS();
?> "id": $('#inputUserId').val(),
"user": $('#inputUser').val(),
"pass": $('#inputPassword').val(),
"email": $('#inputEmail').val(),
"name": $('#inputName').val(),
"phone": $('#inputPhone').val(),
"channelName": $('#inputChannelName').val(),
"analyticsCode": $('#inputAnalyticsCode').val(),
"isAdmin": $('#isAdmin').is(':checked'),
"canStream": $('#canStream').is(':checked'),
"is_company": $('#is_company').val(),
"canUpload": $('#canUpload').is(':checked'),
"canViewChart": $('#canViewChart').is(':checked'),
"canCreateMeet": $('#canCreateMeet').is(':checked'),
"status": $('#status').is(':checked') ? 'a' : 'i',
"isEmailVerified": $('#isEmailVerified').is(':checked'),
"userGroups": selectedUserGroups,
"do_not_login": 1,
"securityToken": '<?php echo getToken(3600); ?>'
},
type: 'post',
success: function(response) {
if (!response.error) {
$('#userFormModal').modal('hide');
$('.bootgrid-table').bootgrid("reload");
}
avideoResponse(response);
console.log('user save', response);
modal.hidePleaseWait();
}
});
return false;
});
});
var userGroupShowOnly = '';
var userGroupQueryString = '';
function userGroupFilter(user_groups_id, value) {
console.log('Filter usergroup', user_groups_id, value);
userGroupShowOnly = value;
@ -427,6 +427,7 @@ print AVideoPlugin::updateUserFormJS();
url = addGetParam(url, 'userGroupShowOnly', userGroupShowOnly);
return url;
}
function startUserGrid(selector, queryString, user_groups_id) {
userGroupQueryString = queryString;
if (user_groups_id) {
@ -448,14 +449,14 @@ print AVideoPlugin::updateUserFormJS();
ajax: true,
url: getUserGridURL,
formatters: {
"commands": function (column, row) {
"commands": function(column, row) {
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo __('Edit'); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
var infoBtn = '<button type="button" class="btn btn-xs btn-default command-info" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo __('Info'); ?>"><i class="fas fa-info-circle"></i></button>'
//var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + ' data-toggle="tooltip" data-placement="left" title="Delete""><span class="glyphicon glyphicon-erase" aria-hidden="true"></span></button>';
var pluginsButtons = '<br><?php echo AVideoPlugin::getUsersManagerListButton(); ?>';
return editBtn + infoBtn + pluginsButtons;
},
"tags": function (column, row) {
"tags": function(column, row) {
var tags = '';
for (var i in row.tags) {
if (typeof row.tags[i].type == "undefined") {
@ -465,7 +466,7 @@ print AVideoPlugin::updateUserFormJS();
}
return tags;
},
"user": function (column, row) {
"user": function(column, row) {
var photo = '';
if (row.photoURL) {
photo = "<br><img src='" + row.photo + "' class='img img-responsive img-rounded img-thumbnail' style='max-width:100px;'/>";
@ -473,10 +474,9 @@ print AVideoPlugin::updateUserFormJS();
return row.user + photo;
}
}
}).on("loaded.rs.jquery.bootgrid", function ()
{
}).on("loaded.rs.jquery.bootgrid", function() {
/* Executes after data is loaded and rendered */
grid.find(".command-edit").on("click", function (e) {
grid.find(".command-edit").on("click", function(e) {
var row_index = $(this).closest('tr').index();
var row = $(selector).bootgrid("getCurrentRows")[row_index];
console.log(row);
@ -507,12 +507,12 @@ print AVideoPlugin::updateUserFormJS();
$('#canCreateMeet').prop('checked', (row.canCreateMeet == "1" ? true : false));
$('#status').prop('checked', (row.status === "a" ? true : false));
$('#isEmailVerified').prop('checked', (row.isEmailVerified == "1" ? true : false));
<?php
print AVideoPlugin::loadUsersFormJS();
?>
<?php
print AVideoPlugin::loadUsersFormJS();
?>
$('#userFormModal').modal();
}).end().find(".command-info").on("click", function (e) {
}).end().find(".command-info").on("click", function(e) {
var row_index = $(this).closest('tr').index();
var row = $(selector).bootgrid("getCurrentRows")[row_index];
@ -531,5 +531,4 @@ print AVideoPlugin::loadUsersFormJS();
});
});
}
</script>
</script>

View file

@ -13,7 +13,11 @@
<?php
echo $getAdsLeaderBoardTop;
}else{
echo "<!-- getAdsLeaderBoardTop is empty -->";
echo "<!-- ";
echo "getAdsLeaderBoardTop is empty ";
echo implode(', ', ADs::getAdsCodeReason('leaderBoardTop'));
echo " -->";
}
?>
</center>