loadmore.php 536 B

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