PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.22.1
GiveWP – Donation Plugin and Fundraising Platform v2.22.1
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 6 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 4 years ago shortcode-form-grid.php 3 years ago shortcode-goal.php 3 years ago shortcode-login.php 6 years ago shortcode-profile-editor.php 6 years ago shortcode-receipt.php 5 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
219 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 && absint($atts['comment_length'])
98 && !empty($donation['donor_comment'])
99 ) :
100 ?>
101 <div class="give-donor-wrapper">
102 <div class="give-donor-content"
103 style="border-color: <?php echo !empty($atts['color']) ? $atts['color'] : '#219653' ?>">
104 <?php
105 $comment = esc_html($donation['donor_comment']);
106 $stripped_comment = str_replace(' ', '', $comment);
107
108 $total_chars = strlen($stripped_comment);
109 $max_chars = $atts['comment_length'];
110 $read_more_text = $atts['readmore_text'];
111
112 // A truncated excerpt is displayed if the comment is too long.
113 if ($max_chars < $total_chars) {
114 $excerpt = '';
115 $offset = -($total_chars - $max_chars);
116 $last_space = strrpos($comment, ' ', $offset);
117
118 if ($last_space) {
119 // Truncate excerpt at last space before limit.
120 $excerpt = substr($comment, 0, $last_space);
121 } else {
122 // There are no spaces, so truncate excerpt at limit.
123 $excerpt = substr($comment, 0, $max_chars);
124 }
125
126 $excerpt = trim($excerpt, '.!,:;');
127
128 echo "<p class='give-donor-content__excerpt'>$excerpt &hellip;
129 <span> <a class='give-donor-content__read-more' style='color: $primary_color'> $read_more_text </a></span>
130 </p>";
131
132 echo "<p class='give-donor-content__comment'> $comment </p>";
133
134 }
135 else {
136 echo "<p class='give-donor-content__comment'>
137 $comment
138 </p>";
139 }
140 ?>
141 </div>
142 </div>
143 <?php endif; ?>
144 <div class="give-donor-details">
145 <div class="give-donor-details__wrapper">
146 <?php
147 $full_form_name = esc_html($donation['_give_payment_form_title']);
148 $word_count = 3;
149 preg_match("/(\S+\s*){0,$word_count}/", esc_html($donation['_give_payment_form_title']), $regs);
150 $truncated_form_name = trim($regs[0] . "...");
151
152 // Determine whether to truncate form name based on amount of words
153 if ($atts['show_form'] && $atts['show_total'] && isset($donation['_give_payment_form_title'])) {
154 if (str_word_count($donation['_give_payment_form_title'], 0) <= $word_count) {
155 echo "<span class='give-donor-details__form_title'> $full_form_name </span>";
156 } else {
157 echo "<span class='give-donor-details__form_title'> $truncated_form_name </span>";
158 }
159 } // Display full form name if ['show_total'] is false
160 else {
161 if ($atts['show_form'] && !$atts['show_total'] && isset($donation['_give_payment_form_title'])) {
162 echo "<span class='give-donor-details__form_title' style='text-align: center'> $full_form_name </span>";
163 }
164 }
165
166 if ($atts['show_total']) {
167 echo sprintf(
168 '<span class=\'give - donor - details__amount_donated\'>%1$s</span>',
169 esc_html__('Amount Donated', 'give')
170 );
171 }
172 ?>
173 </div>
174
175 <?php
176 $donation_amount = give_donation_amount(esc_html($donation['donation_id']), true);
177
178 if ($atts['show_total']) {
179 echo "
180 <span class= 'give-donor-details__total' style='color: $primary_color'> $donation_amount </span>
181 ";
182 }
183 ?>
184 </div>
185 </div>
186 <?php
187 if ($atts['show_tributes'] && (isset($donation['_give_tributes_first_name']) || isset($donation['_give_tributes_Last_name']))) {
188 $tribute_message = esc_html($donation['_give_tributes_type']);
189 $honoree_first_name = esc_html($donation['_give_tributes_first_name']);
190 $honoree_last_name = esc_html($donation['_give_tributes_last_name']);
191
192 $honoree_full_name =
193 //Determine if a last name is available
194 $donation['_give_tributes_last_name'] ?
195 //Remove full last name, and add as an initial.
196 trim($honoree_first_name . " " . strtoupper($honoree_last_name [0]) . ".") :
197 // Else add period at the end of first name
198 trim($honoree_first_name) . ".";
199
200 echo
201 "<div class='give-donor-tribute' style='background-color: {$tribute_background_color} '>
202 <span>
203 <svg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' class='give-donor-tribute__svg'>
204 <path fill='$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'/>
205 <path fill='$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'/>
206 <path fill='$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'/>
207 </svg>
208 </span>
209
210 <span class='give-donor-tribute__message'>
211 <span> $tribute_message </span>
212 <span> $honoree_full_name </span>
213 </span>
214 </div>";
215 }
216 ?>
217 </div>
218 </div>
219