1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/objects/mention.json.php
DanieL 5ab35930a1 Show phone on users manager
Add hability ot @mention users on chat2
2022-04-05 09:12:04 -03:00

29 lines
874 B
PHP

<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
header('Content-Type: application/json');
$_POST['current'] = 1;
$_REQUEST['rowCount'] = 10;
$response = array();
if(preg_match('/^@/', $_REQUEST['term'])){
$_GET['searchPhrase'] = xss_esc(substr($_REQUEST['term'], 1));
$ignoreAdmin = true;
$users = User::getAllUsers($ignoreAdmin, ['name', 'email', 'user', 'channelName'], 'a');
foreach ($users as $key => $value) {
$response[] = array(
'id'=>$value['id'],
'value'=>$value['identification'],
'label'=>Video::getCreatorHTML($value['id'], '', true, true)
);
}
}
echo json_encode($response);