mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
update
This commit is contained in:
parent
ed3a07f4e8
commit
474ce8d6c6
3 changed files with 39 additions and 0 deletions
|
@ -142,6 +142,17 @@ class sqlDAL
|
|||
} catch (Exception $exc) {
|
||||
if (preg_match('/playlists_has_videos/', $preparedStatement)) {
|
||||
log_error('Error in writeSql values: ' . json_encode($values));
|
||||
}else if (preg_match('/Illegal mix of collations.*and \(utf8mb4/i', $global['mysqli']->error)) {
|
||||
try {
|
||||
// Set the MySQL connection character set to UTF-8
|
||||
$global['mysqli']->query("SET NAMES 'utf8mb4'");
|
||||
$global['mysqli']->query("SET CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
|
||||
$stmt = $global['mysqli']->prepare($preparedStatement);
|
||||
sqlDAL::eval_mysql_bind($stmt, $formats, $values);
|
||||
$stmt->execute();
|
||||
} catch (Exception $exc) {
|
||||
log_error($exc->getTraceAsString());
|
||||
}
|
||||
}else if(preg_match('/Conversion from collation/i', $global['mysqli']->error)){
|
||||
$values2 = $values;
|
||||
foreach ($values2 as $key => $value) {
|
||||
|
|
|
@ -2140,6 +2140,33 @@ class API extends PluginAbstract
|
|||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $parameters
|
||||
* 'user' username of the user
|
||||
* 'pass' password of the user
|
||||
* ['encodedPass' tell the script id the password submitted is raw or encrypted]
|
||||
* @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&user=admin&pass=f321d14cdeeb7cded7489f504fa8862b&encodedPass=true
|
||||
* @return string
|
||||
*/
|
||||
public function get_api_notifications($parameters)
|
||||
{
|
||||
global $global;
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('UserNotifications');
|
||||
if ($plugin) {
|
||||
$url = "{$global['webSiteRootURL']}plugin/UserNotifications/getNotifications.json.php";
|
||||
$rows = json_decode(url_get_contents($url, "", 0, false, true));
|
||||
$url = "{$global['webSiteRootURL']}plugin/Live/stats.json.php";
|
||||
$live = json_decode(url_get_contents($url, "", 0, false, true));
|
||||
$rows->live = $live;
|
||||
return new ApiObject('', false, $rows);
|
||||
} else {
|
||||
return new ApiObject("UserNotifications Plugin disabled");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function isAPISecretValid()
|
||||
{
|
||||
global $global;
|
||||
|
|
|
@ -368,6 +368,7 @@ $(\'#inputTags' . $tagTypesId . '\').tagsinput({
|
|||
$users[] = $user;
|
||||
}
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
static function getLabels($videos_id, $showType = true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue