sidebar.php 916 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Blog sidebar
  4. *
  5. * @package Blog
  6. */
  7. // fetch & display latest comments
  8. if ($vars['page'] == 'all') {
  9. echo elgg_view('page/elements/comments_block', array(
  10. 'subtypes' => 'blog',
  11. ));
  12. } elseif ($vars['page'] == 'owner') {
  13. echo elgg_view('page/elements/comments_block', array(
  14. 'subtypes' => 'blog',
  15. 'owner_guid' => elgg_get_page_owner_guid(),
  16. ));
  17. }
  18. // only users can have archives at present
  19. if (in_array($vars['page'], array('owner', 'group', 'view'))) {
  20. echo elgg_view('blog/sidebar/archives', $vars);
  21. }
  22. if ($vars['page'] != 'friends') {
  23. $page_owner = elgg_get_page_owner_entity();
  24. $options = array(
  25. 'subtypes' => 'blog'
  26. );
  27. if ($page_owner instanceof ElggUser) {
  28. $options['owner_guid'] = $page_owner->getGUID();
  29. } elseif ($page_owner instanceof ElggGroup) {
  30. $options['container_guid'] = $page_owner->getGUID();
  31. }
  32. echo elgg_view('page/elements/tagcloud_block', $options);
  33. }