diff options
author | Christoph Brill <egore911@egore911.de> | 2012-05-07 12:49:09 +0200 |
---|---|---|
committer | Christoph Brill <egore911@egore911.de> | 2012-05-07 12:49:09 +0200 |
commit | d0cef532e79c9c05d98ffea23fcbb9a5f3b893f2 (patch) | |
tree | c5502569ec5bcf8f8a87e23935a38158271cab39 /json.php | |
parent | ab1813097a430b21ec62bea46de0bcf2456eb807 (diff) |
Rework the show mode to add user details only once
Diffstat (limited to 'json.php')
-rw-r--r-- | json.php | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -39,11 +39,11 @@ $retval = array(); $retval['maxdate'] = valid_date('today'); $retval['channel'] = $channel; $retval['date'] = $date; -$retval['data'] = array(); switch ($_GET['mode']) { case '': case 'watch': + $retval['data'] = array(); // Determine which users will be watched if (isset($_GET['users'])) { @@ -102,6 +102,8 @@ switch ($_GET['mode']) { } break; case 'show': + $retval['users'] = array(); + $retval['data'] = array(); foreach ($lines as $line_num => $line) { if (is_from_selected_channel($line, $channel)) { if (!filter_join($line)) { @@ -126,7 +128,8 @@ switch ($_GET['mode']) { if ($image != null) { $userdata['image'] = $image; } - $elem['user'] = $userdata; + $retval['users'][$user] = $userdata; + $elem['user'] = $user; array_push($retval['data'], $elem); } |