Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F13210016
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/plugin/Live/stats.json.php b/plugin/Live/stats.json.php
index 4924a54cb..1d69cd39d 100644
--- a/plugin/Live/stats.json.php
+++ b/plugin/Live/stats.json.php
@@ -1,70 +1,71 @@
<?php
+ini_set('max_execution_time', 5);
header('Content-Type: application/json');
$obj = new stdClass();
$obj->error = true;
$obj->msg = "OFFLINE";
$obj->nclients = 0;
if(empty($_POST['name']) && !empty($_GET['name'])){
$_POST['name'] = $_GET['name'];
}else if(empty($_POST['name'])){
$_POST['name'] = "undefined";
}
$obj->name = $_POST['name'];
$obj->applications = array();
require_once '../../videos/configuration.php';
require_once './Objects/LiveTransmition.php';
require_once '../../objects/user.php';
$p = YouPHPTubePlugin::loadPlugin("Live");
$xml = $p->getStatsObject();
$xml = json_encode($xml);
$xml = json_decode($xml);
$stream = false;
$lifeStream = array();
//$obj->server = $xml->server;
if(!empty($xml->server->application) && !is_array($xml->server->application)){
$application = $xml->server->application;
$xml->server->application = array();
$xml->server->application[] = $application;
}
if(!empty($xml->server->application[0]->live->stream)){
$lifeStream = $xml->server->application[0]->live->stream;
if(!is_array($xml->server->application[0]->live->stream)){
$lifeStream = array();
$lifeStream[0] = $xml->server->application[0]->live->stream;
}
}
require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
// the live users plugin
$liveUsersEnabled = YouPHPTubePlugin::isEnabled("cf145581-7d5e-4bb6-8c12-48fc37c0630d");
$obj->countLifeStream = count($lifeStream);
foreach ($lifeStream as $value){
if(!empty($value->name)){
$row = LiveTransmition::keyExists($value->name);
if(empty($row) || empty($row['public'])){
continue;
}
$users = false;
if($liveUsersEnabled){
require_once $global['systemRootPath'] . 'plugin/LiveUsers/Objects/LiveOnlineUsers.php';
$liveUsers = new LiveOnlineUsers(0);
$users = $liveUsers->getUsersFromTransmitionKey($value->name);
}
$u = new User($row['users_id']);
$userName = $u->getNameIdentificationBd();
$user = $u->getUser();
$photo = $u->getPhotoURL();
$obj->applications[] = array("key"=>$value->name, "users"=>$users, "name"=>$userName, "user"=>$user, "photo"=>$photo, "title"=>$row['title']);
if($value->name === $_POST['name']){
$obj->error = (!empty($value->publishing))?false:true;
$obj->msg = (!$obj->error)?"ONLINE":"Waiting for Streamer";
$obj->stream = $value;
$obj->nclients = intval($value->nclients);
break;
}
}
}
echo json_encode($obj);
\ No newline at end of file
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Apr 22, 15:58 (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1862859
Default Alt Text
(2 KB)
Attached To
Mode
R58 TurboFlop
Attached
Detach File
Event Timeline
Log In to Comment