index.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * Elgg custom index page
  4. *
  5. */
  6. elgg_push_context('front');
  7. elgg_push_context('widgets');
  8. $list_params = array(
  9. 'type' => 'object',
  10. 'limit' => 4,
  11. 'full_view' => false,
  12. 'list_type_toggle' => false,
  13. 'pagination' => false,
  14. );
  15. //grab the latest 4 blog posts
  16. $list_params['subtype'] = 'blog';
  17. $blogs = elgg_list_entities($list_params);
  18. //grab the latest bookmarks
  19. $list_params['subtype'] = 'bookmarks';
  20. $bookmarks = elgg_list_entities($list_params);
  21. //grab the latest files
  22. $list_params['subtype'] = 'file';
  23. $files = elgg_list_entities($list_params);
  24. //get the newest members who have an avatar
  25. $newest_members = elgg_list_entities_from_metadata(array(
  26. 'metadata_names' => 'icontime',
  27. 'type' => 'user',
  28. 'limit' => 10,
  29. 'full_view' => false,
  30. 'pagination' => false,
  31. 'list_type' => 'gallery',
  32. 'gallery_class' => 'elgg-gallery-users',
  33. 'size' => 'small',
  34. ));
  35. //newest groups
  36. $list_params['type'] = 'group';
  37. unset($list_params['subtype']);
  38. $groups = elgg_list_entities($list_params);
  39. //grab the login form
  40. $login = elgg_view("core/account/login_box");
  41. //grab the latest pages
  42. //$list_params['subtype'] = 'pages';
  43. //$pages = elgg_list_entities($list_params);
  44. //grab the latest market
  45. $list_params['type'] = 'object';
  46. $list_params['subtype'] = 'market';
  47. $market = elgg_list_entities($list_params);
  48. //grab the latest questions
  49. $list_params['type'] = 'object';
  50. $list_params['subtype'] = 'question';
  51. $questions = elgg_list_entities($list_params);
  52. //grab the latest liked
  53. //$list_params['type'] = 'object';
  54. //$list_params['subtype'] = 'like';
  55. //$liked = elgg_list_entities($list_params);
  56. //grab the latest photos
  57. //$list_params['subtype'] = 'photo';
  58. //$photos = elgg_list_entities($list_params);
  59. //grab the latest videolist
  60. $list_params['subtype'] = 'video';
  61. $video = elgg_list_entities($list_params);
  62. //grab the latest poll
  63. $list_params['subtype'] = 'poll';
  64. $poll = elgg_list_entities($list_params);
  65. //grab the latest tasks
  66. //$list_params['subtype'] = 'task';
  67. //$tasks = elgg_list_entities($list_params);
  68. elgg_pop_context();
  69. // lay out the content
  70. $params = array(
  71. 'blogs' => $blogs,
  72. 'bookmarks' => $bookmarks,
  73. 'files' => $files,
  74. 'groups' => $groups,
  75. 'login' => $login,
  76. 'members' => $newest_members,
  77. // 'pages' => $pages,
  78. 'market' => $market,
  79. 'questions' => $questions,
  80. // 'liked' => $liked_content,
  81. // 'photos' => $photos,
  82. 'video' => $video,
  83. 'poll' => $poll,
  84. // 'tasks' => $tasks,
  85. );
  86. $body = elgg_view_layout('custom_index_hydra', $params);
  87. // no RSS feed with a "widget" front page
  88. global $autofeed;
  89. $autofeed = FALSE;
  90. echo elgg_view_page('', $body);