emails
8 years ago
global
8 years ago
receipt
7 years ago
single-give-form
8 years ago
email-login-form.php
8 years ago
history-donations.php
8 years ago
payment-processing.php
8 years ago
shortcode-donor-wall.php
7 years ago
shortcode-form-grid.php
8 years ago
shortcode-goal.php
7 years ago
shortcode-login.php
8 years ago
shortcode-profile-editor.php
8 years ago
shortcode-receipt.php
7 years ago
shortcode-register.php
8 years ago
shortcode-totals-progress.php
8 years ago
single-give-form.php
8 years ago
shortcode-donor-wall.php
92 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This template is used to display the donation grid with [donation_grid] |
| 4 | */ |
| 5 | |
| 6 | // Exit if accessed directly. |
| 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | exit; |
| 9 | } |
| 10 | |
| 11 | /** @var $donor Give_Donor */ |
| 12 | $donor = $args[0]; |
| 13 | $donor = new Give_Donor( $donor->id ); |
| 14 | |
| 15 | $give_settings = $args[1]; // Give settings. |
| 16 | $atts = $args[2]; // Shortcode attributes. |
| 17 | ?> |
| 18 | |
| 19 | <div class="give-grid__item"> |
| 20 | <div class="give-donor"> |
| 21 | <div class="give-donor__header"> |
| 22 | <?php |
| 23 | // Maybe display the Avatar. |
| 24 | if ( true === $atts['show_avatar'] ) { |
| 25 | echo give_get_donor_avatar( $donor ); |
| 26 | } |
| 27 | ?> |
| 28 | |
| 29 | <div class="give-donor__details"> |
| 30 | <?php if ( true === $atts['show_name'] ) : ?> |
| 31 | <h3 class="give-donor__name"><?php esc_html_e( $donor->name ); ?></h3> |
| 32 | <?php endif; ?> |
| 33 | |
| 34 | <?php if ( true === $atts['show_total'] ) : ?> |
| 35 | <span class="give-donor__total"> |
| 36 | <?php |
| 37 | // If not filtered by form ID then display total donations |
| 38 | // Else filtered by form ID, only display donations made for this form. |
| 39 | $donated_amount = $donor->purchase_value; |
| 40 | |
| 41 | if ( ! empty( $atts['form_id'] ) ) { |
| 42 | $donated_amount = Give_Donor_Stats::donated( |
| 43 | array( |
| 44 | 'donor' => $donor->id, |
| 45 | 'give_forms' => $atts['form_id'] |
| 46 | ) |
| 47 | ); |
| 48 | } |
| 49 | |
| 50 | echo give_currency_filter( give_format_amount( $donated_amount, array( 'sanitize' => false ) ) ); |
| 51 | ?> |
| 52 | </span> |
| 53 | <?php endif; ?> |
| 54 | |
| 55 | <?php if ( true === $atts['show_time'] ) : ?> |
| 56 | <span class="give-donor__timestamp"> |
| 57 | <?php |
| 58 | // If not filtered by form ID then display the "Donor Since" text. |
| 59 | // If filtered by form ID then display the last donation date. |
| 60 | echo $donor->get_last_donation_date( true ); |
| 61 | ?> |
| 62 | </span> |
| 63 | <?php endif; ?> |
| 64 | </div> |
| 65 | </div> |
| 66 | |
| 67 | <?php |
| 68 | $comment = give_get_donor_latest_comment( $donor->id, $atts['form_id'] ); |
| 69 | |
| 70 | if ( true === $atts['show_comments'] && absint( $atts['comment_length'] ) && $comment instanceof WP_Comment ) : |
| 71 | ?> |
| 72 | <div class="give-donor__content"> |
| 73 | <?php |
| 74 | if ( $atts['comment_length'] < strlen( $comment->comment_content ) ) { |
| 75 | echo sprintf( |
| 76 | '<p class="give-donor__comment_excerpt">%s…<span> <a class="give-donor__read-more">%s</a></span></p>', |
| 77 | substr( $comment->comment_content, 0, $atts['comment_length'] ), |
| 78 | $atts['readmore_text'] |
| 79 | ); |
| 80 | |
| 81 | echo sprintf( |
| 82 | '<div class="give-donor__comment" style="display: none">%s</div>', |
| 83 | apply_filters( 'the_content', $comment->comment_content ) |
| 84 | ); |
| 85 | } else { |
| 86 | echo apply_filters( 'the_content', $comment->comment_content ); |
| 87 | } |
| 88 | ?> |
| 89 | </div> |
| 90 | <?php endif; ?> |
| 91 | </div> |
| 92 | </div> |