updateriver.php 520 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. $options = get_input('options');
  3. $count = (int) get_input('count');
  4. $options['count'] = true;
  5. $newcount = elgg_get_river($options);
  6. $options['count'] = false;
  7. $returnData['count'] = $newcount;
  8. $limit = $newcount - $count;
  9. if ($limit > 0)
  10. {
  11. $options['pagination'] = false;
  12. $options['offset'] = 0;
  13. $options['limit'] = 1;
  14. $returnData['content'] = elgg_list_river($options);
  15. $returnData['valid'] = 1;
  16. }
  17. else
  18. {
  19. $returnData['valid'] = 0;
  20. }
  21. echo json_encode($returnData);
  22. exit;