1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +02:00
This commit is contained in:
DanielnetoDotCom 2020-12-29 00:03:46 -03:00
parent 44e9ee4a55
commit 678c7bbe2b

View file

@ -1076,6 +1076,13 @@ class AVideoPlugin {
} }
public static function showAds($videos_id) { public static function showAds($videos_id) {
global $_showAds;
if(!isset($_showAds)){
$_showAds = array();
}
if(isset($_showAds[$videos_id])){
return $_showAds[$videos_id];
}
$plugins = Plugin::getAllEnabled(); $plugins = Plugin::getAllEnabled();
$resp = true; $resp = true;
foreach ($plugins as $value) { foreach ($plugins as $value) {
@ -1085,11 +1092,13 @@ class AVideoPlugin {
$showAds = $p->showAds($videos_id); $showAds = $p->showAds($videos_id);
if (!$showAds) { if (!$showAds) {
_error_log("showAds: {$value['dirName']} said NOT to show ads on {$videos_id}"); _error_log("showAds: {$value['dirName']} said NOT to show ads on {$videos_id}");
$_showAds[$videos_id] = false;
return false; return false;
} }
} }
self::YPTend("{$value['dirName']}::" . __FUNCTION__); self::YPTend("{$value['dirName']}::" . __FUNCTION__);
} }
$_showAds[$videos_id] = $resp;
return $resp; return $resp;
} }