PageRenderTime 38ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/code/cake/app/webroot/cp/wp-content/plugins/commentpress-core/themes/commentpress-theme/activity/entry.php

https://github.com/DigitalPaulScholtenProject/DPSP-Platform
PHP | 150 lines | 73 code | 62 blank | 15 comment | 15 complexity | 288e828ae67181851f8408e6e60795dc MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * BuddyPress - Activity Stream (Single Item)
  4. *
  5. * This template is used by activity-loop.php and AJAX functions to show
  6. * each activity.
  7. *
  8. * @package BuddyPress
  9. * @subpackage bp-default
  10. */
  11. // init group blog type
  12. $groupblogtype = '';
  13. // get current item
  14. global $activities_template;
  15. $current_activity = $activities_template->activity;
  16. //print_r( array( 'a' => $current_activity ) ); die();
  17. // for group activity...
  18. if ( $current_activity->component == 'groups' ) {
  19. // get group blogtype
  20. $groupblogtype = groups_get_groupmeta( $current_activity->item_id, 'groupblogtype' );
  21. // add space before if we have it
  22. if ( $groupblogtype ) { $groupblogtype = ' '.$groupblogtype; }
  23. }
  24. ?>
  25. <?php do_action( 'bp_before_activity_entry' ); ?>
  26. <li class="<?php bp_activity_css_class(); echo $groupblogtype; ?>" id="activity-<?php bp_activity_id(); ?>">
  27. <div class="activity-wrapper">
  28. <div class="activity-avatar">
  29. <a href="<?php bp_activity_user_link(); ?>">
  30. <?php bp_activity_avatar(); ?>
  31. </a>
  32. </div>
  33. <div class="activity-content">
  34. <div class="activity-header">
  35. <?php bp_activity_action(); ?>
  36. </div>
  37. <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
  38. <div class="activity-inreplyto">
  39. <strong><?php _e( 'In reply to: ', 'commentpress-core' ); ?></strong><?php bp_activity_parent_content(); ?> <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'commentpress-core' ); ?>"><?php _e( 'View', 'commentpress-core' ); ?></a>
  40. </div>
  41. <?php endif; ?>
  42. <?php if ( bp_activity_has_content() ) : ?>
  43. <div class="activity-inner">
  44. <?php bp_activity_content_body(); ?>
  45. </div>
  46. <?php endif; ?>
  47. <?php do_action( 'bp_activity_entry_content' ); ?>
  48. <?php if ( is_user_logged_in() ) : ?>
  49. <div class="activity-meta">
  50. <?php if ( bp_activity_can_comment() ) : ?>
  51. <a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment <span>%s</span>', 'commentpress-core' ), bp_activity_get_comment_count() ); ?></a>
  52. <?php endif; ?>
  53. <?php if ( bp_activity_can_favorite() ) : ?>
  54. <?php if ( !bp_get_activity_is_favorite() ) : ?>
  55. <a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'commentpress-core' ); ?>"><?php _e( 'Favorite', 'commentpress-core' ) ?></a>
  56. <?php else : ?>
  57. <a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'commentpress-core' ); ?>"><?php _e( 'Remove Favorite', 'commentpress-core' ) ?></a>
  58. <?php endif; ?>
  59. <?php endif; ?>
  60. <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
  61. <?php do_action( 'bp_activity_entry_meta' ); ?>
  62. </div>
  63. <?php endif; ?>
  64. </div>
  65. <?php do_action( 'bp_before_activity_entry_comments' ); ?>
  66. <?php if ( ( is_user_logged_in() AND bp_activity_can_comment() ) || bp_activity_get_comment_count() ) : ?>
  67. <div class="activity-comments">
  68. <?php bp_activity_comments(); ?>
  69. <?php if ( is_user_logged_in() ) : ?>
  70. <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
  71. <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
  72. <div class="ac-reply-content">
  73. <div class="ac-textarea">
  74. <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
  75. </div>
  76. <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'commentpress-core' ); ?>" /> &nbsp; <?php _e( 'or press esc to cancel.', 'commentpress-core' ); ?>
  77. <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
  78. </div>
  79. <?php do_action( 'bp_activity_entry_comments' ); ?>
  80. <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
  81. </form>
  82. <?php endif; ?>
  83. </div>
  84. <?php endif; ?>
  85. <?php do_action( 'bp_after_activity_entry_comments' ); ?>
  86. </div><!-- /activity-wrapper -->
  87. </li>
  88. <?php do_action( 'bp_after_activity_entry' ); ?>