Plugin Directory

Changeset 2673889


Ignore:
Timestamp:
02/07/2022 02:37:32 AM (4 years ago)
Author:
falcon13
Message:

Version 2.4
Replaced reCaptcha with hCaptcha
Added assembly to council.
Changed lists to use datatableds (except post types). Also merged setting knights scores into the knights list (non-post type).

Location:
kofc-state
Files:
11 added
2 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • kofc-state/trunk/admin.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2019, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         7/21/2016
    99 */
    1010
    11 /** Main page that has the recruiting scores entry
    12  */
    13 function otgkofcs_scores_knights_page () {
    14     // ***** Security Check *****
    15     if (!current_user_can('publish_posts')) {
    16         wp_die(__('You do not have sufficient permissions to access this page.'));
    17     }
    18 
    19     // ***** Load Models, Helpers and Libraries *****
    20     require_once(plugin_dir_path(__FILE__) . 'models/scores_model.php');
    21     $otgkofcs_Scores_Model = new otgkofcs_Scores_Model();
    22     require_once(plugin_dir_path(__FILE__) . 'helpers/view_helper.php');
    23     require_once(plugin_dir_path(__FILE__) . 'helpers/validation_helper.php');
    24    
    25     $message_list = array();
    26 
    27     if (isset($_POST['_wpnonce'])) {
    28         // *** Scores Form Submitted ***
    29         check_admin_referer('recruiting_knights');
    30        
    31         foreach (otgkofcs_get_request_int_array('k_score') as $key => $value) {
    32             if (0 > $value)
    33                 $value = 0;
    34             $result = $otgkofcs_Scores_Model->knight_set_score($key, $value);
    35             if (!empty($result['error']))
    36                 $message_list = [$result['error'], 3, 2];
    37         }
    38         $otgkofcs_Scores_Model->cleanup();
    39     }
    40 
    41     // ***** Get Data *****
    42     $knights_list = $otgkofcs_Scores_Model->knight_scores();
    43 
    44     // ***** Call View *****
    45     include(plugin_dir_path(__FILE__) . 'views/admin/scores_knights.php');
    46 }
    47 
    4811/** Page to View and Edit District Scores and Names of Deputies
    4912 */
     
    5518
    5619    // ***** Load Models, Helpers and Libraries *****
    57     global $otgkofcs_Councils;
     20    global $otgkofcs_Council;
    5821    require_once("models/scores_model.php");
    5922    $otgkofcs_Scores_Model = new otgkofcs_Scores_Model();
     
    9255        }
    9356        $message_list[] = ['Scores Updated', 1, 3];
    94     }
    95 
    96     // ***** Get Data *****
    97     $council_list = $otgkofcs_Councils->get_list();
     57        $otgkofcs_Scores_Model->cleanup();
     58    }
     59
     60    // ***** Get Data *****
     61    $council_list = $otgkofcs_Council->get_list();
    9862    $council_scores = $otgkofcs_Scores_Model->council_scores();
    9963    $district_list = $otgkofcs_Scores_Model->district_scores();
     
    11276
    11377    // ***** Load Models, Helpers and Libraries *****
    114     require_once("models/recruiting_model.php");
     78    global $otgkofcs_Council;
     79    require_once(plugin_dir_path(__FILE__) . 'models/recruiting_model.php');
    11580    $Recruiting_Model = new otgkofcs_Recruiting_Model();
    116     require_once(plugin_dir_path(__FILE__) . "helpers/view_helper.php");
     81    require_once(plugin_dir_path(__FILE__) . 'models/scores_model.php');
     82    $Score_Model = new otgkofcs_Scores_Model();
     83    require_once(plugin_dir_path(__FILE__) . 'helpers/view_helper.php');
    11784    require_once(plugin_dir_path(__FILE__) . 'helpers/validation_helper.php');
    11885
     
    12390        $action = otgkofcs_get_request_string('action');
    12491        check_admin_referer('knights_list');
     92
     93        if ('score' == $action) {
     94            $score_list = otgkofcs_get_request_int_array('score');
     95            $count = 0;
     96            foreach ($score_list as $knight_id => $score) {
     97                $result = $Score_Model->knight_set_score($knight_id, $score);
     98                if (!empty($result))
     99                    $count++;
     100            }
     101            if (1 == $count)
     102                $message_list[] = ['1 Score Updated', 1, 3];
     103            else
     104                $message_list[] = ["$count Scores Updated", 1, 3];
     105        }
    125106       
    126         $bulk_action_list = otgkofcs_get_request_int_array();
    127107        if ('delete' == $action) {
     108            $bulk_action_list = otgkofcs_get_request_int_array();
     109            $delete_count = 0;
    128110            foreach ($bulk_action_list as $listing_id) {
    129                 $Recruiting_Model->knight_delete($listing_id);
    130                 $message_list[] = ["Knight #$listing_id Deleted", 1, 3];
     111                $result = $Recruiting_Model->knight_delete($listing_id);
     112                if (!empty($result))
     113                    $delete_count++;
    131114            }
     115            if (1 == $delete_count)
     116                $message_list[] = ['1 Knight Deleted', 1, 3];
     117            else
     118                $message_list[] = ["$delete_count Knights Deleted", 1, 3];
    132119        }
    133120    }
     
    143130                ]);
    144131        if (empty($result['error'])) {
    145             $knight_id = $result['knight_id'];
    146132            $message_list[] = [$result['message'], 1, 3];
    147133        } else {
     
    159145            $message_list[] = ['Knight Scores Reset', 1, 3];
    160146        }
    161     }   
    162 
    163     otgkofcs_knight_table($Recruiting_Model, $message_list, otgkofcs_get_request_int('paged'), otgkofcs_get_request_string('order_by'), otgkofcs_get_request_string('order_direction'));
    164 }
    165 
    166 /** Creates the Knight List Page
    167  * Is called from other functions
    168  * @param otgkofcs_Recruiting_Model $otgkofcs_Recruiting_Model
    169  * @param string or array $message
    170  * @param string or array $error
    171  * @param int $page
    172  * @param string $order_by
    173  * @param string $order_direction
    174  */
    175 function otgkofcs_knight_table ($otgkofcs_Recruiting_Model, $message_list = null, $page = null, $order_by = null, $order_direction = null) {
    176     global $otgkofcs_Councils;
    177    
    178     // ***** Check for Get Variables *****
    179     if (empty($page))
    180         $page = 1;
    181     if (empty($order_by))
    182         $order_by = 'name_last';
    183     if (empty($order_direction))
    184         $order_direction = 'ASC';
    185 
    186     // ***** Get Data *****
    187     $result = $otgkofcs_Recruiting_Model->knights_list($page, 25, $order_by, $order_direction);
    188     $council_list = $otgkofcs_Councils->get_list();
     147    }
     148
     149    // ***** Get Data *****
     150    $knights_list = $Recruiting_Model->knights_list();
     151    $council_list = $otgkofcs_Council->get_list();
     152   
    189153    // ***** Call View *****
    190154    include(plugin_dir_path(__FILE__) . 'views/admin/knights_list.php');
     
    200164
    201165    // ***** Load Models, Helpers and Libraries *****
    202     global $otgkofcs_Councils;
     166    global $otgkofcs_Council;
    203167    require_once(plugin_dir_path(__FILE__) . 'models/recruiting_model.php');
    204     $otgkofcs_Recruiting_Model = new otgkofcs_Recruiting_Model();
     168    $Recruiting_Model = new otgkofcs_Recruiting_Model();
    205169    require_once(plugin_dir_path(__FILE__) . 'helpers/view_helper.php');
    206170    require_once(plugin_dir_path(__FILE__) . 'helpers/validation_helper.php');
     
    222186        if (empty($knight_id)) {
    223187            check_admin_referer('knight_add');
    224             $result = $otgkofcs_Recruiting_Model->knight_add($data);
     188            $result = $Recruiting_Model->knight_add($data);
    225189        } else {
    226190            check_admin_referer('knight_edit_' . $knight_id);
    227             $result = $otgkofcs_Recruiting_Model->knight_update($data);
    228         }
    229         if (!empty($result['error']))
     191            $result = $Recruiting_Model->knight_update($data);
     192        }
     193        if (!empty($result['error'])) {
    230194            $message_list[] = [$result['error'], 3, 2];
    231         else
     195        } else {
    232196            $message_list[] = [$result['message'], 1, 3];
    233        
    234         // *** Show Knight List ***
    235         otgkofcs_knight_table($otgkofcs_Recruiting_Model, $message_list);
    236        
     197            if (empty($knight_id))
     198                $knight_id = $result['knight_id'];
     199        }
     200    }
     201
     202    if (!empty($knight_id)) {
     203        $record = $Recruiting_Model->knight_get($knight_id);
     204        if (!$record)
     205            wp_die(__('Invalid id.'));
     206    } elseif (!empty($data)) {
     207        $record = $data;
    237208    } else {
    238         if (!empty($knight_id)) {
    239             $record = $otgkofcs_Recruiting_Model->knight_get($knight_id);
    240             if (!$record)
    241                 wp_die(__('Invalid id.'));
    242         } else {
    243             $record = array('knight_id' => null, 'name_first' => null, 'name_last' => null, 'council_id' => null, 'score' => null);
    244         }
    245         $council_list = $otgkofcs_Councils->get_list();
    246         include(plugin_dir_path(__FILE__) . 'views/admin/knight_edit.php');
    247     }
     209        $record = ['knight_id' => null, 'name_first' => null, 'name_last' => null, 'council_id' => null, 'score' => null];
     210    }
     211    $council_list = $otgkofcs_Council->get_list();
     212    include(plugin_dir_path(__FILE__) . 'views/admin/knight_edit.php');
    248213}
    249214
     
    262227    $message_list = array();
    263228    $option_list = ['otgkofcs_number_of_districts', 'otgkofcs_star_table_top_offset', 'otgkofcs_email_sender_name', 'otgkofcs_email_sender_address',
    264             'otgkofcs_recaptcha_public_key', 'otgkofcs_recaptcha_secret_key'];
     229            'otgkofcs_hcaptcha_site_key', 'otgkofcs_hcaptcha_secret_key'];
    265230
    266231    if (isset($_POST['_wpnonce'])) {
     
    358323    // ***** Load Models, Helpers and Libraries *****
    359324    require_once(plugin_dir_path(__FILE__) . "models/messages_model.php");
    360     $otgkofcs_Messages_Model = new otgkofcs_Messages_Model();
     325    $Messages_Model = new otgkofcs_Messages_Model();
    361326    require_once(plugin_dir_path(__FILE__) . "helpers/view_helper.php");
    362327    require_once(plugin_dir_path(__FILE__) . 'helpers/validation_helper.php');
     
    373338            $count = 0;
    374339            foreach ($bulk_action_list as $message_id) {
    375                 $otgkofcs_Messages_Model->delete($message_id);
    376                 $count++;
     340                $result = $Messages_Model->delete($message_id);
     341                if (!empty($result))
     342                    $count++;
    377343            }
    378344            if (1 == $count)
     
    383349    }
    384350
    385     // ***** Check for Get Variables *****
    386     $page = otgkofcs_get_request_int('page', 1);
    387     $order_by = otgkofcs_get_request_string('order_by' ,'date');
    388     $order_direction = otgkofcs_get_request_string('order_direction', 'DESC');
    389 
    390     // ***** Get Data *****
    391     $result = $otgkofcs_Messages_Model->get_list($page, 25, $order_by, $order_direction);
     351    // ***** Get Data *****
     352    $email_list = $Messages_Model->get_list();
    392353
    393354    // ***** Call View *****
     
    428389
    429390    // ***** Load Models, Helpers and Libraries *****
    430     global $otgkofcs_Councils;
     391    global $otgkofcs_Council;
    431392    require_once(plugin_dir_path(__FILE__) . 'models/star_model.php');
    432393    $otgkofcs_Star_Model = new otgkofcs_Star_Model();
     
    435396
    436397    $message_list = array();
    437     $councils_list = $otgkofcs_Councils->get_list();
     398    $councils_list = $otgkofcs_Council->get_list();
    438399
    439400    // ***** Update Star Council Checklist if Submitted *****
     
    466427    add_options_page('KofC State Plugin', 'KofC State Plugin', 'manage_options', 'kofc-state-options', 'otgkofcs_options_page');
    467428
    468     add_menu_page('Scoreboard', 'Scoreboard', 'publish_posts', 'kofc-state', 'otgkofcs_scores_knights_page', '', 7);
    469     add_submenu_page('kofc-state', 'Recruiting Scores - Knights', 'Knights Scores', 'publish_posts', 'kofc-state', 'otgkofcs_scores_knights_page');
    470     add_submenu_page('kofc-state', 'Recruiting Scores - Council & District Scores', 'Council & District Scores', 'publish_posts', 'kofc-state-scores-councils-districts', 'otgkofcs_scores_coun_dist_page');
    471     add_submenu_page('kofc-state', 'Star Council', 'Star Council Scores', 'publish_posts', 'kofc-state-scores-star-council', 'otgkofcs_scores_star_council_page');
    472 
    473     add_submenu_page('kofc-state', 'Recruiting - Knights List', 'Knights List', 'publish_posts', 'kofc-state-knights', 'otgkofcs_knights_list_page');
    474     add_submenu_page('kofc-state-knights', 'Recruiting - Edit Knight', 'Edit', 'publish_posts', 'kofc-state-knight-edit', 'otgkofcs_knight_edit');
    475 
    476     add_submenu_page('kofc-state', 'Scoreboard - Star Council Requirements', 'Star Council Requirements', 'publish_posts', 'kofc-state-starreq', 'otgkofcs_star_reqs_list_page');   
    477 
    478     add_menu_page('Inbound Messages', 'Inbound Messages', 'publish_posts', 'kofc-state-messages', 'otgkofcs_messages_list_page', '', 8);
     429    add_menu_page('Scoreboard', 'Scoreboard', 'publish_posts', 'kofc-state', 'otgkofcs_knights_list_page', '', 8);
     430    add_submenu_page('kofc-state', 'Recruiting Scores - Knights', 'Knights', 'publish_posts', 'kofc-state', 'otgkofcs_knights_list_page');
     431    add_submenu_page(null, 'Edit Knight', 'Knights', 'publish_posts', 'kofc-state-knight-edit', 'otgkofcs_knight_edit');
     432    add_submenu_page('kofc-state', 'Recruiting Scores - Council & District', 'Councils & Districts', 'publish_posts', 'kofc-state-scores-councils-districts', 'otgkofcs_scores_coun_dist_page');
     433    add_submenu_page('kofc-state', 'Star Council', 'Star Council', 'publish_posts', 'kofc-state-scores-star-council', 'otgkofcs_scores_star_council_page');
     434    add_submenu_page('kofc-state', 'Scoreboard - Star Council Requirements', 'Star Council Requirements', 'publish_posts', 'kofc-state-starreq', 'otgkofcs_star_reqs_list_page');
     435
     436    add_menu_page('Inbound Messages', 'Inbound Messages', 'publish_posts', 'kofc-state-messages', 'otgkofcs_messages_list_page', '', 9);
    479437    add_submenu_page('kofc-state-messages', '', '', 'publish_posts', 'kofc-state-message-view', 'otgkofcs_message_page');
    480 
    481     add_action('knight_add', 'otgkofcs_ajax_knight_add');
    482438   
    483439    add_filter('plugin_action_links_kofc-state/kofc-state.php', 'otgkofcs_add_settings_link'); 
     
    494450}
    495451
    496 
    497452/** Load Styles and Javascript Files Used on Admin Pages
    498  *
    499453 */
    500454function otgkofcs_admin_styles_and_scripts () {
     455    wp_register_style('otgcalgs_datatables_css', plugins_url('datatables.min.css', __FILE__));
     456    wp_enqueue_style('otgcalgs_datatables_css');
     457    wp_enqueue_script('otgcalgs_datatables', plugins_url('datatables.min.js', __FILE__));
    501458    wp_register_style('otgkofcs_jquery-ui-smoothness', plugins_url('jquery-ui-smoothness-1.11.4.min.css', __FILE__));
    502459    wp_enqueue_style('otgkofcs_jquery-ui-smoothness');
  • kofc-state/trunk/helpers/validation_helper.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (https://onthegridwebdesign.com)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2018-2020, On the Grid Web Design LLC
     7 * @copyright       (c) 2018-2021, On the Grid Web Design LLC
    88 * @created         2/24/2018
    99*/
     
    123123}
    124124
    125 /** Verifies a Google Recaptcha
     125/** Verifies a hCaptcha
    126126 * @return boolean
    127127 */
    128 function otgkofcs_verify_recaptcha () {
    129     $post_data['secret'] = get_option('otgkofcs_recaptcha_secret_key');
    130     $post_data['response'] = otgkofcs_get_request_string('g-recaptcha-response');
     128function otgkofcs_verify_hcaptcha () {
     129    $post_data['secret'] = get_option('otgkofcs_hcaptcha_secret_key');
     130    $post_data['response'] = otgkofcs_get_request_string('h-captcha-response');
    131131
    132 //  $curl = curl_init('https://www.google.com/recaptcha/api/siteverify');
    133 //  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    134 //  curl_setopt($curl, CURLOPT_POST, 1);
    135 //  curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    136 //  $response = curl_exec($curl);
    137 //  $response_data = json_decode($response, true);
    138    
    139     $response = wp_remote_post('https://www.google.com/recaptcha/api/siteverify', [
    140             'body' => $post_data
    141     ] );
    142     $response_data = json_decode($response['body'], true);
     132    $curl = curl_init('https://hcaptcha.com/siteverify');
     133    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     134    curl_setopt($curl, CURLOPT_POST, 1);
     135    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
     136    $response = curl_exec($curl);
     137    $response_data = json_decode($response, true);
     138//  $response = wp_remote_post('https://hcaptcha.com/siteverify', [
     139//          'body' => $post_data
     140//  ]);
     141//  $response_data = json_decode($response['body'], true);
    143142   
    144143    /* ***** For Debugging *****
    145144    $curl_error = curl_error($curl);
    146145    if (!empty($curl_error)) {
    147         error_log('otgkofcs_verify_recaptcha Curl Error: ' . print_r($curl_error, true));
     146        error_log('otgkofcs_verify_hcaptcha Curl Error: ' . print_r($curl_error, true));
    148147    }
    149148    $curl_info = curl_getinfo($curl);
    150     error_log('otgkofcs_verify_recaptcha Curl Info: ' . print_r($curl_info, true));
    151     error_log('otgkofcs_verify_recaptcha Response: ' . $response);
    152     error_log('otgkofcs_verify_recaptcha Response Array: ' . print_r($response_data, true));
     149    error_log('otgkofcs_verify_hcaptcha Curl Info: ' . print_r($curl_info, true));
     150    error_log('otgkofcs_verify_hcaptcha Response: ' . $response);
     151    error_log('otgkofcs_verify_hcaptcha Response Array: ' . print_r($response_data, true));
    153152    /**/
    154153
    155     if ('true' == $response_data['success']) {
     154    if ($response_data['success'])
    156155        return true;
    157     } else {
    158         return false;
    159     }
    160    
     156       
     157    return false;
    161158}
  • kofc-state/trunk/helpers/view_helper.php

    r2072874 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2018, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         7/21/2016
    99*/
     
    4444}
    4545
    46 /** Returns a True/False as a Yes/nNo in Color
     46/** Returns a True/False as a Yes/No in Color
    4747 * @param boolean $value
    4848 * @return string
     
    114114    }
    115115}
    116 
    117 /** Creates the HTML for Direction Arrows on Table Headers
    118  * @param string $column
    119  * @param string $order_by
    120  * @param string $order_direction
    121  * @return string
    122  */
    123 function otgkofcs_arrow ($column, $order_by, $order_direction) {
    124     $out = '';
    125     if ($column == $order_by) {
    126         $out .= '&nbsp;<img src="' . plugins_url('images/table_arrow.png', dirname(__FILE__)) . '" class="otgkofcs_arrow_' . strtolower($order_direction) .'"';
    127     }
    128     return $out;
    129 }
  • kofc-state/trunk/kofc-state.css

    r2305173 r2673889  
    44 * @Author          Chris Hood (http://chrishood.me)
    55 * @Link                https://onthegridwebdesign.com
    6  * @copyright       (c) 2016-2020, On the Grid Web Design LLC
     6 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    77 * @created         7/21/2016
    88*/
     
    1616}
    1717
    18 /***** Frontend *****/
     18/***** Public Side *****/
    1919.otgkofcs_table_star_scores_header {
    2020    position: sticky;
     
    161161.otgkofcs_listing_page {
    162162    max-width: 1400px;
    163     margin: 17px auto 0;
     163    margin: 42px auto 0;
    164164    text-align: center;
    165165}
     
    290290}
    291291
    292 .otgkofcs_arrow_asc, .otgkofcs_arrow_desc {
    293     width: 12px;
    294     margin-left: 5px;
    295 }
    296 .otgkofcs_arrow_desc {
    297     transform: rotate(180deg);;
    298 }
    299 
    300292.otgkofcs_box_shadow {
    301293    box-shadow: 3px 3px 3px #777;
     
    426418        text-align: left;
    427419    }
    428     .otgkofcs_form1 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]), .form1 select, .form1 textarea,
     420    .otgkofcs_form1 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]), .otgkofcs_form1 select, .otgkofcs_form1 textarea,
    429421    .otgkofcs_form1 .otgkofcs_full select,
    430422    .otgkofcs_form1 .otgkofcs_full input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
     
    477469    width: calc(100% - 52px);
    478470}
     471
     472/*** Datatables ***/
     473.otgkofcs_table1 {
     474    margin: 7px 10px 12px;
     475    border-collapse: collapse;
     476}
     477
     478.otgkofcs_table1 thead {
     479    background-color: #4c4c4c;
     480    background: linear-gradient(to bottom,  #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);
     481    text-align: center;
     482    color: #eee;
     483}
     484.otgkofcs_table1 th {
     485    padding: 6px 12px;
     486}
     487.otgkofcs_table1 th a {
     488    color: #fff;
     489}
     490
     491.otgkofcs_table1 td {
     492    margin: 0;
     493    padding: 5px 12px;
     494    text-align: center;
     495}
     496.otgkofcs_table1 .even {
     497    background-color: #aaa;
     498}
     499.otgkofcs_table1 .odd {
     500    background-color: #ddd;
     501}
     502.otgkofcs_table1 .odd:hover, .table1 .even:hover {
     503    background: #fff;
     504}
     505.dataTables_filter {
     506    margin-bottom: 7px;
     507}
     508.dataTables_filter input {
     509    background-color: white !important;
     510}
     511.dataTables_length select {
     512    min-width: 75px;
     513    background-color: white !important;
     514}
  • kofc-state/trunk/kofc-state.js

    r2072874 r2673889  
    44 * @Author          Chris Hood (http://chrishood.me)
    55 * @Link                http://onthegridwebdesign.com
    6  * @copyright       (c) 2016-2019, On the Grid Web Design LLC
     6 * @copyright       (c) 2016-2021, On the Grid Web Design LLC
    77 * @created         7/21/2016
    88*/
     
    4949}
    5050
    51 /** Turns On Submit Button if the Recaptcha is Good
     51/** Turns On Submit Button if the hCaptcha is Good
    5252 */
    53 function otgkofcs_recaptcha_good () {
     53function otgkofcs_hcaptcha_good () {
    5454    jQuery('#otgkofcs_submit_button').prop('disabled', false);
    5555}
  • kofc-state/trunk/kofc-state.min.css

    r2305173 r2673889  
    1 .otgkofcs_box_shadow{box-shadow:3px 3px 3px #777}.otgkofcs_large_text{font-size:1.2em}.otgkofcs_table_star_scores_header{position:sticky;z-index:9999;width:auto!important;margin:0 0 0 12px!important;border-collapse:collapse!important;border:none!important}.otgkofcs_table_star_scores_header th{height:133px!important;width:60px!important;position:relative;vertical-align:bottom;padding:0!important;font-size:12px;line-height:1.0}.wp-admin .otgkofcs_table_star_scores_header tr{background:#f1f1f1}.otgkofcs_table_star_scores_header th>div{position:relative;top:0;left:66.5px;height:100%;-ms-transform:skew(-45deg,0deg);-moz-transform:skew(-45deg,0deg);-webkit-transform:skew(-45deg,0deg);-o-transform:skew(-45deg,0deg);transform:skew(-45deg,0deg);overflow:hidden;border-left:1px solid #ddd;border-right:1px solid #ddd;border-top:1px solid #ddd;background:lightgrey}.otgkofcs_table_star_scores_header th span{display:inline-block;position:absolute;bottom:55px;left:-45px;width:146px;transform:skew(45deg,0deg) rotate(315deg);text-align:left}.otgkofcs_table_star_scores{width:auto!important;margin:0 0 7px 12px!important;border-collapse:collapse}.otgkofcs_table_star_scores tr{padding:0!important}.otgkofcs_table_star_scores>tbody>:nth-child(even){background:#eee}.otgkofcs_table_star_scores td{box-sizing:border-box;width:60px!important;padding:6px 0!important;border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #ddd;vertical-align:middle;text-align:center}@media screen and (max-width:980px){.otgkofcs_table_star_scores_header{top:0!important}}@media screen and (max-width:700px){.otgkofcs_table_star_scores_header,.otgkofcs_table_star_scores{margin:0!important}.otgkofcs_table_star_scores_header th{height:170px!important}.otgkofcs_table_star_scores_header th>div{top:0;left:0;-ms-transform:none;-moz-transform:none;-webkit-transform:none;-o-transform:none;transform:none}.otgkofcs_table_star_scores_header th span{bottom:70px;transform:skew(0deg,0deg) rotate(270deg)}}.otgkofcs_box_list div{box-sizing:border-box;vertical-align:top;display:inline-block;width:320px;height:230px;margin:9px;padding:0;box-shadow:0 0 7px #000;background-size:cover;border-radius:7px;border:1px solid #333}.otgkofcs_box_list a{display:inline-block;width:100%;height:230px;padding:9px;border-radius:7px;background:rgba(0,0,0,.6);text-align:center;color:#d0d0d0;font-weight:bold;text-shadow:2px 2px 2px #000}.otgkofcs_box_list div:hover{box-shadow:0 0 12px #000}.otgkofcs_box_list a:hover{text-decoration:none!important;color:#fff}.otgkofcs_box_list_line1{margin:0;padding:0 0 5px!important;font-size:22px}.otgkofcs_box_list_line2{margin:0;padding:0 0 12px!important;font-size:19px}.otgkofcs_listing_page{max-width:1400px;margin:17px auto 0;text-align:center}.otgkofcs_listing_page_main{display:inline-block;vertical-align:top;width:59%;min-width:250px;text-align:left}.otgkofcs_listing_page_sidebar{display:inline-block;vertical-align:top;width:29%;min-width:200px;margin:0 0 0 2%;text-align:left}.otgkofcs_listing_page_sidebar>div{width:100%;margin:0 0 21px;padding:9px;border-radius:7px;background-color:rgba(200,200,200,0.9);box-shadow:4px 4px 4px #333}@media screen and (max-width:550px){.otgkofcs_listing_page_main{display:block;width:100%}.otgkofcs_listing_page_sidebar{width:100%;max-width:350px;margin:12px auto 7px}}.otgkofcs_textbox2{margin:0 0 21px;padding:12px;border-radius:7px;background-color:rgba(0,0,0,.83);box-shadow:4px 4px 4px #333;text-shadow:1px 1px 1px black;font-size:1.2em;color:#eaeaea;overflow:overlay}.otgkofcs_textbox2 h2,.otgkofcs_textbox2 h3{margin-bottom:17px;color:white}.otgkofcs_textbox2 a{color:white}@media screen and (max-width:550px){.otgkofcs_textbox2{padding:9px 0}.otgkofcs_textbox2 h2,.otgkofcs_textbox2 h3{padding-left:9px}.otgkofcs_textbox2 .wp-post-image{float:none;display:block;margin:1px auto 4px}.otgkofcs_textbox2 p{padding-left:5px;padding-right:5px}}.otgkofcs_council_page_icon{width:32px;height:32px;margin-left:12px}.otgkofcs_knight_profile_img{display:block;margin:3px auto 7px;box-shadow:3px 3px 3px #333}.otgkofcs_knight_social_link{vertical-align:top;line-height:20px;font-size:16px}.otgkofcs_knight_social_icon{width:20px;height:20px;margin-right:12px}.otgkofcs_success,.otgkofcs_error,.otgkofcs_warning,.otgkofcs_message{display:block;margin:12px -10px;padding:7px 35px;color:#111;font-weight:bold}.otgkofcs_success{background-color:#5e5;border-bottom:solid 2px #070}.otgkofcs_error{background-color:#e55;border-bottom:solid 2px #700}.otgkofcs_warning{background-color:#ee5;border-bottom:solid 2px #770}.otgkofcs_message{background-color:#55e;border-bottom:solid 2px #007;color:#f6f6f6}.otgkofcs_arrow_asc,.otgkofcs_arrow_desc{width:12px;margin-left:5px}.otgkofcs_arrow_desc{transform:rotate(180deg)}.otgkofcs_box_shadow{box-shadow:3px 3px 3px #777}section.otgkofcs_admin500{display:inline-block;vertical-align:top;max-width:500px;margin-right:12px}section.otgkofcs_admin700{display:inline-block;vertical-align:top;max-width:700px;margin-right:12px}section.otgkofcs_score_input{box-sizing:border-box;padding:7px 0;column-width:450px}.otgkofcs_score_input_header{overflow-x:hidden;white-space:nowrap}.otgkofcs_score_input_header div{display:inline-block;width:500px}.otgkofcs_column_header1{display:inline-block;width:100px;text-align:center;font-weight:bold}.otgkofcs_form1{box-sizing:border-box}.otgkofcs_form1 p:not(.otgkofcs_full){display:inline-block;width:500px;max-width:100%}.otgkofcs_form1 h3 .button-primary{margin-left:12px!important}.otgkofcs_form1 label{display:inline-block;vertical-align:top;width:150px;padding:0 6px;text-align:right;font-weight:bold}.otgkofcs_form1 select,.otgkofcs_form1 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]){width:300px;padding:3px 5px;border-radius:3px;background:#ddd}.otgkofcs_form1 input[type=checkbox],.otgkofcs_form1 input[type=radio]{width:17px}.otgkofcs_form1 .otgkofcs_radio_left{width:auto;padding:0 17px 0 0;font-weight:normal}.otgkofcs_form1 .otgkofcs_radio_right{width:auto;padding:0 0 0 17px;font-weight:normal}.otgkofcs_input_small{width:100px!important}.otgkofcs_form1 textarea{width:300px;height:200px;padding:3px 5px;border-radius:3px;background:#ddd}.otgkofcs_form1 .otgkofcs_full select,.otgkofcs_form1 .otgkofcs_full input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form1 .otgkofcs_full textarea{width:450px}.otgkofcs_form1 .otgkofcs_red_x{display:inline-block;width:22px;height:22px;padding:0;background:#b33;border-radius:11px;border:1px groove #000;text-align:center;color:#000;font-size:24px;font-weight:bold;cursor:pointer}.otgkofcs_form1 .ui-state-default{position:relative;overflow:visible}.otgkofcs_form1 .g-recaptcha{padding:0 0 7px 156px}@media screen and (max-width:550px){.otgkofcs_form1 p,.otgkofcs_form1 label{display:block;width:100%;text-align:left}.otgkofcs_form1 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.form1 select,.form1 textarea,.otgkofcs_form1 .otgkofcs_full select,.otgkofcs_form1 .otgkofcs_full input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form1 .otgkofcs_full textarea{display:block;width:100%}.otgkofcs_form1 .g-recaptcha{padding:0 0 7px 0}}.otgkofcs_form1 .ui-icon{display:inline-block}.otgkofcs_form2 select,.otgkofcs_form2 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form2 textarea{display:block;width:100%;margin:21px auto;padding:5px 7px;border-radius:3px;background:#ddd;font-weight:bold;font-size:1.2em}.otgkofcs_form2 textarea{height:200px}.otgkofcs_form2 .g-recaptcha{display:block;width:100%;margin:21px auto}.otgkofcs_form2 input[type=submit]{display:block;width:150px;margin:21px auto;padding:7px 12px;border-radius:3px;font-weight:bold}#otgkofcs_sortable{max-width:600px}#otgkofcs_sortable input{width:calc(100% - 52px)}
     1.otgkofcs_box_shadow{box-shadow:3px 3px 3px #777}.otgkofcs_large_text{font-size:1.2em}.otgkofcs_table_star_scores_header{position:sticky;z-index:9999;width:auto!important;margin:0 0 0 12px!important;border-collapse:collapse!important;border:none!important}.otgkofcs_table_star_scores_header th{height:133px!important;width:60px!important;position:relative;vertical-align:bottom;padding:0!important;font-size:12px;line-height:1.0}.wp-admin .otgkofcs_table_star_scores_header tr{background:#f1f1f1}.otgkofcs_table_star_scores_header th>div{position:relative;top:0;left:66.5px;height:100%;-ms-transform:skew(-45deg,0deg);-moz-transform:skew(-45deg,0deg);-webkit-transform:skew(-45deg,0deg);-o-transform:skew(-45deg,0deg);transform:skew(-45deg,0deg);overflow:hidden;border-left:1px solid #ddd;border-right:1px solid #ddd;border-top:1px solid #ddd;background:lightgrey}.otgkofcs_table_star_scores_header th span{display:inline-block;position:absolute;bottom:55px;left:-45px;width:146px;transform:skew(45deg,0deg) rotate(315deg);text-align:left}.otgkofcs_table_star_scores{width:auto!important;margin:0 0 7px 12px!important;border-collapse:collapse}.otgkofcs_table_star_scores tr{padding:0!important}.otgkofcs_table_star_scores>tbody>:nth-child(even){background:#eee}.otgkofcs_table_star_scores td{box-sizing:border-box;width:60px!important;padding:6px 0!important;border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #ddd;vertical-align:middle;text-align:center}@media screen and (max-width:980px){.otgkofcs_table_star_scores_header{top:0!important}}@media screen and (max-width:700px){.otgkofcs_table_star_scores_header,.otgkofcs_table_star_scores{margin:0!important}.otgkofcs_table_star_scores_header th{height:170px!important}.otgkofcs_table_star_scores_header th>div{top:0;left:0;-ms-transform:none;-moz-transform:none;-webkit-transform:none;-o-transform:none;transform:none}.otgkofcs_table_star_scores_header th span{bottom:70px;transform:skew(0deg,0deg) rotate(270deg)}}.otgkofcs_box_list div{box-sizing:border-box;vertical-align:top;display:inline-block;width:320px;height:230px;margin:9px;padding:0;box-shadow:0 0 7px #000;background-size:cover;border-radius:7px;border:1px solid #333}.otgkofcs_box_list a{display:inline-block;width:100%;height:230px;padding:9px;border-radius:7px;background:rgba(0,0,0,.6);text-align:center;color:#d0d0d0;font-weight:bold;text-shadow:2px 2px 2px #000}.otgkofcs_box_list div:hover{box-shadow:0 0 12px #000}.otgkofcs_box_list a:hover{text-decoration:none!important;color:#fff}.otgkofcs_box_list_line1{margin:0;padding:0 0 5px!important;font-size:22px}.otgkofcs_box_list_line2{margin:0;padding:0 0 12px!important;font-size:19px}.otgkofcs_listing_page{max-width:1400px;margin:42px auto 0;text-align:center}.otgkofcs_listing_page_main{display:inline-block;vertical-align:top;width:59%;min-width:250px;text-align:left}.otgkofcs_listing_page_sidebar{display:inline-block;vertical-align:top;width:29%;min-width:200px;margin:0 0 0 2%;text-align:left}.otgkofcs_listing_page_sidebar>div{width:100%;margin:0 0 21px;padding:9px;border-radius:7px;background-color:rgba(200,200,200,0.9);box-shadow:4px 4px 4px #333}@media screen and (max-width:550px){.otgkofcs_listing_page_main{display:block;width:100%}.otgkofcs_listing_page_sidebar{width:100%;max-width:350px;margin:12px auto 7px}}.otgkofcs_textbox2{margin:0 0 21px;padding:12px;border-radius:7px;background-color:rgba(0,0,0,.83);box-shadow:4px 4px 4px #333;text-shadow:1px 1px 1px black;font-size:1.2em;color:#eaeaea;overflow:overlay}.otgkofcs_textbox2 h2,.otgkofcs_textbox2 h3{margin-bottom:17px;color:white}.otgkofcs_textbox2 a{color:white}@media screen and (max-width:550px){.otgkofcs_textbox2{padding:9px 0}.otgkofcs_textbox2 h2,.otgkofcs_textbox2 h3{padding-left:9px}.otgkofcs_textbox2 .wp-post-image{float:none;display:block;margin:1px auto 4px}.otgkofcs_textbox2 p{padding-left:5px;padding-right:5px}}.otgkofcs_council_page_icon{width:32px;height:32px;margin-left:12px}.otgkofcs_knight_profile_img{display:block;margin:3px auto 7px;box-shadow:3px 3px 3px #333}.otgkofcs_knight_social_link{vertical-align:top;line-height:20px;font-size:16px}.otgkofcs_knight_social_icon{width:20px;height:20px;margin-right:12px}.otgkofcs_success,.otgkofcs_error,.otgkofcs_warning,.otgkofcs_message{display:block;margin:12px -10px;padding:7px 35px;color:#111;font-weight:bold}.otgkofcs_success{background-color:#5e5;border-bottom:solid 2px #070}.otgkofcs_error{background-color:#e55;border-bottom:solid 2px #700}.otgkofcs_warning{background-color:#ee5;border-bottom:solid 2px #770}.otgkofcs_message{background-color:#55e;border-bottom:solid 2px #007;color:#f6f6f6}.otgkofcs_box_shadow{box-shadow:3px 3px 3px #777}section.otgkofcs_admin500{display:inline-block;vertical-align:top;max-width:500px;margin-right:12px}section.otgkofcs_admin700{display:inline-block;vertical-align:top;max-width:700px;margin-right:12px}section.otgkofcs_score_input{box-sizing:border-box;padding:7px 0;column-width:450px}.otgkofcs_score_input_header{overflow-x:hidden;white-space:nowrap}.otgkofcs_score_input_header div{display:inline-block;width:500px}.otgkofcs_column_header1{display:inline-block;width:100px;text-align:center;font-weight:bold}.otgkofcs_form1{box-sizing:border-box}.otgkofcs_form1 p:not(.otgkofcs_full){display:inline-block;width:500px;max-width:100%}.otgkofcs_form1 h3 .button-primary{margin-left:12px!important}.otgkofcs_form1 label{display:inline-block;vertical-align:top;width:150px;padding:0 6px;text-align:right;font-weight:bold}.otgkofcs_form1 select,.otgkofcs_form1 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]){width:300px;padding:3px 5px;border-radius:3px;background:#ddd}.otgkofcs_form1 input[type=checkbox],.otgkofcs_form1 input[type=radio]{width:17px}.otgkofcs_form1 .otgkofcs_radio_left{width:auto;padding:0 17px 0 0;font-weight:normal}.otgkofcs_form1 .otgkofcs_radio_right{width:auto;padding:0 0 0 17px;font-weight:normal}.otgkofcs_input_small{width:100px!important}.otgkofcs_form1 textarea{width:300px;height:200px;padding:3px 5px;border-radius:3px;background:#ddd}.otgkofcs_form1 .otgkofcs_full select,.otgkofcs_form1 .otgkofcs_full input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form1 .otgkofcs_full textarea{width:450px}.otgkofcs_form1 .otgkofcs_red_x{display:inline-block;width:22px;height:22px;padding:0;background:#b33;border-radius:11px;border:1px groove #000;text-align:center;color:#000;font-size:24px;font-weight:bold;cursor:pointer}.otgkofcs_form1 .ui-state-default{position:relative;overflow:visible}.otgkofcs_form1 .g-recaptcha{padding:0 0 7px 156px}@media screen and (max-width:550px){.otgkofcs_form1 p,.otgkofcs_form1 label{display:block;width:100%;text-align:left}.otgkofcs_form1 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form1 select,.otgkofcs_form1 textarea,.otgkofcs_form1 .otgkofcs_full select,.otgkofcs_form1 .otgkofcs_full input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form1 .otgkofcs_full textarea{display:block;width:100%}.otgkofcs_form1 .g-recaptcha{padding:0 0 7px 0}}.otgkofcs_form1 .ui-icon{display:inline-block}.otgkofcs_form2 select,.otgkofcs_form2 input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),.otgkofcs_form2 textarea{display:block;width:100%;margin:21px auto;padding:5px 7px;border-radius:3px;background:#ddd;font-weight:bold;font-size:1.2em}.otgkofcs_form2 textarea{height:200px}.otgkofcs_form2 .g-recaptcha{display:block;width:100%;margin:21px auto}.otgkofcs_form2 input[type=submit]{display:block;width:150px;margin:21px auto;padding:7px 12px;border-radius:3px;font-weight:bold}#otgkofcs_sortable{max-width:600px}#otgkofcs_sortable input{width:calc(100% - 52px)}.otgkofcs_table1{margin:7px 10px 12px;border-collapse:collapse}.otgkofcs_table1 thead{background-color:#4c4c4c;background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);text-align:center;color:#eee}.otgkofcs_table1 th{padding:6px 12px}.otgkofcs_table1 th a{color:#fff}.otgkofcs_table1 td{margin:0;padding:5px 12px;text-align:center}.otgkofcs_table1 .even{background-color:#aaa}.otgkofcs_table1 .odd{background-color:#ddd}.otgkofcs_table1 .odd:hover,.table1 .even:hover{background:#fff}.dataTables_filter{margin-bottom:7px}.dataTables_filter input{background-color:white!important}.dataTables_length select{min-width:75px;background-color:white!important}
  • kofc-state/trunk/kofc-state.min.js

    r2072874 r2673889  
    1 jQuery(document).ready(function(a){a("#bulk-action-selector-top").change(function(b){a("#bulk-action-selector-bottom").val(a("#bulk-action-selector-top").val())});a("#bulk-action-selector-bottom").change(function(b){a("#bulk-action-selector-top").val(a("#bulk-action-selector-bottom").val())});a("#cb-select-all-1").change(function(b){if(a("#cb-select-all-1").prop("checked")){a(".otgkofcs_list_checkbox").prop("checked",true)}else{a(".otgkofcs_list_checkbox").prop("checked",false)}});a("#cb-select-all-2").change(function(b){if(a("#cb-select-all-2").prop("checked")){a(".otgkofcs_list_checkbox").prop("checked",true)}else{a(".otgkofcs_list_checkbox").prop("checked",false)}})});function otgkofcs_delete_something(a,c){var b=confirm("Delete "+c+" and all associated info? Are you sure? (this cannot be undone)");if(b){window.location.href=a}}function otgkofcs_recaptcha_good(){jQuery("#otgkofcs_submit_button").prop("disabled",false)};
     1/*
     2        (c) 2016-2021, On the Grid Web Design LLC
     3 @created           7/21/2016
     4*/
     5jQuery(document).ready(function(a){a("#bulk-action-selector-top").change(function(b){a("#bulk-action-selector-bottom").val(a("#bulk-action-selector-top").val())});a("#bulk-action-selector-bottom").change(function(b){a("#bulk-action-selector-top").val(a("#bulk-action-selector-bottom").val())});a("#cb-select-all-1").change(function(b){a("#cb-select-all-1").prop("checked")?a(".otgkofcs_list_checkbox").prop("checked",!0):a(".otgkofcs_list_checkbox").prop("checked",!1)});a("#cb-select-all-2").change(function(b){a("#cb-select-all-2").prop("checked")?
     6a(".otgkofcs_list_checkbox").prop("checked",!0):a(".otgkofcs_list_checkbox").prop("checked",!1)})});function otgkofcs_delete_something(a,b){confirm("Delete "+b+" and all associated info? Are you sure? (this cannot be undone)")&&(window.location.href=a)}function otgkofcs_hcaptcha_good(){jQuery("#otgkofcs_submit_button").prop("disabled",!1)};
  • kofc-state/trunk/kofc-state.php

    r2305173 r2673889  
    55  Description: Functionality for State Councils Including Recruiting Scoreboards
    66  Author: Chris Hood, On The Grid Web Design LLC
    7   Version: 2.3
     7  Version: 2.4
    88  Author URI: http://chrishood.me
    9   Updated: 5/14/2020 Created: 7/21/2016
     9  Updated: 2/6/2022 Created: 7/21/2016
    1010 */
    1111
     
    2929// ***** Custom Post Types *****
    3030require_once($otgkofcs_root_path . 'type-council.php');
    31 $otgkofcs_Councils = new otgkofcs_Council_Type();
     31$otgkofcs_Council = new otgkofcs_Council_Type();
    3232require_once($otgkofcs_root_path . 'type-knight.php');
    3333$otgkofcs_Knight = new otgkofcs_Knight_Type();
     
    158158        ) $charset_collate;";
    159159    dbDelta($sql_messages);
    160    
    161160}
     161
     162/**
     163 * @param string $message
     164 * @param array $arr
     165 */
     166function otg_log ($message, $arr = null) {
     167    $out = '';
     168    if (is_array($arr))
     169        $out = print_r($out, true);
     170    error_log('[' . date('Y-m-d H:i:s') . "] $message $out\n", 3, WP_CONTENT_DIR . '/debug.log');
     171}
  • kofc-state/trunk/models/messages_model.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2018, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         4/11/2018
    99*/
    1010class otgkofcs_Messages_Model {
    1111
    12     /** Gets a List of the Messages
    13      * @global type $wpdb
     12    /** Gets a List of the Messages  *
     13     * @global wpdb $wpdb
    1414     * @global array $otgkofcs_tables
    15      * @param int $page
    16      * @param int $per_page
    17      * @param string $order_by
    18      * @param string $order_direction
    1915     * @return array
    2016     */
    21     function get_list ($page=1, $per_page=25, $order_by='date', $order_direction='ASC') {
     17    function get_list () {
    2218        global $wpdb, $otgkofcs_tables;
    2319        $posts_table = $wpdb->prefix . 'posts';
    24 
    25         // ***** Query Security *****
    26         $per_page = (int)$per_page;
    27         if ('asc' != strtolower($order_direction)) $order_direction = 'DESC';
    2820       
    29         if ('to' == $order_by) {
    30             $order_by = $posts_table . '.post_title';
    31         } elseif (!in_array($order_by, ['message_id', 'name', 'email', 'subject'])) {
    32             $order_by = 'date';
    33         }
    34 
    35         // ***** Get Number of Results and Calculate Number of Pages *****
    36         $a = $wpdb->get_row("SELECT COUNT(*) FROM {$otgkofcs_tables['messages']}", ARRAY_N);
    37         $result['number'] = $a[0];
    38         $result['pages'] = ceil($result['number']/$per_page);
    39        
    40         $sql = "SELECT {$otgkofcs_tables['messages']}.message_id,  $posts_table.post_title AS `to`, {$otgkofcs_tables['messages']}.name, {$otgkofcs_tables['messages']}.email, {$otgkofcs_tables['messages']}.date, {$otgkofcs_tables['messages']}.subject FROM {$otgkofcs_tables['messages']} JOIN $posts_table ON $posts_table.ID = {$otgkofcs_tables['messages']}.to_id
    41             ORDER BY $order_by $order_direction LIMIT $per_page OFFSET " . ((int)$page-1)*$per_page;
    42         $result['list'] = stripslashes_deep($wpdb->get_results($sql, ARRAY_A));
    43 
    44         return $result;
     21        $sql = "SELECT {$otgkofcs_tables['messages']}.message_id,  $posts_table.post_title AS `to`, {$otgkofcs_tables['messages']}.name, {$otgkofcs_tables['messages']}.email, {$otgkofcs_tables['messages']}.date, {$otgkofcs_tables['messages']}.subject"
     22        . " FROM {$otgkofcs_tables['messages']} JOIN $posts_table ON $posts_table.ID = {$otgkofcs_tables['messages']}.to_id";
     23        return stripslashes_deep($wpdb->get_results($sql, ARRAY_A));
    4524    }
    4625   
     
    8463        global $wpdb, $otgkofcs_tables;
    8564        $result = $wpdb->delete($otgkofcs_tables['messages'], ['message_id' => $id], ['%d']);
    86         if (false === $result || 0 == $result)
    87                 return false;
     65        if (empty($result))
     66            return false;
    8867        else
    8968            return true;
  • kofc-state/trunk/models/recruiting_model.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2018, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         7/21/2016
    99*/
     
    1414     * @global type $wpdb
    1515     * @global array $otgkofcs_tables
    16      * @param int $page
    17      * @param int $per_page
    18      * @param string $order_by
    19      * @param string $order_direction
    20      * @param int $active_status
    2116     * @return array
    2217     */
    23     function knights_list ($page=1, $per_page=25, $order_by='name_first', $order_direction='ASC') {
     18    function knights_list () {
    2419        global $wpdb, $otgkofcs_tables;
    2520
    26         // ***** Query Security *****
    27         if ('asc' != strtolower($order_direction)) $order_direction = 'desc';
    28         if (!in_array($order_by, array('name_first', 'name_last', 'council_id', 'score'))) $order_by = 'name_first';
    29 
    30        
    31         // ***** Get Number of Results and Calculate Number of Pages *****
    32         $a = $wpdb->get_row("SELECT COUNT(*) FROM {$otgkofcs_tables['knights']}", ARRAY_N);
    33         $result['number'] = $a[0];
    34         $result['pages'] = ceil($result['number']/$per_page);
    35        
    36         $sql = "SELECT * FROM {$otgkofcs_tables['knights']}
    37             ORDER BY $order_by $order_direction LIMIT $per_page OFFSET " . ($page-1)*$per_page;
    38         $result['list'] = stripslashes_deep($wpdb->get_results($sql, ARRAY_A));
    39 
    40         return $result;
     21        $sql = "SELECT * FROM {$otgkofcs_tables['knights']}";
     22        return stripslashes_deep($wpdb->get_results($sql, ARRAY_A));
    4123    }
    4224   
     
    139121    function knight_delete ($id) {
    140122        global $wpdb, $otgkofcs_tables;
    141         $wpdb->delete($otgkofcs_tables['knights'], ['knight_id' => $id], ['%d']);
    142         $wpdb->delete($otgkofcs_tables['knight_scores'], ['knight_id' => $id], ['%d']);
     123        return $wpdb->delete($otgkofcs_tables['knights'], ['knight_id' => $id], ['%d']);
    143124    }
    144 
    145125   
    146126}
  • kofc-state/trunk/models/scores_model.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2018, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         7/24/2016
    99*/
     
    1111class otgkofcs_Scores_Model {
    1212
    13     /** Gets a List of all Knight Scores
    14      * @global wpdb $wpdb
    15      * @global array $otgkofcs_tables
    16      * @param string $order_by
    17      * @param string $order_direction
    18      * @return array
    19      */
    20     function knight_scores ($order_by='name_last', $order_direction='ASC') {
    21         global $wpdb, $otgkofcs_tables;
    22 
    23         // ***** Query Security *****
    24         if ('ASC' != $order_direction)
    25             $order_direction = 'DESC';
    26         if (!in_array($order_by, array('name_first', 'name_last', 'council_id', 'score'))) $order_by = 'name_last';
    27         $order = "$order_by $order_direction";
    28        
    29         // ***** Query *****
    30         $sql = "SELECT knight_id, name_first, name_last, council_id, score FROM {$otgkofcs_tables['knights']} ORDER BY $order";
    31         return stripslashes_deep($wpdb->get_results($sql, ARRAY_A));
    32     }
    33    
    3413    /** Query for the Frontend Scores
    3514     * @global wpdb $wpdb
     
    185164        $wpdb->delete($otgkofcs_tables['district_scores'], array('score' => 0, 'deputy' => ''));
    186165    }
    187 
    188166   
    189167}
  • kofc-state/trunk/readme.txt

    r2572074 r2673889  
    44Tags: knights of columbus, widget, shortcode
    55Requires at least: 4.0
    6 Tested up to: 5.8
     6Tested up to: 5.4
    77Requires PHP: 5.6
    88Stable tag: 2.3
     
    7474
    7575== Changelog ==
     76= 2.4 =
     772022-02-06
     78Replaced reCaptcha with hCaptcha
     79Added assembly to council.
     80Changed lists to use datatableds (except post types). Also merged setting knights scores into the knights list (non-post type).
     81
    7682= 2.3 =
    77832020-05-14
  • kofc-state/trunk/shortcodes.php

    r2305173 r2673889  
    1515 */
    1616function otgkofcs_scoreboard ($attributes, $content = null) {
    17     global $otgkofcs_Councils;
     17    global $otgkofcs_Council;
    1818    // ***** Load Models, Helpers and Libraries *****
    1919    require_once("models/scores_model.php");
     
    2828    switch ($atts['type']) {
    2929        case 'councils':
    30             $councils_list = $otgkofcs_Councils->get_list();
     30            $councils_list = $otgkofcs_Council->get_list();
    3131            $council_scores = $otgkofcs_Scores_Model->council_scores($order_by='percentage', 'DESC');
    3232            include("views/scoreboard_councils.php");
     
    5252 */
    5353function otgkofcs_star_reqs ($attributes, $content = null) {
    54     global $otgkofcs_Councils;
     54    global $otgkofcs_Council;
    5555    // ***** Load Models, Helpers and Libraries *****
    5656    require_once("models/star_model.php");
     
    6363    $star_reqs_list = $otgkofcs_Star_Model->star_reqs_list();
    6464    $star_reqs_met_list = $otgkofcs_Star_Model->star_reqs_met_list();
    65     $councils_list = $otgkofcs_Councils->get_list();
     65    $councils_list = $otgkofcs_Council->get_list();
    6666   
    6767    ob_start();
     
    7373
    7474/** Creates the Council Directory Table
    75  * @global otgkofcs_Council_Type $otgkofcs_Councils
     75 * @global otgkofcs_Council_Type $otgkofcs_Council
    7676 * @param array $attributes
    7777 * @param string $content
     
    8484   
    8585    // ***** Get Data *****
    86     global $otgkofcs_Councils;
    87     $councils_list = $otgkofcs_Councils->get_list();
     86    global $otgkofcs_Council;
     87    $councils_list = $otgkofcs_Council->get_list();
    8888   
    8989    // ***** Generate Output *****
     
    139139
    140140/** Creates the Council Directory Boxed List
    141  * @global otgkofcs_Council_Type $otgkofcs_Councils
     141 * @global otgkofcs_Council_Type $otgkofcs_Council
    142142 * @param array $attributes
    143143 * @param string $content
     
    145145 */
    146146function otgkofcs_council_box_list ($attributes, $content = null) {
    147     global $otgkofcs_Councils;
    148     $councils_list = $otgkofcs_Councils->get_list();
     147    global $otgkofcs_Council;
     148    $councils_list = $otgkofcs_Council->get_list();
    149149   
    150150    ob_start();
  • kofc-state/trunk/type-assembly.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                https://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2020, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2021, On the Grid Web Design LLC
    88 * @created         03/24/2020
    99 */
     
    317317       
    318318        // ***** Form Valdiation *****
    319         if (!otgkofcs_verify_recaptcha()) {
     319        if (!otgkofcs_verify_hcaptcha())
    320320            return false;
    321         }
     321       
    322322        $post_id = otgkofcs_get_request_int('post_id');
    323323        $name = otgkofcs_get_request_string('name');
  • kofc-state/trunk/type-council.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                https://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2020, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         2/14/2018
    99 */
     
    9090        $charter_date = get_post_meta($post->ID, '$charter_date', true);
    9191        $website = get_post_meta($post->ID, 'website', true);
     92        $rss_url = get_post_meta($post->ID, 'rss_url', true);
    9293        $contact_email = get_post_meta($post->ID, 'contact_email', true);
    9394        $facebook = get_post_meta($post->ID, 'facebook', true);
     
    144145
    145146            <p>
     147                <label>RSS Feed URL</label>
     148                <input type="text" name="otgkofcs_rss_url" value="<?= $rss_url ?>" maxlength="200">
     149            </p>
     150
     151            <p>
    146152                <label>Contact Email</label>
    147153                <input type="email" name="otgkofcs_contact_email" value="<?= $contact_email ?>" maxlength="200">
     
    183189        }
    184190
    185         $text_field_list = ['name', 'location', 'website', 'contact_email', 'grand_knight', 'district', 'assembly', 'charter_date', 'facebook', 'twitter', 'instagram'];
     191        $text_field_list = ['name', 'location', 'website', 'rss_url', 'contact_email', 'grand_knight', 'district', 'assembly', 'charter_date', 'facebook', 'twitter', 'instagram'];
    186192        foreach ($text_field_list as $field_name) {
    187193            if (isset($_REQUEST['otgkofcs_' . $field_name])) {
     
    312318       
    313319        // ***** Form Valdiation *****
    314         if (!otgkofcs_verify_recaptcha()) {
     320        if (!otgkofcs_verify_hcaptcha())
    315321            return false;
    316         }
     322       
    317323        $post_id = otgkofcs_get_request_int('post_id');
    318324        $name = otgkofcs_get_request_string('name');
  • kofc-state/trunk/type-knight.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2018, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2021, On the Grid Web Design LLC
    88 * @created         4/30/2018
    99 */
     
    278278       
    279279        // ***** Form Valdiation *****
    280         if (!otgkofcs_verify_recaptcha()) {
     280        if (!otgkofcs_verify_hcaptcha())
    281281            return false;
    282         }
     282       
    283283        $post_id = otgkofcs_get_request_int('post_id');
    284284        $name = otgkofcs_get_request_string('name');
  • kofc-state/trunk/views/admin/knight_edit.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2019, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         7/23/16
    99*/
     
    4444        <p style="text-align: center;">
    4545            <input type="submit" class="button-primary" value="Save">
    46             <a href="admin.php?page=kofc-state-knights" class="button-primary" style="margin-left: 17px;">Back to List</a>
     46            <a href="admin.php?page=kofc-state" class="button-primary" style="margin-left: 17px;">Back to List</a>
    4747        </p>
    4848    </form>
  • kofc-state/trunk/views/admin/knights_list.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2019, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         7/21/16
    99*/
    1010?>
    11 
     11<script>
     12jQuery(document).ready(function () {
     13    var tableData = [
     14<?php if (!empty($knights_list)) foreach ($knights_list as $knight) {?>
     15        [
     16            '<input type="checkbox" name="bulk_action_list[]" value="<?= $knight['knight_id'] ?>" class="otgkofcs_list_checkbox">',
     17            '<a href="admin.php?page=kofc-state-knight-edit&knight_id=<?= $knight['knight_id'] ?>" class="row-title"><?= htmlentities($knight['name_first'], ENT_QUOTES) ?></a>',
     18            '<a href="admin.php?page=kofc-state-knight-edit&knight_id=<?= $knight['knight_id'] ?>" class="row-title"><?= htmlentities($knight['name_last'], ENT_QUOTES) ?></a>',
     19            '<?= $knight['council_id'] ?>',
     20            '<?= $knight['score'] ?>',
     21            '<input type="number" name="score[<?= $knight['knight_id'] ?>]" min="0" class="otgkofcs_input_small">'
     22        ],
     23<?php } ?>
     24    ];
     25    jQuery('#table').DataTable( {
     26        data: tableData,
     27        autoWidth: false,
     28        pageLength: 25,
     29        stateSave: true,
     30        columnDefs: [
     31            {orderable: false, targets: [0, 5]}
     32        ]
     33    });
     34});
     35</script>
    1236<div class="wrap">
    1337    <h2>KofC Scoreboards: Knights List &nbsp; <a href="admin.php?page=kofc-state-knight-edit" class="add-new-h2">Add New</a></h2>
    1438    <?php otgkofcs_display_messages2($message_list); ?>
    1539
    16     <?php if (0 < $result['number']) { ?>
     40    <?php if (!empty($knights_list)) { ?>
    1741    <form method="post">
    1842        <?php wp_nonce_field('knights_list'); ?>
    1943       
    2044        <div class="tablenav">
    21             <select name='action' id='bulk-action-selector-top'>
    22                 <option value='-1' selected='selected'>Bulk Actions</option>
    23                 <option value='delete'>Delete</option>
     45            <select name="action" id="bulk-action-selector-top">
     46                <option value="score" selected="selected">Update Scores</option>
     47                <option value="delete">Delete</option>
    2448            </select>
    2549            <input type="submit" id="doaction" class="button action" value="Apply">
    26            
    27             <div class="tablenav-pages">
    28                 <span class="displaying-num"><?= $result['number'] ?> items</span>
    29 <?php if (1 < $result['pages']) { ?>           
    30                 <span class="pagination-links">
    31 <?php
    32 $prev_page = $page-1;
    33 if (1 > $prev_page) $prev_page = 1;
    34 $next_page = $page+1;
    35 if ($result['pages'] <= $page) $next_page = $result['pages'];
    36 ?>
    37                     <a class="first-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the first page" href="admin.php?page=kofc-state-knights&paged=1&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">«</a>
    38                     <a class="prev-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the previous page" href="admin.php?page=kofc-state-knights&paged=<?= $prev_page; ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">‹</a>
    39                     <span class="paging-input"><span class="total-pages"><?= $page ?></span> of <span class="total-pages"><?= $result['pages'] ?></span></span>
    40                     <a class="next-page<?php if ($result['pages'] == $page) echo " disabled"; ?>" title="Go to the next page" href="admin.php?page=kofc-state-knights&paged=<?= $next_page; ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">›</a>
    41                     <a class="last-page<?php if ($result['pages'] == $page) echo " disabled"; ?>" title="Go to the last page" href="admin.php?page=kofc-state-knights&paged=<?= $result['pages'] ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">»</a>
    42                 </span>
    43 <?php } ?>
    44             </div>
    45            
    46            
    4750        </div>
    48         <table class="wp-list-table widefat fixed striped posts">
     51        <table id="table" class="otgkofcs_table1">
    4952            <thead><tr>
    50                 <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-1" type="checkbox"></th>
    51                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=name_first&order_direction=<?php if ($order_by == 'name_first' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">First Name</a><?= otgkofcs_arrow('name_first', $order_by, $order_direction) ?></th>
    52                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=name_last&order_direction=<?php if ($order_by == 'name_last' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Last Name</a><?= otgkofcs_arrow('name_last', $order_by, $order_direction) ?></th>
    53                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=council_id&order_direction=<?php if ($order_by == 'council_id' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Council</a><?= otgkofcs_arrow('council_id', $order_by, $order_direction) ?></th>
    54                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=score&order_direction=<?php if ($order_by == 'score' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Score</a><?= otgkofcs_arrow('score', $order_by, $order_direction) ?></th>
     53                <th><input type="checkbox" id="cb-select-all-1"></th>
     54                <th>First Name</th>
     55                <th>Last Name</th>
     56                <th>Council</th>
     57                <th>Score</th>
     58                <th>Update Score</th>
    5559            </tr></thead>
    56         <?php
    57             if (0 != $result['number']) foreach ($result['list'] as $knight) {
    58                 echo '<tr><td><input type="checkbox" name="bulk_action_list[]" value="' . $knight['knight_id'] . '" class="otgkofcs_list_checkbox"></td>';
    59                 echo "<td><a href='admin.php?page=kofc-state-knight-edit&knight_id={$knight['knight_id']}' class='row-title'>" . htmlentities($knight['name_first']) . '</a></td>';
    60                 echo "<td><a href='admin.php?page=kofc-state-knight-edit&knight_id={$knight['knight_id']}' class='row-title'>" . htmlentities($knight['name_last']) . '</a></td>';
    61                 echo "<td>{$knight['council_id']}</td>";
    62                 echo "<td>{$knight['score']}</td>";
    63                 echo '</tr>';
    64             }
    65 
    66         ?>
    67             <tfoot><tr>
    68                 <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-1" type="checkbox"></th>
    69                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=name_first&order_direction=<?php if ($order_by == 'name_first' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">First Name</a><?= otgkofcs_arrow('name_first', $order_by, $order_direction) ?></th>
    70                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=name_last&order_direction=<?php if ($order_by == 'name_last' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Last Name</a><?= otgkofcs_arrow('name_last', $order_by, $order_direction) ?></th>
    71                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=council_id&order_direction=<?php if ($order_by == 'council_id' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Council</a><?= otgkofcs_arrow('council_id', $order_by, $order_direction) ?></th>
    72                 <th><a href="admin.php?page=kofc-state-knights&paged=<?= $page ?>&order_by=score&order_direction=<?php if ($order_by == 'score' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Score</a><?= otgkofcs_arrow('score', $order_by, $order_direction) ?></th>
    73             </tr></tfoot>
    7460        </table>
    75         <div class="tablenav">
    76             <select name='action' id='bulk-action-selector-bottom'>
    77                 <option value='-1' selected='selected'>Bulk Actions</option>
    78                 <option value='delete'>Delete</option>
    79             </select>
    80             <input type="submit" id="doaction" class="button action" value="Apply">
    81 
    82             <div class="tablenav-pages">
    83                 <span class="displaying-num"><?= $result['number'] ?> items</span>
    84 <?php if (1 < $result['pages']) { ?>           
    85                 <span class="pagination-links">
    86 <?php
    87 $prev_page = $page-1;
    88 if (1 > $prev_page) $prev_page = 1;
    89 $next_page = $page+1;
    90 if ($result['pages'] <= $page) $next_page = $result['pages'];
    91 ?>
    92                     <a class="first-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the first page" href="admin.php?page=kofc-state-knights&paged=1&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">«</a>
    93                     <a class="prev-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the previous page" href="admin.php?page=kofc-state-knights&paged=<?= $prev_page ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">‹</a>
    94                     <span class="paging-input"><span class="total-pages"><?= $page ?></span> of <span class="total-pages"><?= $result['pages'] ?></span></span>
    95                     <a class="next-page<?php if ($result['pages'] == $page) echo " disabled" ?>" title="Go to the next page" href="admin.php?page=kofc-state-knights&paged=<?= $next_page ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">›</a>
    96                     <a class="last-page<?php if ($result['pages'] == $page) echo " disabled" ?>" title="Go to the last page" href="admin.php?page=kofc-state-knights&paged=<?= $result['pages'] ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">»</a>
    97                 </span>
    98 <?php } ?>
    99             </div>
    100 
    101         </div>
    102    
    10361    </form>
    10462   
  • kofc-state/trunk/views/admin/messages_list.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2019, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2022, On the Grid Web Design LLC
    88 * @created         4/11/18
    99*/
    1010?>
    11 
     11<script>
     12jQuery(document).ready(function () {
     13    var tableData = [
     14<?php if (!empty($email_list)) foreach ($email_list as $message) {?>
     15        [
     16            '<input type="checkbox" name="bulk_action_list[]" value="<?= $message['message_id'] ?>" class="otgkofcs_list_checkbox">',
     17            '<?= htmlentities($message['to'], ENT_QUOTES) ?>',
     18            '<?= htmlentities($message['date'], ENT_QUOTES) ?>',
     19            '<?= htmlentities($message['name'], ENT_QUOTES) ?>',
     20            '<a href="mailto:<?= $message['email'] ?>"><?= $message['email'] ?></a>',
     21            '<a href="admin.php?page=kofc-state-message-view&message_id=<?= $message['message_id'] ?>"><?= htmlentities($message['subject'], ENT_QUOTES) ?></a>'
     22        ],
     23<?php } ?>
     24    ];
     25    jQuery('#table').DataTable( {
     26        data: tableData,
     27        autoWidth: false,
     28        pageLength: 25,
     29        stateSave: true,
     30        columnDefs: [
     31            {orderable: false, targets: [0]}
     32        ],
     33        order: [[ 2, "desc" ]]
     34    });
     35});
     36</script>
    1237<div class="wrap">
    1338    <h2>KofC State: Messages Sent Via Forms</h2>
    1439    <?php otgkofcs_display_messages2($message_list); ?>
    1540
    16 <?php if (0 < $result['number']) { ?>
     41<?php if (!empty($email_list)) { ?>
    1742    <form method="post">
    1843        <?php wp_nonce_field('messages_list'); ?>
    1944       
    2045        <div class="tablenav">
    21             <select name='action' id='bulk-action-selector-top'>
    22                 <option value='-1' selected='selected'>Bulk Actions</option>
    23                 <option value='delete'>Delete</option>
     46            <select name="action" id="bulk-action-selector-top">
     47                <option value="-1" selected="selected">Bulk Actions</option>
     48                <option value="delete">Delete</option>
    2449            </select>
    2550            <input type="submit" id="doaction" class="button action" value="Apply">
    26            
    27             <div class="tablenav-pages">
    28                 <span class="displaying-num"><?= $result['number'] ?> items</span>
    29     <?php if (1 < $result['pages']) { ?>           
    30                 <span class="pagination-links">
    31     <?php
    32     $prev_page = $page-1;
    33     if (1 > $prev_page) $prev_page = 1;
    34     $next_page = $page+1;
    35     if ($result['pages'] <= $page) $next_page = $result['pages'];
    36     ?>
    37                     <a class="first-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the first page" href="admin.php?page=kofc-state-messages&paged=1&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">«</a>
    38                     <a class="prev-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the previous page" href="admin.php?page=kofc-state-messages&paged=<?= $prev_page; ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">‹</a>
    39                     <span class="paging-input"><span class="total-pages"><?= $page ?></span> of <span class="total-pages"><?= $result['pages'] ?></span></span>
    40                     <a class="next-page<?php if ($result['pages'] == $page) echo " disabled"; ?>" title="Go to the next page" href="admin.php?page=kofc-state-messages&paged=<?= $next_page; ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">›</a>
    41                     <a class="last-page<?php if ($result['pages'] == $page) echo " disabled"; ?>" title="Go to the last page" href="admin.php?page=kofc-state-messages&paged=<?= $result['pages'] ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">»</a>
    42                 </span>
    43     <?php } ?>
    44             </div>
    4551        </div>
    4652
    47         <table class="wp-list-table widefat fixed striped posts">
     53        <table id="table" class="otgkofcs_table1">
    4854            <thead><tr>
    49                 <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-1" type="checkbox" class="otgkofcs_list_checkbox"></th>
    50                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=to&order_direction=<?php if ($order_by == 'to' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">To</a><?= otgkofcs_arrow('to', $order_by, $order_direction) ?></th>
    51                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=date&order_direction=<?php if ($order_by == 'date' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Date</a><?= otgkofcs_arrow('date', $order_by, $order_direction) ?></th>
    52                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=name&order_direction=<?php if ($order_by == 'name' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">From</a><?= otgkofcs_arrow('name', $order_by, $order_direction) ?></th>
    53                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=email&order_direction=<?php if ($order_by == 'email' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Email</a><?= otgkofcs_arrow('email', $order_by, $order_direction) ?></th>
    54                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=subject&order_direction=<?php if ($order_by == 'subject' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Subject</a><?= otgkofcs_arrow('subject', $order_by, $order_direction) ?></th>
     55                <th><input type="checkbox" id="cb-select-all-1"></th>
     56                <th>To</th>
     57                <th>Date</th>
     58                <th>From</th>
     59                <th>Email</th>
     60                <th>Subject</th>
    5561            </tr></thead>
    56            
    57     <?php foreach ($result['list'] as $message) { ?>
    58             <tr><td><input type="checkbox" name="bulk_action_list[]" value="<?= $message['message_id'] ?>" class="otgkofcs_list_checkbox"></td>
    59                 <td><a href='admin.php?page=kofc-state-message-view&message_id=<?= $message['message_id'] ?>' class='row-title'><?= htmlentities($message['to']) ?></a></td>
    60                 <td><a href='admin.php?page=kofc-state-message-view&message_id=<?= $message['message_id'] ?>' class='row-title'><?= htmlentities($message['date']) ?></a></td>
    61                 <td><a href='admin.php?page=kofc-state-message-view&message_id=<?= $message['message_id'] ?>' class='row-title'><?= htmlentities($message['name']) ?></a></td>
    62                 <td><a href="mailto:<?= $message['email'] ?>"><?= $message['email'] ?></a></td>
    63                 <td><a href='admin.php?page=kofc-state-message-view&message_id=<?= $message['message_id'] ?>' class='row-title'><?= htmlentities($message['subject']) ?></a></td>
    64             </tr>
    65     <?php   } ?>
    66            
    67             <tfoot><tr>
    68                 <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-2" type="checkbox" class="otgkofcs_list_checkbox"></th>
    69                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=to&order_direction=<?php if ($order_by == 'to' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">To</a><?= otgkofcs_arrow('to', $order_by, $order_direction) ?></th>
    70                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=date&order_direction=<?php if ($order_by == 'date' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Date</a><?= otgkofcs_arrow('date', $order_by, $order_direction) ?></th>
    71                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=name&order_direction=<?php if ($order_by == 'name' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">From</a><?= otgkofcs_arrow('name', $order_by, $order_direction) ?></th>
    72                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=email&order_direction=<?php if ($order_by == 'email' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Email</a><?= otgkofcs_arrow('email', $order_by, $order_direction) ?></th>
    73                 <th><a href="admin.php?page=kofc-state-messages&paged=<?= $page ?>&order_by=subject&order_direction=<?php if ($order_by == 'subject' && $order_direction=='ASC') echo 'DESC'; else echo 'ASC'; ?>">Subject</a><?= otgkofcs_arrow('subject', $order_by, $order_direction) ?></th>
    74             </tr></tfoot>
    7562        </table>
     63
    7664        <div class="tablenav">
    77             <select name='action' id='bulk-action-selector-bottom'>
    78                 <option value='-1' selected='selected'>Bulk Actions</option>
    79                 <option value='delete'>Delete</option>
     65            <select name="action" id="bulk-action-selector-bottom">
     66                <option value="-1" selected="selected">Bulk Actions</option>
     67                <option value="delete">Delete</option>
    8068            </select>
    8169            <input type="submit" id="doaction" class="button action" value="Apply">
    82 
    83             <div class="tablenav-pages">
    84                 <span class="displaying-num"><?= $result['number'] ?> items</span>
    85     <?php if (1 < $result['pages']) { ?>           
    86                 <span class="pagination-links">
    87     <?php
    88     $prev_page = $page-1;
    89     if (1 > $prev_page) $prev_page = 1;
    90     $next_page = $page+1;
    91     if ($result['pages'] <= $page) $next_page = $result['pages'];
    92     ?>
    93                     <a class="first-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the first page" href="admin.php?page=kofc-state-messages&paged=1&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">«</a>
    94                     <a class="prev-page<?php if (1 == $page) echo " disabled"; ?>" title="Go to the previous page" href="admin.php?page=kofc-state-messages&paged=<?= $prev_page ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">‹</a>
    95                     <span class="paging-input"><span class="total-pages"><?= $page ?></span> of <span class="total-pages"><?= $result['pages'] ?></span></span>
    96                     <a class="next-page<?php if ($result['pages'] == $page) echo " disabled" ?>" title="Go to the next page" href="admin.php?page=kofc-state-messages&paged=<?= $next_page ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">›</a>
    97                     <a class="last-page<?php if ($result['pages'] == $page) echo " disabled" ?>" title="Go to the last page" href="admin.php?page=kofc-state-messages&paged=<?= $result['pages'] ?>&order_by=<?= $order_by ?>&order_direction=<?= $order_direction ?>">»</a>
    98                 </span>
    99     <?php } ?>
    100             </div>
    101 
    10270        </div>
    103    
    10471    </form>
    10572   
  • kofc-state/trunk/views/admin/options.php

    r2305173 r2673889  
    55 * @Author          Chris Hood (http://chrishood.me)
    66 * @Link                http://onthegridwebdesign.com
    7  * @copyright       (c) 2016-2019, On the Grid Web Design LLC
     7 * @copyright       (c) 2016-2021, On the Grid Web Design LLC
    88 * @created         7/23/16
    99*/
     
    3535        </p>
    3636        <p class="otgkofcs_full">
    37             <label for="otgkofcs_recaptcha_public_key">Google reCaptcha Public Key:</label>
    38             <input name="otgkofcs_recaptcha_public_key" value="<?= $options['otgkofcs_recaptcha_public_key'] ?>" type="text" maxlength="200">
     37            <label for="otgkofcs_hcaptcha_site_key">hCaptcha Site Key:</label>
     38            <input name="otgkofcs_hcaptcha_site_key" value="<?= $options['otgkofcs_hcaptcha_site_key'] ?>" type="text" maxlength="200">
    3939        </p>
    4040        <p class="otgkofcs_full">
    41             <label for="otgkofcs_recaptcha_secret_key">Google reCaptcha Secret Key:</label>
    42             <input name="otgkofcs_recaptcha_secret_key" value="<?= $options['otgkofcs_recaptcha_secret_key'] ?>" type="text" maxlength="200">
     41            <label for="otgkofcs_hcaptcha_secret_key">hCaptcha Secret Key:</label>
     42            <input name="otgkofcs_hcaptcha_secret_key" value="<?= $options['otgkofcs_hcaptcha_secret_key'] ?>" type="text" maxlength="200">
    4343        </p>
     44       
     45        <p class="otgkofcs_full"><a href="https://www.hcaptcha.com/" rel="noopener norefferer" target="_blank">Get the hCaptcha Keys</a></p>
     46        <p class="otgkofcs_full">Leave both hCaptcha fields blank to disable it.</p>   
    4447
    4548        <p style="text-align: center;">
  • kofc-state/trunk/views/assembly.php

    r2305173 r2673889  
    11<?php
    22/*  Template Name: Assembly Page */
    3 $otgkofcs_email_sent = false;
    43
    54// ***** Handle Email Form *****
     5$otgkofcs_email_sent = false;
    66if (!empty($_POST['_wpnonce'])) {
    77    $nonce = $_POST['_wpnonce'];
    88    if (wp_verify_nonce($nonce, 'email_assembly')) {
    9         $otgkofcs_email_sent = $otgkofcs_Assemblys->email_assembly_form();
     9        $otgkofcs_email_sent = $otgkofcs_Assembly->email_assembly_form();
    1010    } else {
    11         error_log('kofc_sate->assembly page Bad nonce: ' . $_POST['_wpnonce']);
     11        error_log('kofc_state->assembly page Bad nonce: ' . $nonce);
    1212    }
    1313}
     
    8888        <div class="otgkofcs_textbox2">
    8989            <h3>Email Assembly <?php the_title(); ?></h3>
    90             <script src='https://www.google.com/recaptcha/api.js'></script>
     90            <script src="https://js.hcaptcha.com/1/api.js" async defer></script>
    9191            <form method="post" class="otgkofcs_form2">
    9292                <input type="hidden" name="post_id" value="<?= get_the_ID() ?>">
     
    9696                <input type="subject" name="subject" placeholder="Subject" required>
    9797                <textarea name="message" placeholder="Your Message" required></textarea>
    98                 <div class="g-recaptcha" data-sitekey="<?= get_option('otgkofcs_recaptcha_public_key') ?>" data-callback="otgkofcs_recaptcha_good"></div>
     98                <div class="h-captcha" data-sitekey="<?= get_option('otgkofcs_hcaptcha_site_key') ?>" data-callback="otgkofcs_hcaptcha_good"></div>
    9999                <input id="otgkofcs_submit_button" type="submit" value="Send" disabled>
    100100            </form>
  • kofc-state/trunk/views/council.php

    r2305173 r2673889  
    11<?php
    22/*  Template Name: Council Page */
    3 $otgkofcs_email_sent = false;
    43
    54// ***** Handle Email Form *****
     5$otgkofcs_email_sent = false;
    66if (!empty($_POST['_wpnonce'])) {
    77    $nonce = $_POST['_wpnonce'];
    88    if (wp_verify_nonce($nonce, 'email_council')) {
    9         $otgkofcs_email_sent = $otgkofcs_Councils->email_council_form();
     9        $otgkofcs_email_sent = $otgkofcs_Council->email_council_form();
    1010    } else {
    11         error_log('kofc_sate->council page Bad nonce: ' . $_POST['_wpnonce']); 
     11        error_log('kofc_state->council page Bad nonce: ' . $nonce);
    1212    }
    1313}
    1414
    1515get_header();
    16 $council_list = $otgkofcs_Councils->get_list();
     16$council_list = $otgkofcs_Council->get_list();
     17$rss_data = array();
    1718?>
    1819
     
    2324        the_post();
    2425        $meta = get_post_meta(get_queried_object_id());
     26
     27        if (!empty($meta['rss_url'][0])) {
     28            require_once($otgkofcs_root_path . 'helpers/rss_helper.php');
     29            $rss_data = otgkofcs_get_rss_feed ($meta['rss_url'][0], 5);
     30        }
    2531        ?>
    2632   
     
    6066        <?php } ?>         
    6167
     68        <?php if (!empty($meta['assembly'][0])) { ?>
     69            <p>Assembly:&nbsp;<a href="/assembly/<?= $meta['assembly'][0] ?>">#<?= $meta['assembly'][0] ?></a></p>
     70        <?php } ?>
     71
    6272        <?php if (!empty($meta['website'][0])) { ?>
    6373            <p>Website:&nbsp;<a href="<?= $meta['website'][0] ?>" target="_blank" rel="noopener"><?= htmlentities($meta['website'][0]) ?></a></p>
     
    7181        <div class="otgkofcs_textbox2">
    7282            <h3>Email Council <?php the_title(); ?></h3>
    73             <script src='https://www.google.com/recaptcha/api.js'></script>
     83            <script src="https://js.hcaptcha.com/1/api.js" async defer></script>
    7484            <form method="post" class="otgkofcs_form2">
    7585                <input type="hidden" name="post_id" value="<?= get_the_ID() ?>">
     
    7989                <input type="subject" name="subject" placeholder="Subject" required>
    8090                <textarea name="message" placeholder="Your Message" required></textarea>
    81                 <div class="g-recaptcha" data-sitekey="<?= get_option('otgkofcs_recaptcha_public_key') ?>" data-callback="otgkofcs_recaptcha_good"></div>
     91                <div class="h-captcha" data-sitekey="<?= get_option('otgkofcs_hcaptcha_site_key') ?>" data-callback="otgkofcs_hcaptcha_good"></div>
    8292                <input id="otgkofcs_submit_button" type="submit" value="Send" disabled>
    8393            </form>
     
    103113<?php //***** Side Bar ***** ?>
    104114    <section class="otgkofcs_listing_page_sidebar">
     115<?php if (!empty($rss_data)) { ?>
     116        <div id="meta-2" class="widget_meta"><h4 class="widgettitle">Council News</h4>
     117<?php foreach ($rss_data as $item) { ?>
     118            <p style="padding-bottom: 2px; font-size: 1.2em;">
     119                <a href="<?= $item['link'] ?>" target="_blank" style="color: blue;"><?= $item['date'] ?> - <?= $item['title'] ?></a>
     120            </p>
     121            <p><?= htmlentities(strip_tags($item['description'])) ?></p>
     122<?php } ?>
     123        </div>
     124<?php }  ?>
     125
    105126        <div id="meta-2" class="widget_meta"><h4 class="widgettitle">All Councils</h4> 
    106127<?php if (!empty($council_list)) foreach ($council_list as $council_num => $council) { ?>
     
    108129<?php } ?>
    109130        </div>
     131
    110132<?php if (function_exists('dynamic_sidebar')) dynamic_sidebar('sidebar'); ?>
    111133    </section>
  • kofc-state/trunk/views/knight.php

    r2305173 r2673889  
    99        $otgkofcs_email_sent = $otgkofcs_Knight->email_knight_form();
    1010    } else {
    11         error_log('kofc_sate->knight page Bad nonce: ' . $_POST['_wpnonce']);   
     11        error_log('kofc_state->knight page Bad nonce: ' . $nonce);
    1212    }
    1313}
     
    2828       
    2929        <?php if (!empty($meta['email_address'][0]) && !$otgkofcs_email_sent) { ?>
    30             <script src='https://www.google.com/recaptcha/api.js'></script>
     30            <script src="https://js.hcaptcha.com/1/api.js" async defer></script>
    3131            <form method="post" class="otgkofcs_form2">
    3232                <input type="hidden" name="post_id" value="<?= get_the_ID() ?>">
     
    3636                <input type="subject" name="subject" placeholder="Subject" required>
    3737                <textarea name="message" placeholder="Your Message" required></textarea>
    38                 <div class="g-recaptcha" data-sitekey="<?= get_option('otgkofcs_recaptcha_public_key') ?>" data-callback="otgkofcs_recaptcha_good"></div>
     38                <div class="h-captcha" data-sitekey="<?= get_option('otgkofcs_hcaptcha_site_key') ?>" data-callback="otgkofcs_hcaptcha_good"></div>
    3939                <input id="otgkofcs_submit_button" type="submit" value="Send" disabled>             
    4040            </form>
Note: See TracChangeset for help on using the changeset viewer.