PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 3.15.1
GiveWP – Donation Plugin and Fundraising Platform v3.15.1
4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / templates / shortcode-donor-wall.php
give / templates Last commit date
emails 2 years ago global 6 years ago receipt 7 years ago single-give-form 6 years ago email-login-form.php 6 years ago history-donations.php 4 years ago payment-processing.php 6 years ago shortcode-donor-wall.php 2 years ago shortcode-form-grid.php 1 year ago shortcode-goal.php 2 years ago shortcode-login.php 6 years ago shortcode-profile-editor.php 6 years ago shortcode-receipt.php 2 years ago shortcode-register.php 8 years ago shortcode-totals-progress.php 6 years ago single-give-form.php 6 years ago
shortcode-donor-wall.php
220 lines
1 <?php
2 /**
3 * This template is used to display the donation grid with [give_donor_wall]
4 */
5
6 // Exit if accessed directly.
7 if (!defined('ABSPATH')) {
8 exit;
9 }
10
11 /** @var $args array */
12 /** @var $donation array kind of like Give_Payment */
13 /** @var $donor Give_Donor */
14 /** @var $atts array Shortcode attributes */
15 /** @var $give_settings array Give settings */
16
17 list($donation, $give_settings, $atts, $donor) = $args;
18
19 $primary_color = $atts['color'];
20 $avatarSize = (int)$atts['avatar_size'];
21 $tribute_background_color = !empty($atts['color']) ? $atts['color'] . '20' : '#219653';
22
23 ?>
24
25
26 <div class="give-grid__item">
27 <div class="give-donor give-card">
28 <div class="give-donor-container">
29 <?php
30 if ($atts['show_avatar']) {
31 if (!empty($donation['_give_anonymous_donation'])) {
32 // Donor gave anonymously
33 $imageUrl = GIVE_PLUGIN_URL . 'assets/dist/images/anonymous-user.svg';
34 $alt = __('Anonymous User', 'give');
35
36 echo "
37 <div class='give-donor-container__image' >
38 <img class='give-donor-container__image__anonymous' src='$imageUrl' alt='$alt' style='height: {$avatarSize}px;'/>
39 </div>
40 ";
41 } elseif ($donation['_give_payment_donor_email'] && give_validate_gravatar(
42 $donation['_give_payment_donor_email']
43 )) {
44 // Donor has a valid Gravatar
45 $hash = md5(strtolower(trim($donation['_give_payment_donor_email'])));
46
47
48 echo "
49 <div class='give-donor-container__image' >
50 <img src='https://gravatar.com/avatar/$hash' alt='$donor->name' style='height: $avatarSize px;'/>
51 </div>
52 ";
53 } else {
54 // Everyone else
55
56 $initial = esc_html($donation['name_initial']);
57 echo "
58 <div class='give-donor-container__image' style='height: {$avatarSize}px; width: {$avatarSize}px;'>
59 <span class='give-donor-container__image__name_initial'>$initial</span>
60 </div>
61 ";
62 }
63 }
64 ?>
65 <div class="give-donor-container-variation"
66 style="
67 flex-direction: <?php echo $atts['show_avatar'] ? 'column' : 'row'; ?>;
68 align-items: <?php echo $atts['show_avatar'] ? 'center' : 'flex-end'; ?>;
69 ">
70 <?php if ( $atts['show_name'] ) : ?>
71 <h3 class="give-donor-container-variation__name">
72 <?php
73 // Get donor name based on donation parameter.
74 $donor_name = ! empty( $donation['_give_anonymous_donation'] )
75 ? esc_html__( 'Anonymous', 'give' )
76 : trim( $donation['_give_donor_billing_first_name'] . ' ' . $donation['_give_donor_billing_last_name'] );
77 ?>
78 <?php echo esc_html( $donor_name ); ?>
79 </h3>
80 <?php endif; ?>
81
82 <?php if ( $atts['show_company_name'] && isset( $donation['_give_donation_company'] ) ) : ?>
83 <h3 class="give-donor-container-variation__name">
84 <?php echo esc_html( $donation['_give_donation_company'] ); ?>
85 </h3>
86 <?php endif; ?>
87
88 <?php if ( $atts['show_time'] ) : ?>
89 <p class="give-donor-container-variation__timestamp">
90 <?php echo esc_html( give_get_formatted_date( $donation['donation_date'], give_date_format(), 'Y-m-d H:i:s', true ) ); ?>
91 </p>
92 <?php endif; ?>
93 </div>
94 <?php
95 if (
96 $atts['show_comments']
97 && empty($donation['_give_anonymous_donation'])
98 && absint($atts['comment_length'])
99 && !empty($donation['donor_comment'])
100 ) :
101 ?>
102 <div class="give-donor-wrapper">
103 <div class="give-donor-content"
104 style="border-color: <?php echo !empty($atts['color']) ? esc_attr($atts['color']) : '#219653' ?>">
105 <?php
106 $comment = esc_html($donation['donor_comment']);
107 $stripped_comment = str_replace(' ', '', $comment);
108
109 $total_chars = strlen($stripped_comment);
110 $max_chars = $atts['comment_length'];
111 $read_more_text = $atts['readmore_text'];
112
113 // A truncated excerpt is displayed if the comment is too long.
114 if ($max_chars < $total_chars) {
115 $excerpt = '';
116 $offset = -($total_chars - $max_chars);
117 $last_space = strrpos($comment, ' ', $offset);
118
119 if ($last_space) {
120 // Truncate excerpt at last space before limit.
121 $excerpt = substr($comment, 0, $last_space);
122 } else {
123 // There are no spaces, so truncate excerpt at limit.
124 $excerpt = substr($comment, 0, $max_chars);
125 }
126
127 $excerpt = trim($excerpt, '.!,:;');
128
129 echo "<p class='give-donor-content__excerpt'>$excerpt &hellip;
130 <span> <a class='give-donor-content__read-more' style='color: " . esc_attr($primary_color) . "'> $read_more_text </a></span>
131 </p>";
132
133 echo "<p class='give-donor-content__comment'> $comment </p>";
134
135 }
136 else {
137 echo "<p class='give-donor-content__comment'>
138 $comment
139 </p>";
140 }
141 ?>
142 </div>
143 </div>
144 <?php endif; ?>
145 <div class="give-donor-details">
146 <div class="give-donor-details__wrapper">
147 <?php
148 $full_form_name = esc_html($donation['_give_payment_form_title']);
149 $word_count = 3;
150 preg_match("/(\S+\s*){0,$word_count}/", esc_html($donation['_give_payment_form_title']), $regs);
151 $truncated_form_name = trim($regs[0] . "...");
152
153 // Determine whether to truncate form name based on amount of words
154 if ($atts['show_form'] && $atts['show_total'] && isset($donation['_give_payment_form_title'])) {
155 if (str_word_count($donation['_give_payment_form_title'], 0) <= $word_count) {
156 echo "<span class='give-donor-details__form_title'> $full_form_name </span>";
157 } else {
158 echo "<span class='give-donor-details__form_title'> $truncated_form_name </span>";
159 }
160 } // Display full form name if ['show_total'] is false
161 else {
162 if ($atts['show_form'] && !$atts['show_total'] && isset($donation['_give_payment_form_title'])) {
163 echo "<span class='give-donor-details__form_title' style='text-align: center'> $full_form_name </span>";
164 }
165 }
166
167 if ($atts['show_total']) {
168 echo sprintf(
169 '<span class=\'give - donor - details__amount_donated\'>%1$s</span>',
170 esc_html__('Amount Donated', 'give')
171 );
172 }
173 ?>
174 </div>
175
176 <?php
177 $donation_amount = give_donation_amount(esc_html($donation['donation_id']), true);
178
179 if ($atts['show_total']) {
180 echo "
181 <span class= 'give-donor-details__total' style='color: " . esc_attr($primary_color) . "'> $donation_amount </span>
182 ";
183 }
184 ?>
185 </div>
186 </div>
187 <?php
188 if ($atts['show_tributes'] && (isset($donation['_give_tributes_first_name']) || isset($donation['_give_tributes_last_name']))) {
189 $tribute_message = esc_html($donation['_give_tributes_type']);
190 $honoree_first_name = esc_html($donation['_give_tributes_first_name']);
191 $honoree_last_name = esc_html($donation['_give_tributes_last_name']);
192
193 $honoree_full_name =
194 //Determine if a last name is available
195 $donation['_give_tributes_last_name'] ?
196 //Remove full last name, and add as an initial.
197 trim($honoree_first_name . " " . strtoupper($honoree_last_name [0]) . ".") :
198 // Else add period at the end of first name
199 trim($honoree_first_name) . ".";
200
201 echo
202 "<div class='give-donor-tribute' style='background-color: " . esc_attr($tribute_background_color) . " '>
203 <span>
204 <svg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' class='give-donor-tribute__svg'>
205 <path fill=' " . esc_attr($primary_color) . "' opacity='0.4' d='M11.9667 5.13998L11.8734 5.08665L10.9467 4.55332L9.0334 3.44665C8.44673 3.10665 7.5534 3.10665 6.96673 3.44665L5.0534 4.55332L4.12673 5.09332L4.00673 5.15998C2.8134 5.95998 2.7334 6.10665 2.7334 7.39332V10.4667C2.7334 11.7533 2.8134 11.9 4.0334 12.72L6.96673 14.4133C7.26007 14.5867 7.62673 14.6667 8.00007 14.6667C8.36673 14.6667 8.74007 14.5867 9.0334 14.4133L11.9934 12.7C13.1867 11.9 13.2667 11.7533 13.2667 10.4667V7.39332C13.2667 6.10665 13.1867 5.95998 11.9667 5.13998Z' fill='#15AE56'/>
206 <path fill=' " . esc_attr($primary_color) . "' d='M4.12671 5.09337L5.05338 4.55337L6.88004 3.50004L6.96671 3.44671C7.55337 3.10671 8.44671 3.10671 9.03338 3.44671L9.12004 3.50004L10.9467 4.55337L11.8734 5.08671V3.66004C11.8734 2.16004 11.0467 1.33337 9.54671 1.33337H6.44671C4.94671 1.33337 4.12671 2.16004 4.12671 3.66004V5.09337Z' fill='#15AE56'/>
207 <path fill=' " . esc_attr($primary_color) . "' d='M9.89333 8.89327L9.47999 9.39994C9.41333 9.47327 9.36666 9.61994 9.37333 9.71994L9.41333 10.3733C9.43999 10.7733 9.15333 10.9799 8.77999 10.8333L8.17333 10.5933C8.07999 10.5599 7.91999 10.5599 7.82666 10.5933L7.21999 10.8333C6.84666 10.9799 6.55999 10.7733 6.58666 10.3733L6.62666 9.71994C6.63333 9.61994 6.58666 9.47327 6.51999 9.39994L6.10666 8.89327C5.84666 8.5866 5.95999 8.2466 6.34666 8.1466L6.97999 7.9866C7.07999 7.95994 7.19999 7.8666 7.25333 7.77994L7.60666 7.23327C7.82666 6.89327 8.17333 6.89327 8.39333 7.23327L8.74666 7.77994C8.79999 7.8666 8.91999 7.95994 9.01999 7.9866L9.65333 8.1466C10.04 8.2466 10.1533 8.5866 9.89333 8.89327Z' fill='#15AE56'/>
208 </svg>
209 </span>
210
211 <span class='give-donor-tribute__message'>
212 <span> $tribute_message </span>
213 <span> $honoree_full_name </span>
214 </span>
215 </div>";
216 }
217 ?>
218 </div>
219 </div>
220