Changeset 3419050
- Timestamp:
- 12/13/2025 05:56:10 PM (5 weeks ago)
- Location:
- church-admin
- Files:
-
- 146 added
- 4 edited
-
tags/5.0.28 (added)
-
tags/5.0.28/.DS_Store (added)
-
tags/5.0.28/church-admin.php (added)
-
tags/5.0.28/css (added)
-
tags/5.0.28/css/images (added)
-
tags/5.0.28/css/images/ui-bg_flat_0_aaaaaa_40x100.png (added)
-
tags/5.0.28/css/images/ui-bg_flat_75_ffffff_40x100.png (added)
-
tags/5.0.28/css/images/ui-bg_glass_55_fbf9ee_1x400.png (added)
-
tags/5.0.28/css/images/ui-bg_glass_65_ffffff_1x400.png (added)
-
tags/5.0.28/css/images/ui-bg_glass_75_dadada_1x400.png (added)
-
tags/5.0.28/css/images/ui-bg_glass_75_e6e6e6_1x400.png (added)
-
tags/5.0.28/css/images/ui-bg_glass_95_fef1ec_1x400.png (added)
-
tags/5.0.28/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png (added)
-
tags/5.0.28/css/images/ui-icons_222222_256x240.png (added)
-
tags/5.0.28/css/images/ui-icons_2e83ff_256x240.png (added)
-
tags/5.0.28/css/images/ui-icons_454545_256x240.png (added)
-
tags/5.0.28/css/images/ui-icons_888888_256x240.png (added)
-
tags/5.0.28/css/images/ui-icons_cd0a0a_256x240.png (added)
-
tags/5.0.28/css/jquery-ui-1.13.2.css (added)
-
tags/5.0.28/display (added)
-
tags/5.0.28/display/address-list.php (added)
-
tags/5.0.28/display/calendar-list.php (added)
-
tags/5.0.28/display/calendar.new.php (added)
-
tags/5.0.28/display/calendar.php (added)
-
tags/5.0.28/display/custom-fields.php (added)
-
tags/5.0.28/display/directory.php (added)
-
tags/5.0.28/display/new-sermon-podcast.php (added)
-
tags/5.0.28/display/phone-list.php (added)
-
tags/5.0.28/display/sermon-podcast.php (added)
-
tags/5.0.28/display/sermon-series.php (added)
-
tags/5.0.28/elementor (added)
-
tags/5.0.28/elementor/address-list-widget.php (added)
-
tags/5.0.28/elementor/calendar-list-widget.php (added)
-
tags/5.0.28/elementor/calendar-widget.php (added)
-
tags/5.0.28/elementor/elementor.php (added)
-
tags/5.0.28/elementor/recent-activity-widget.php (added)
-
tags/5.0.28/elementor/register-widget.php (added)
-
tags/5.0.28/elementor/series-widget.php (added)
-
tags/5.0.28/elementor/sermons-widget.php (added)
-
tags/5.0.28/gutenberg (added)
-
tags/5.0.28/gutenberg/php-blocks.js (added)
-
tags/5.0.28/gutenberg/php-blocks.php (added)
-
tags/5.0.28/images (added)
-
tags/5.0.28/images/amazon-podcast.png (added)
-
tags/5.0.28/images/apple-podcasts.png (added)
-
tags/5.0.28/images/bulksms-logo.png (added)
-
tags/5.0.28/images/church-admin-logo.png (added)
-
tags/5.0.28/images/default-avatar.jpg (added)
-
tags/5.0.28/images/green.png (added)
-
tags/5.0.28/images/household.svg (added)
-
tags/5.0.28/images/man.svg (added)
-
tags/5.0.28/images/nopicture.png (added)
-
tags/5.0.28/images/red.png (added)
-
tags/5.0.28/images/sermon.jpg (added)
-
tags/5.0.28/images/sermon.png (added)
-
tags/5.0.28/images/spotify.png (added)
-
tags/5.0.28/images/textmagic-logo.jpeg (added)
-
tags/5.0.28/images/twilio-logo.png (added)
-
tags/5.0.28/images/woman.svg (added)
-
tags/5.0.28/includes (added)
-
tags/5.0.28/includes/PDF_Label.php (added)
-
tags/5.0.28/includes/admin.new.php (added)
-
tags/5.0.28/includes/audio.use.js (added)
-
tags/5.0.28/includes/automations.php (added)
-
tags/5.0.28/includes/batch_geocode.js (added)
-
tags/5.0.28/includes/calendar.js (added)
-
tags/5.0.28/includes/calendar.php (added)
-
tags/5.0.28/includes/confirmed.php (added)
-
tags/5.0.28/includes/csv.php (added)
-
tags/5.0.28/includes/custom_fields.php (added)
-
tags/5.0.28/includes/directory.php (added)
-
tags/5.0.28/includes/draganddrop.js (added)
-
tags/5.0.28/includes/email.php (added)
-
tags/5.0.28/includes/enqueue.php (added)
-
tags/5.0.28/includes/filter.php (added)
-
tags/5.0.28/includes/font (added)
-
tags/5.0.28/includes/font/courier.php (added)
-
tags/5.0.28/includes/font/courierb.php (added)
-
tags/5.0.28/includes/font/courierbi.php (added)
-
tags/5.0.28/includes/font/courieri.php (added)
-
tags/5.0.28/includes/font/helvetica.php (added)
-
tags/5.0.28/includes/font/helveticab.php (added)
-
tags/5.0.28/includes/font/helveticabi.php (added)
-
tags/5.0.28/includes/font/helveticai.php (added)
-
tags/5.0.28/includes/font/symbol.php (added)
-
tags/5.0.28/includes/font/times.php (added)
-
tags/5.0.28/includes/font/timesb.php (added)
-
tags/5.0.28/includes/font/timesbi.php (added)
-
tags/5.0.28/includes/font/timesi.php (added)
-
tags/5.0.28/includes/font/unifont (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSans-Bold.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSans-BoldOblique.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSans-ExtraLight.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSans-Oblique.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSans.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansCondensed-Bold.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansCondensed-BoldOblique.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansCondensed-Oblique.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansCondensed.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansMono-Bold.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansMono-BoldOblique.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansMono-Oblique.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSansMono.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerif-Bold.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerif-BoldItalic.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerif-Italic.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerif.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerifCondensed-Bold.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerifCondensed-BoldItalic.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerifCondensed-Italic.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVuSerifCondensed.ttf (added)
-
tags/5.0.28/includes/font/unifont/DejaVu_LICENSE.txt (added)
-
tags/5.0.28/includes/font/unifont/ttfonts.php (added)
-
tags/5.0.28/includes/font/verdana.php (added)
-
tags/5.0.28/includes/font/verdana.z (added)
-
tags/5.0.28/includes/font/zapfdingbats.php (added)
-
tags/5.0.28/includes/fpdf.php (added)
-
tags/5.0.28/includes/front_end_register.php (added)
-
tags/5.0.28/includes/functions.php (added)
-
tags/5.0.28/includes/google_maps.js (added)
-
tags/5.0.28/includes/header.inc.php (added)
-
tags/5.0.28/includes/ical-reader.php (added)
-
tags/5.0.28/includes/import.php (added)
-
tags/5.0.28/includes/install.php (added)
-
tags/5.0.28/includes/jQueryCalendar.js (added)
-
tags/5.0.28/includes/javascript.js (added)
-
tags/5.0.28/includes/jquery-formfields.js (added)
-
tags/5.0.28/includes/jquery.jeditable.mini.js (added)
-
tags/5.0.28/includes/maps.js (added)
-
tags/5.0.28/includes/member_type.php (added)
-
tags/5.0.28/includes/new-style-callbacks.php (added)
-
tags/5.0.28/includes/pagination.class.php (added)
-
tags/5.0.28/includes/pdf_creator.php (added)
-
tags/5.0.28/includes/people_activity.php (added)
-
tags/5.0.28/includes/permissions.php (added)
-
tags/5.0.28/includes/photo-permissions.php (added)
-
tags/5.0.28/includes/podcast-settings.php (added)
-
tags/5.0.28/includes/resubscribe.php (added)
-
tags/5.0.28/includes/sermon-podcast.php (added)
-
tags/5.0.28/includes/settings.php (added)
-
tags/5.0.28/includes/shortcode-generator.php (added)
-
tags/5.0.28/includes/style.new.css (added)
-
tags/5.0.28/includes/unsubscribe.php (added)
-
tags/5.0.28/includes/vcf.php (added)
-
tags/5.0.28/premium-installer.php (added)
-
tags/5.0.28/readme.txt (added)
-
trunk/church-admin.php (modified) (5 diffs)
-
trunk/includes/functions.php (modified) (2 diffs)
-
trunk/includes/settings.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
church-admin/trunk/church-admin.php
r3346950 r3419050 5 5 Plugin URI: http://www.churchadminplugin.com/ 6 6 Description: Manage church life with address book, schedule, classes, small groups, and advanced communication tools - bulk email and sms. 7 Version: 5.0.2 77 Version: 5.0.28 8 8 Tags: sermons, sermons, prayer, membership, SMS, Bible, events, calendar, email, small groups, contact form, giving, administration, management, child protection, safeguarding 9 9 Author: Andy Moyle … … 690 690 echo'<h3>No licence found</h3><p>Please contact <a href="mailto:support@churchadminplugin.com&subject=Licence+issue+'.site_url().'">support@churchadminplugin.com</a> if you think that is wrong.</p><p>Subscribe now...</p>'; 691 691 echo '<p class="church-admin-module-select">Choose upgrade subscription, prices will convert to your currency<select class="ca_upgrade_select"> 692 <option>Choose...</option><option value="https://buy.stripe.com/9AQ7ud5obdYZ836cNP">Monthly Subscription $9.99</option><option value="https://buy.stripe.com/28o6q9dUH3kl8365lp">Quarterly subscription $29.07 (save 3% a quarter)</option><option value="https://buy.stripe.com/28o8yhdUH6wx97a29e">Annual subscription $99.99 (equivalent to 2 months free per year)</option><option value="https://buy.stripe.com/bIY4i1dUH6wxdnqg05">Lifetime licence, one off payment $175</option><option value="https://buy.stripe.com/bIYbKt2bZ7AB6Z24ho">Special price for small congregations under 50 people, one off payment $ 30</option></select><script>692 <option>Choose...</option><option value="https://buy.stripe.com/9AQ7ud5obdYZ836cNP">Monthly Subscription $9.99</option><option value="https://buy.stripe.com/28o6q9dUH3kl8365lp">Quarterly subscription $29.07 (save 3% a quarter)</option><option value="https://buy.stripe.com/28o8yhdUH6wx97a29e">Annual subscription $99.99 (equivalent to 2 months free per year)</option><option value="https://buy.stripe.com/bIY4i1dUH6wxdnqg05">Lifetime licence, one off payment $175</option><option value="https://buy.stripe.com/bIYbKt2bZ7AB6Z24ho">Special price for small congregations under 50 people, one off payment $50</option></select><script> 693 693 jQuery(document).ready(function($){ 694 694 $(function(){ … … 721 721 722 722 //front end actions 723 /************************************** 724 * handle unsubscribe link from email 725 * ************************************/ 726 if(!empty( $_GET['ca_unsub'] ) ) 727 { 728 //update sanitize, validate,escape v 3.7.25 2023-05-08 729 //sanitize 730 731 $unsub = !empty($_GET['ca_unsub'])?sanitize_text_field(stripslashes($_GET['ca_unsub'])):null; 732 //validate 733 $validMD5 = FALSE; 734 if(!empty($unsub)){ 735 $validMD5 = preg_match('/^[a-f0-9]{32}$/', $unsub); 736 } 737 738 if(!empty($validMD5)){ 739 $details=$wpdb->get_row('SELECT * FROM '.$wpdb->prefix.'church_admin_people WHERE md5(people_id)="'.esc_sql( $unsub ).'"'); 740 $wpdb->query('UPDATE '.$wpdb->prefix.'church_admin_people SET email_send=0 WHERE md5(people_id)="'.esc_sql( $unsub ).'"'); 741 require_once( plugin_dir_path( __FILE__ ).'includes/unsubscribe.php'); 742 exit(); 743 } 744 } 745 /*************************** 746 * handle re-subscribe 747 ***************************/ 748 if(!empty( $_GET['ca_sub'] ) ) 749 { 750 //update sanitize, validate,escape v 3.7.25 2023-05-08 751 //sanitize 752 753 $resub = !empty($_GET['ca_unsub'])?sanitize_text_field(stripslashes($_GET['ca_sub'])):null; 754 //validate 755 $validMD5 = FALSE; 756 if(!empty($resub)){ 757 $validMD5 = preg_match('/^[a-f0-9]{32}$/', $resub); 758 } 759 760 if(!empty($validMD5)){ 761 $details=$wpdb->get_row('SELECT * FROM '.$wpdb->prefix.'church_admin_people WHERE md5(people_id)="'.esc_sql( $resub ).'"'); 762 $wpdb->query('UPDATE '.$wpdb->prefix.'church_admin_people SET email_send=1 WHERE md5(people_id)="'.esc_sql( $resub ).'"'); 763 require_once( plugin_dir_path( __FILE__ ).'includes/resubscribe.php'); 764 exit(); 765 } 766 } 723 767 724 768 725 /************************************** … … 829 786 } 830 787 831 //church admin app initialisation 832 833 if(!empty( $_GET['ca-app'] ) ) 834 { 835 require_once( plugin_dir_path( __FILE__ ).'app/app-admin.php'); 836 switch( $_GET['ca-app'] ) 837 { 838 case'latest_media': 839 header("Content-Type: application/json"); 840 echo church_admin_json_latest_media(); 841 exit(); 842 break; 843 844 } 845 } 788 846 789 //reset version 847 790 if(!empty( $_GET['page'] )&&( $_GET['page']=='church_admin/index.php')&&!empty( $_GET['action'] )&& $_GET['action']=='reset-version') … … 1188 1131 1189 1132 1190 /******************************************************************************************************************************1191 *1192 * For prayer request, if made private in settings we want to show the login form at the template_redirect hook1193 *1194 ******************************************************************************************************************************/1195 function church_admin_private_prayer_template( $archive_template ) {1196 global $post;1197 $private=get_option('church-admin-private-prayer-requests');1198 //church_admin_debugget_post_type());1199 if ( (is_post_type_archive ( 'prayer-requests' ) || 'prayer-requests'==get_post_type()) && !is_user_logged_in() && !empty($private) ) {1200 //church_admin_debug('Prayer request not logged in');1201 $located = locate_template( 'private-prayer.php' );1202 //church_admin_debug($located);1203 if(!empty($located)){1204 1205 $archive_template = $located;1206 }1207 else1208 {1209 $archive_template = dirname( __FILE__ ) . '/display/private-prayer.php';1210 }1211 }1212 return $archive_template;1213 }1214 add_filter( 'archive_template', 'church_admin_private_prayer_template' ) ;1215 add_filter( 'single_template', 'church_admin_private_prayer_template' ) ;1216 1217 1218 /******************************************************************************************************************************1219 *1220 * Show a submit prayer requests form at the top of the archive1221 *1222 ******************************************************************************************************************************/1223 $theme = wp_get_theme(); // gets the current theme1224 1225 if ( 'Avada' == $theme->name || 'Avada' == $theme->parent_theme ) {1226 add_action('avada_before_main_container', 'church_admin_draft_prayer_request');1227 define('CA_PRY_STYLE','style="min-width:80vw;"');1228 }1229 elseif ( 'The7' == $theme->name || 'The7' == $theme->parent_theme ) {1230 add_action('presscore_before_loop', 'church_admin_draft_prayer_request');1231 }1232 elseif( 'Omega' == $theme->name || 'Omega' == $theme->parent_theme ) {1233 1234 add_action('omega_before_content', 'church_admin_draft_prayer_request');1235 }1236 elseif(has_action('church_admin_theme_before_loop') )1237 {1238 add_action('church_admin_theme_before_loop', 'church_admin_draft_prayer_request');1239 }1240 elseif(has_action('fusion_blog_shortcode_before_loop') )1241 {1242 add_action('fusion_blog_shortcode_before_loop', 'church_admin_draft_prayer_request');1243 }1244 else{1245 add_action('loop_start', 'church_admin_draft_prayer_request');1246 }1247 1248 function church_admin_draft_prayer_request( $content)1249 {1250 global $wpdb,$church_admin_prayer_request_success;1251 1252 if(is_post_type_archive('prayer-requests')&& is_archive() )1253 {1254 $private=get_option('church-admin-private-prayer-requests');1255 //only show form if not private or logged in1256 if (!$private ||(is_user_logged_in() && $private) )1257 {1258 $out='';1259 1260 if ( empty( $_POST['save_prayer_request'] )&&empty( $_POST['non_spammer'] )||!wp_verify_nonce( $_POST['non_spammer'],'prayer-request') )1261 {1262 $out.='<div class="church-admin-prayer-request alignwide" ';1263 if(defined('CA_PRY_STYLE') ) $out.= CA_PRY_STYLE;1264 $out.='><h3>'.esc_html( __('Submit a prayer request','church-admin' ) ).'</h3>';1265 $message=get_option('church_admin_prayer_request_message');1266 if(!empty( $message) )$out.='<p>'. wp_kses_post( $message).'</p>';1267 $out.='<form action="" method="POST">';1268 1269 $out.='<div class="church-admin-form-group"><label>'.esc_html( __('Title','church-admin' ) ).'</label><input type="text" name="request_title" class="church-admin-form-control"></div>';1270 $out.='<div class="church-admin-form-group"><label>'.esc_html( __('Prayer request','church-admin' ) ).'</label><textarea name="request_content" class="church-admin-form-control" style="height:100px"></textarea></div>';1271 $out.='<div id="spam-proof"> </div>';1272 $out.='<div class="church-admin-form-group"><input type="hidden" value="TRUE" name="save_prayer_request" /><input type="submit" value="'.esc_html( __('Save','church-admin' ) ).'" /></div>';1273 1274 $out.='</form></div>';1275 $nonce=wp_create_nonce('prayer-request');1276 $out.='<script>jQuery(document).ready(function( $) {var content="<div class=\"form-check\"><label>'.esc_html( __('Check box if not a spammer','church-admin' ) ).'<input type=\"checkbox\" name=\"non_spammer\" value=\"'.esc_attr($nonce).'\" /></label></div>"; $("#spam-proof").html(content);});</script>';1277 }1278 else{1279 $out=$church_admin_prayer_request_success;1280 }1281 echo $out;1282 }1283 }1284 1285 }1286 add_action('loop_start', 'church_admin_draft_act_of_courage');1287 1288 function church_admin_draft_act_of_courage( $content)1289 {1290 global $wpdb,$church_admin_acts_success;1291 1292 if(is_post_type_archive('acts-of-courage') )1293 {1294 $private=get_option('church-admin-private-acts-of-courage');1295 //only show form if not private or logged in1296 if (!$private ||(is_user_logged_in() && $private) )1297 {1298 $out='';1299 1300 if ( empty( $_POST['save_acts_request'] )&&empty( $_POST['non_spammer'] )||!wp_verify_nonce( $_POST['non_spammer'],'acts-of-courage') )1301 {1302 $out.='<h3>'.esc_html( __('Submit an act of courage','church-admin' ) ).'</h3>';1303 $message=get_option('church-admin-acts-of-courage-message');1304 if(!empty( $message) )$out.='<p>'. wp_kses_post( $message).'</p>';1305 $out.='<form action="" method="POST">';1306 $out.='<table class="form-table"><tbody>';1307 $out.='<tr><th scope="row">'.esc_html( __('Title','church-admin' ) ).'</th><td><input type="text" name="request_title"></td></tr>';1308 $out.='<tr><th scope="row">'.esc_html( __('Your act of courage','church-admin' ) ).'</th><td><textarea name="request_content"></textarea></td></tr>';1309 $out.='<tr id="spam-proof"> </td></tr>';1310 $out.='<tr><td cellspacing=2><input type="hidden" value="TRUE" name="save_act_of_courage_request" /><input type="submit" value="'.esc_html( __('Save','church-admin' ) ).'" /></td></tr></table>';1311 1312 $out.='</form>';1313 $nonce=wp_create_nonce('acts-of-courage');1314 $out.='<script>jQuery(document).ready(function( $) {var content="<th scope=\"row\">'.esc_html( __('Check box if not a spammer','church-admin' ) ).'</th><td><input type=\"checkbox\" name=\"non_spammer\" value=\"'.esc_attr($nonce).'\" /></td></tr>"; $("#spam-proof").html(content);});</script>';1315 }1316 else{1317 $out = $church_admin_acts_success;1318 }1319 echo $out;1320 }1321 }1322 1323 }1324 1133 /**************************************************************************** 1325 1134 * -
church-admin/trunk/includes/functions.php
r3270571 r3419050 1633 1633 1634 1634 1635 echo'<p>We have special offer for small churches under 50 people to upgrade to Premium for the very special one off payment of $ 30</p><p><a class="button-primary" href="https://buy.stripe.com/bIYbKt2bZ7AB6Z24ho">Upgrade now</a></p> </div>';1635 echo'<p>We have special offer for small churches under 50 people to upgrade to Premium for the very special one off payment of $50</p><p><a class="button-primary" href="https://buy.stripe.com/bIYbKt2bZ7AB6Z24ho">Upgrade now</a></p> </div>'; 1636 1636 echo'<script>jQuery(document).ready(function( $) { 1637 1637 $("body").on("click",".ca-notice-dismiss",function() { … … 5653 5653 echo '<h3>'.esc_html(__("If you don't have a standard/premium subscription. Please subscribe...",'church-admin')).'</h3>'; 5654 5654 echo '<p class="church-admin-module-select">Choose upgrade subscription, prices will convert to your currency<select class="ca_upgrade_select"> 5655 <option>Choose...</option><option value="https://buy.stripe.com/9AQ7ud5obdYZ836cNP">Monthly Subscription $9.99</option><option value="https://buy.stripe.com/28o6q9dUH3kl8365lp">Quarterly subscription $29.07 (save 3% a quarter)</option><option value="https://buy.stripe.com/28o8yhdUH6wx97a29e">Annual subscription $99.99 (equivalent to 2 months free per year)</option><option value="https://buy.stripe.com/bIY4i1dUH6wxdnqg05">Lifetime licence, one off payment $175</option><option value="https://buy.stripe.com/bIYbKt2bZ7AB6Z24ho">Special price for small congregations under 50 people, one off payment $ 30</option></select><script>5655 <option>Choose...</option><option value="https://buy.stripe.com/9AQ7ud5obdYZ836cNP">Monthly Subscription $9.99</option><option value="https://buy.stripe.com/28o6q9dUH3kl8365lp">Quarterly subscription $29.07 (save 3% a quarter)</option><option value="https://buy.stripe.com/28o8yhdUH6wx97a29e">Annual subscription $99.99 (equivalent to 2 months free per year)</option><option value="https://buy.stripe.com/bIY4i1dUH6wxdnqg05">Lifetime licence, one off payment $175</option><option value="https://buy.stripe.com/bIYbKt2bZ7AB6Z24ho">Special price for small congregations under 50 people, one off payment $50</option></select><script> 5656 5656 jQuery(document).ready(function($){ 5657 5657 $(function(){ -
church-admin/trunk/includes/settings.php
r3270571 r3419050 655 655 656 656 657 /** 658 * This function sets up Bulk SMS 659 * 660 * Author: Andy Moyle 661 * Author URI: http://www.churchadminplugin.com 662 * 663 * 664 */ 665 666 667 function church_admin_sms_settings() 668 { 669 require_once(plugin_dir_path(dirname(__FILE__) ).'/includes/sms.php'); 670 $sms_country_code=get_option('church_admin_sms_iso'); 671 $sms_sender=get_option('church_admin_sms_reply'); 672 /******************************************************** 673 * 674 * Check if old style provider is set already 675 * 676 **********************************************************/ 677 $smsProvider=get_option('church_admin_sms_provider'); 678 if ( empty( $smsProvider) ) 679 { 680 $bulksms=get_option('church_admin_bulksms'); 681 if(!empty( $bulksms) ) 682 { 683 $smsProvider='bulksms.com'; 684 update_option('church_admin_sms_provider','bulksms.com'); 685 delete_option('church_admin_bulksms'); 686 } 687 $cloudservicezm=get_option('church_admin_cloudservicezm'); 688 if(!empty( $cloudservicezm) ) 689 { 690 $smsProvider='cloudservicezm.com'; 691 update_option('church_admin_sms_provider','cloudservicezm.com'); 692 delete_option('church_admin_cloudservicezm'); 693 } 694 } 695 if(!empty( $smsProvider) ) 696 { 697 $sender=get_option('church_admin_sms_reply'); 698 switch( $smsProvider) 699 { 700 case 'bulksms.com': 701 case'cloudservicezm.com': 702 $sms_username=get_option('church_admin_sms_username'); 703 $sms_password=get_option('church_admin_sms_password'); 704 break; 705 case 'textmagic.com': 706 $sms_username=get_option('church_admin_sms_username'); 707 $api_key=get_option('church_admin_sms_api_key'); 708 break; 709 case 'twilio': 710 $smsSID=get_option('church_admin_twilio_SID'); 711 $smsToken=get_option('church_admin_twilio_token'); 712 break; 713 } 714 } 715 echo'<h2>'.esc_html( __("You can send bulk SMS to your directory using one of these SMS service providers",'church-admin' ) ).'</h2>'; 716 if ( empty( $_POST) ) 717 { 718 echo'<p>'.esc_html( __("Click on an image to sign up with a provider",'church-admin' ) ).'</p>'; 719 echo'<table class="widefat wp-list-table"><thead><tr><th class="column-primary">'.esc_html( __('SMS provider','church-admin' ) ).'</th><th>'.esc_html( __('Details','church-admin' ) ).'</th></thead><tbody><tr>'; 720 echo'<tr><td class="column-primary" data-colname="Twilio">Twilio<button type="button" class="toggle-row"> 721 <span class="screen-reader-text">show details</span> 722 </button></td><td><a href="https://www.twilio.com/referral/YjV7bl"><img src="'.plugins_url('/images/twilio-logo.png',dirname(__FILE__) ).'" alt="Twilio" /><br>'.esc_html( __('Get $10 free when you purchase $10 of credit','church-admin' ) ).'</a><br>'.esc_html( __('Twilio require you to purchase a cell number from them to send SMS at $1pm, but that allows you to send and receive SMS from this website','church-admin' ) ).'<button type="button" class="toggle-row"> 723 <span class="screen-reader-text">show details</span> 724 </button></td></tr>'; 725 echo'<tr><td class="column-primary" data-colname="Textmagic">Textmagic<button type="button" class="toggle-row"> 726 <span class="screen-reader-text">show details</span> 727 </button></td><td><a href="https://shareasale.com/r.cfm?b=1370513&u=2478286&m=75317&urllink=&afftrack="><img src="'.plugins_url('/images/textmagic-logo.jpeg',dirname(__FILE__) ).'" alt="textmagic.com" /><br>'.esc_html( __('Pricing available in USD, GBP, AUD and EUR','church-admin' ) ).'</a></td></tr>'; 728 729 echo'<tr><td class="column-primary" data-colname="BulkSMS">BulkSMS<button type="button" class="toggle-row"> 730 <span class="screen-reader-text">show details</span> 731 </button></td><td><a href="https://www.bulksms.com"><img src="'.plugins_url('/images/bulksms-logo.png',dirname(__FILE__) ).'" alt="bulksms.com" /></a><br>'.esc_html( __('Pricing available in GBP','church-admin' ) ).'</td></tr>'; 732 echo'<tr><td class="column-primary" data-colname="Zambia CloudService">Cloudservice Zambia<button type="button" class="toggle-row"> 733 <span class="screen-reader-text">show details</span> 734 </button></td><td><a href="https://www.cloudservicezm.com/"><img src="'.plugins_url('/images/cloudservicezm-logo.jpeg',dirname(__FILE__) ).'" alt="cloudservicezm.com" /></a><br>'.esc_html( __('Unknown pricing - Zambia only','church-admin' ) ).'</td></tr>'; 735 echo'</tr></tbody></table>'; 736 } 737 if(!empty( $_POST['save-sms-settings'] ) ) 738 { 739 switch( $_POST['sms-provider'] ) 740 { 741 case'twilio': 742 update_option('church_admin_sms_provider','twilio'); 743 update_option('church_admin_twilio_token',church_admin_sanitize( $_POST['sms-token'] ) ); 744 update_option('church_admin_twilio_SID',church_admin_sanitize($_POST['sms-SID'] ) ); 745 $smsSID=church_admin_sanitize( $_POST['sms-SID'] ); 746 $smsToken=church_admin_sanitize($_POST['sms-token'] ); 747 $smsProvider='twilio'; 748 break; 749 case'textmagic.com': 750 update_option('church_admin_sms_provider','textmagic.com'); 751 update_option('church_admin_sms_api_key',church_admin_sanitize( $_POST['sms-api-key'] ) ); 752 $smsProvider='textmagic.com'; 753 $sms_api_key=church_admin_sanitize( $_POST['sms-api-key'] ); 754 break; 755 case'bulksms.com': 756 update_option('church_admin_sms_provider','bulksms.com'); 757 update_option('church_admin_sms_password',sanitize_text_field( $_POST['sms-password'] ) ); 758 $smsProvider='bulksms.com'; 759 $sms_password=church_admin_sanitize( $_POST['sms-password'] ); 760 break; 761 case'cloudservicezm.com': 762 update_option('church_admin_sms_provider','cloudservicezm.com'); 763 update_option('church_admin_sms_password',sanitize_text_field( $_POST['sms-password'] ) ); 764 $smsProvider='cloudservicezm.com'; 765 $sms_password=church_admin_sanitize( $_POST['sms-password'] ); 766 break; 767 } 768 update_option('church_admin_sms_username',church_admin_sanitize( $_POST['sms-username'] ) ); 769 $sms_username=sanitize_text_field( $_POST['sms-username'] ); 770 update_option('church_admin_sms_iso',church_admin_sanitize( $_POST['sms-iso'] ) ); 771 $sms_iso=sanitize_text_field( $_POST['sms-iso'] ); 772 update_option('church_admin_sms_reply',church_admin_sanitize( $_POST['sms-sender'] ) ); 773 $sms_sender = church_admin_sanitize( $_POST['sms-sender'] ); 774 echo'<div class="notice notice-success inline"><h2>'.esc_html( __('SMS provider settings saved','church-admin' ) ).'</h2></div>'; 775 } 776 echo'<h2>'.esc_html( __('SMS provider settings','church-admin' ) ).'</h2>'; 777 echo'<form action="" method="post">'; 778 echo'<table class="form-table">'; 779 echo'<tr><th scope="row">'.esc_html( __('Country code (eg 44 for GB)','church-admin' ) ).'</th><td><input type="text" name="sms-iso" '; 780 if(!empty( $sms_country_code) ) echo' value="'.esc_html( $sms_country_code).'" '; 781 echo'/></td></tr>'; 782 echo'<tr><th scope="row">'.esc_html( __('SMS sender cell eg:4412345678901, except Twilio +4412345678901','church-admin' ) ).'</th><td><input type="text" name="sms-sender" '; 783 if(!empty( $sms_sender) ) echo' value="'.esc_html( $sms_sender).'" '; 784 echo'/></td></tr>'; 785 echo'<tr><th scope="row">'.esc_html( __("Select SMS provider",'church-admin' ) ).'</th><td><select class="sms_provider" name="sms-provider">'; 786 if(!empty( $smsProvider) )echo'<option selected="selected" value="'.esc_html( $smsProvider).'">'.esc_html( $smsProvider).'</option>'; 787 echo'<option value="textmagic.com">textmagic.com</option>'; 788 echo'<option value="twilio">Twilio</option>'; 789 echo'<option value="bulksms.com">bulksms.com</option>'; 790 echo'<option value="cloudservicezm.com">cloudservicezm.com</option>'; 791 echo'</select></td></tr>'; 792 793 if(!empty( $smsProvider) ) 794 { 795 switch( $smsProvider) 796 { 797 case 'twilio': 798 $showAPI=FALSE; 799 $showP=FALSE; 800 $showSID=TRUE; 801 $showToken=TRUE; 802 $showUserName=FALSE; 803 break; 804 default:case'textmagic.com': 805 $showAPI=TRUE; $showToken=$showSID=$showP=FALSE; 806 break; 807 case 'bulksms.com':case'cloudservicezm.com': 808 $showToken=$showSID=$showAPI=FALSE; 809 $showUserName=$showP=TRUE; 810 break; 811 } 812 }else{$showAPI=TRUE; $showUP=FALSE;} 813 814 echo'<tr class="sms-username"'; 815 if ( empty( $showUserName) )echo ' style="display:none" '; 816 echo'><th scope="row">'.esc_html( __('Username','church-admin' ) ).'</th><td><input type="text" name="sms-username" '; 817 if(!empty( $sms_username) )echo'value="'.esc_html( $sms_username).'" '; 818 echo'/></td></tr>'; 819 echo'<tr class="sms-api-key"'; 820 if ( empty( $showAPI) )echo ' style="display:none" '; 821 echo'><th scope="row">'.esc_html( __('API key','church-admin' ) ).'</th><td><input type="text" name="sms-api-key" '; 822 if(!empty( $api_key) )echo'value="'.esc_html( $api_key).'" '; 823 echo'/></td></tr>'; 824 825 echo'<tr class="sms-password" '; 826 if ( empty( $showP) )echo ' style="display:none" '; 827 echo'><th scope="row">'.esc_html( __('Password','church-admin' ) ).'</th><td><input type="text" name="sms-password" '; 828 if(!empty( $sms_password) )echo'value="'.esc_html( $sms_password).'" '; 829 echo'/></td></tr>'; 830 /******************* 831 * Twilio 832 ********************/ 833 echo'<tr class="sms-SID"'; 834 if ( empty( $showSID) )echo ' style="display:none" '; 835 echo'><th scope="row">'.esc_html( __('Twilio SID','church-admin' ) ).'</th><td><input type="text" name="sms-SID" '; 836 if(!empty( $smsSID) )echo'value="'.esc_html( $smsSID).'" '; 837 echo'/></td></tr>'; 838 echo'<tr class="sms-token"'; 839 if ( empty( $showToken) )echo ' style="display:none" '; 840 echo'><th scope="row">'.esc_html( __('Twilio Token','church-admin' ) ).'</th><td><input type="text" name="sms-token" '; 841 if(!empty( $smsToken) )echo'value="'.esc_html( $smsToken).'" '; 842 echo'/></td></tr>'; 843 echo'<tr><th scope="row"> </th><td><input type="hidden" name="save-sms-settings" value="TRUE" /><input type="submit" value="'.esc_html( __('Save','church-admin' ) ).' »" class="button-primary" /></form>'; 844 echo'</table>'; 845 846 847 echo'<script>jQuery(document).ready(function( $) { 848 $(".sms_provider").on("change",function() { 849 var sms_provider=$(this).val(); 850 switch(sms_provider) 851 { 852 case "twilio": 853 $(".sms-api-key").hide(); 854 $(".sms-password").hide(); 855 $(".sms-SID").show(); 856 $(".sms-token").show(); 857 $(".sms-username").hide(); 858 break; 859 case "textmagic.com": 860 $(".sms-api-key").show(); 861 $(".sms-password").hide(); 862 $(".sms-SID").hide(); 863 $(".sms-token").hide(); 864 $(".sms-username").show(); 865 break; 866 case "bulksms.com":case"cloudservicezm.com": 867 $(".sms-api-key").hide(); 868 $(".sms-username").show(); 869 $(".sms-password").show(); 870 $(".sms-SID").hide(); 871 $(".sms-token").hide(); 872 break; 873 } 874 }) 875 });</script>'; 876 877 878 879 880 881 } 657 882 658 /** 883 659 * This function general settings … … 941 717 }else{delete_option('church_admin_login_redirect');} 942 718 943 if(!empty( $_POST['no-push'] ) ) 944 { 945 update_option('church_admin_no_push',TRUE); 946 } 947 else 948 { 949 delete_option('church_admin_no_push'); 950 } 951 if ( empty( $_POST['private-prayer'] ) ) 952 { 953 update_option('church-admin-private-prayer-requests',FALSE); 954 955 }else 956 { 957 update_option('church-admin-private-prayer-requests',TRUE); 958 959 } 960 961 962 if(!empty( $_POST['prayer-request-admin-push'] ) ) 963 { 964 $prayer_request_people_ids=maybe_unserialize(church_admin_get_people_id( church_admin_sanitize($_POST['prayer-request-admin-push'] ) ) ); 965 update_option('church_admin_prayer_request_receive_push_to_admin', $prayer_request_people_ids); 966 } 967 else 968 { 969 delete_option('church_admin_prayer_request_receive_push_to_admin'); 970 } 971 if ( empty( $_POST['private-acts-of-courage'] ) ) 972 { 973 update_option('church-admin-private-acts-of-courage',FALSE); 974 975 }else 976 { 977 update_option('church-admin-private-acts-of-courage',TRUE); 978 979 } 719 720 721 722 980 723 981 724 if ( empty( $_POST['wedding_anniversary'] ) ) { … … 1020 763 1021 764 1022 if(!empty( $_POST['church_admin_receipt_email_from_name'] ) ){ 1023 update_option('church_admin_receipt_email_from_name',church_admin_sanitize( $_POST['church_admin_receipt_email_from_name'] ) ); 1024 } 1025 if(!empty( $_POST['church_admin_receipt_email_from_email'] ) ){ 1026 update_option('church_admin_receipt_email_from_email',church_admin_sanitize( $_POST['church_admin_receipt_email_from_email'] ) ); 1027 } 1028 if(!empty( $_POST['church_admin_receipt_email_template'] ) ){ 1029 update_option('church_admin_receipt_email_template',church_admin_sanitize( $_POST['church_admin_receipt_email_template'] ) ); 1030 } 765 1031 766 if(isset( $_POST['church_admin_label'] ) ) 1032 767 { … … 1052 787 } 1053 788 789 if(!empty($_POST['extra_genders'])){ 790 $genders=get_option('church_admin_gender'); 791 $extras = explode(', ',church_admin_premium_sanitize($_POST['extra_genders'])); 792 foreach($extras AS $key=>$value){$genders[]=$value;} 793 update_option('church_admin_gender',$genders); 794 } 1054 795 echo'<div class="notice notice-success inline"><p>'.esc_html( __('Settings updated','church-admin' ) ).'</p></div>'; 1055 796 $generalDisplay='display:block'; … … 1062 803 1063 804 echo'<h2>'.esc_html( __('General Settings','church-admin' ) ).'</h2>'; 1064 echo'<div class="church-admin-form-group"><label>'.esc_html( __('Remove data on plugin delete','church-admin' ) ).' </label>'; 805 1065 806 1066 807 … … 1118 859 echo '/></td></tr>'; 1119 860 1120 /* 1121 echo'<tr><th scope="row">'.esc_html( __('Add nickname for names','church-admin' ) ).'</th><td><input type="checkbox" name="use_nickname" value="TRUE" '; 1122 $nickname=get_option('church_admin_use_nickname'); 1123 if( $nickname)echo ' checked="checked"'; 1124 echo '/></td></tr>'; 1125 */ 861 1126 862 echo'<tr><th scope="row">'.esc_html( __('Google Maps API key','church-admin' ) ).'</th><td><input type="text" name="google_api" value="'.get_option('church_admin_google_api_key').'" /></td></tr>'; 1127 863 echo'<tr><td colspan="2"><a taregt="_blank" href="https://www.churchadminplugin.com/tutorials/google-api-key/">'.esc_html( __('How to get a Google API key','church-admin' ) ).'</a></td></tr>'; … … 1133 869 if( $no_push) echo' checked="checked" '; 1134 870 echo'/></td></tr>'; 1135 /*************************** 1136 * What three words 1137 **************************/ 1138 $googleAPI=get_option('church_admin_google_api_key'); 1139 if(!empty( $googleAPI) ) 1140 {//requires google API key to work 1141 $w3w='on'; 1142 $w3w=get_option('church_admin_what_three_words'); 1143 echo'<tr><th colspan=2><h2>'.esc_html( __('What three words','church-admin' ) ).'</h2></th></tr>'; 1144 echo'<tr><th colspan=2>'.esc_html( __('What Three Words has divided the world into 3 metre squares and gave each square a unique combination of three words. It’s the easiest way to find and share exact locations.','church-admin' ) ).'</th></tr>'; 1145 echo '<tr><th scope="row">'.esc_html( __('What Three Words enabled')).'</th><td><input type="checkbox" name="what-three-words" '.checked( $w3w,'on',false).'/></td></tr>'; 1146 //grab what three words languages 1147 $response = wp_remote_get( esc_url_raw('https://api.what3words.com/v3/available-languages?key=7F5FVM60' ) ); 1148 $api_response = json_decode( wp_remote_retrieve_body( $response ), true ); 1149 1150 $w3wLanguage=get_option('church_admin_what_three_words_language'); 1151 if ( empty( $w3wLanguage) )$w3wLanguage='en'; 1152 $languages=$api_response['languages']; 1153 if(!empty( $languages) ) 1154 { 1155 echo '<tr><th scope="row">'.esc_html( __('What Three Words language')).'</th><td><select name="what-three-words-language">'; 1156 foreach( $languages AS $key=>$detail) 1157 { 1158 echo'<option value="'.esc_html( $detail['code'] ).'" '.selected( $w3wLanguage,$detail['code'],false).'>'.esc_html( $detail['nativeName'] ).'</option>'; 1159 } 1160 echo'</select></td></tr>'; 1161 } 1162 1163 echo'</tbody></table>'; 1164 } 871 1165 872 /*********************** 1166 873 * PDF and Mailing Label settings 1167 874 ***********************/ 1168 echo'<table class="form-table"><thead><tr><th colspan=2><h2>'.esc_html( __('PDF and Mailing Label settings','church-admin' ) ).'</th></tr><thead><tbody>'; 1169 echo '<tr><th scope="row">'.esc_html( __('PDF Page Size','church-admin' ) ).'</th><td><select name="pdf_size">'; 875 echo'<h2>'.esc_html( __('PDF and Mailing Label settings','church-admin' ) ).'</h2>'; 876 echo'<div class="church-admin-form-group"><label>'.esc_html( __('PDF Page Size','church-admin' ) ).'</label>'; 877 echo '<select class="church-admin-form-control" name="pdf_size">'; 1170 878 $pdf_size=get_option('church_admin_pdf_size'); 1171 879 echo'<option value="A4" '.selected( $pdf_size,'A4').'>A4</option>'; 1172 880 echo'<option value="Letter" '.selected( $pdf_size,'Letter').'>Letter</option>'; 1173 881 echo'<option value="Legal" '.selected( $pdf_size,'Legal').'>Legal</option>'; 1174 echo'</select></ td></tr>';1175 echo '< tr><th scope="row">Avery ® Label</th><td><selectname="church_admin_label">';882 echo'</select></div>'; 883 echo '<div class="church-admin-form-group"><label>Avery ® Label</label><select class="church-admin-form-control" name="church_admin_label">'; 1176 884 1177 885 $l=get_option('church_admin_label'); … … 1199 907 echo'<option value="3422"'; 1200 908 if( $l=='3422') echo' selected="selected" '; 1201 echo'>3422</option></select></td></tr>'; 1202 /************************************** 1203 * Donor Receipt email settings 1204 *****************************************/ 1205 $template=get_option('church_admin_receipt_email_template'); 1206 $from_name=$from_email=''; 1207 $from_name = get_option('church_admin_receipt_email_from_name'); 1208 $from_email = get_option('church_admin_receipt_email_from_email'); 1209 echo'<table class="form-table"><thead><tr><th colspan=2><h2>'.esc_html( __('Donation receipt email settings','church-admin' ) ).'</th></tr><thead><tbody>'; 1210 echo '<tr><th scope="row">'.esc_html( __('Email from name','church-admin' ) ).'</th><td><input type="text" name="church_admin_receipt_email_from_name" value="'.esc_html( $from_name).'" /></td></tr>'; 1211 echo '<tr><th scope="row">'.esc_html( __('Email from email','church-admin' ) ).'</th><td><input type="text" name="church_admin_receipt_email_from_email" value="'.esc_html( $from_email).'" /></td></tr>'; 1212 echo '<tr><th scope="row">'.esc_html( __('Email template before amounts','church-admin' ) ).'</th><td><textarea name="church_admin_receipt_email_template" cols=80 rows=10>'.esc_textarea( $template ).'</textarea></td></tr>'; 1213 echo'</table>'; 909 echo'>3422</option></select></div>'; 910 911 /*********************** 912 * Gender Settings 913 ************************/ 914 $genders = get_option('church_admin_gender'); 915 unset($genders[0]); 916 unset($genders[1]); 917 if(!empty($genders)){$extra=implode(', ',$genders);}else{$extra='';} 918 echo'<h2>'.esc_html(__('Gender Settings','church-admin')).'</h2>'; 919 echo'<p>'.esc_html(__('Church Admin uses the Biblically normative genders of "Male" and "Female", some churches have asked to be able to add to the list of genders, so you can add other options with comma separation','church-admin')).'</p>'; 920 echo'<div class="church-admin-form-group"><label>'.esc_html(__('Other options','church-admin')).'</label><input class="church-admin-form-control" type="text" name="extra_genders" value="'.esc_attr($extra).'"></div>'; 1214 921 1215 922 echo'<p><input type="hidden" name="save-general-settings" value="save"><input class="button-primary" type="submit" value="'.esc_attr(__('Save','church-admin')).'"></p></form>'; -
church-admin/trunk/readme.txt
r3353386 r3419050 5 5 Requires at least: 5.0 6 6 Requires PHP: 7.0 7 Tested up to: 6. 8.28 Stable tag: 5.0.2 77 Tested up to: 6.7 8 Stable tag: 5.0.28 9 9 Elementor tested up to: 3.25.0 10 10 License: GNU General Public License (GPL) version 2 … … 61 61 62 62 == Changelog == 63 = 5.0.28 = 64 * Settings Updates 63 65 = 5.0.27 = 64 66 * Fixed image upload in directory section
Note: See TracChangeset
for help on using the changeset viewer.