Changeset 2490141
- Timestamp:
- 03/09/2021 02:13:11 AM (4 years ago)
- Location:
- all-in-one-invite-codes
- Files:
-
- 259 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
all-in-one-invite-codes/trunk/all-in-one-invite-codes.php
r2462619 r2490141 5 5 } 6 6 /** 7 * Plugin Name: All in One Invite Codes 8 * Plugin URI: https://themekraft.com/all-in-one-invite-codes/ 9 * Description: Create Invite only Registration Funnels and Products. Boost your site launch and get the attention you desire by creating an intelligent invite only Platform. 10 * Version: 1.0.8 11 * Author: ThemeKraft 12 * Author URI: https://themekraft.com/ 13 * Licence: GPLv3 14 * Network: false 15 * Text Domain: all-in-one-invite-codes 16 * Domain Path: /languages 17 <<<<<<< HEAD 18 ======= 19 * Svn: all-in-one-invite-codes 20 >>>>>>> 3442e020d15fc45f04416b6acacb489fff160bb7 21 * 22 * **************************************************************************** 23 * 24 * This script is free software; you can redistribute it and/or modify 25 * it under the terms of the GNU General Public License as published by 26 * the Free Software Foundation; either version 2 of the License, or 27 * (at your option) any later version. 28 * 29 * This program is distributed in the hope that it will be useful, 30 * but WITHOUT ANY WARRANTY; without even the implied warranty of 31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 32 * GNU General Public License for more details. 33 * 34 * You should have received a copy of the GNU General Public License 35 * along with this program; if not, write to the Free Software 36 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 37 * 38 **************************************************************************** 39 */ 7 * Plugin Name: All in One Invite Codes 8 * Plugin URI: https://themekraft.com/all-in-one-invite-codes/ 9 * Description: Create Invite only Registration Funnels and Products. Boost your site launch and get the attention you desire by creating an intelligent invite only Platform. 10 * Version: 1.0.9 11 * Author: ThemeKraft 12 * Author URI: https://themekraft.com/ 13 * Licence: GPLv3 14 * Network: false 15 * Text Domain: all-in-one-invite-codes 16 * Domain Path: /languages 17 * Svn: all-in-one-invite-codes 18 * 19 * **************************************************************************** 20 * 21 * This script is free software; you can redistribute it and/or modify 22 * it under the terms of the GNU General Public License as published by 23 * the Free Software Foundation; either version 2 of the License, or 24 * (at your option) any later version. 25 * 26 * This program is distributed in the hope that it will be useful, 27 * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 * GNU General Public License for more details. 30 * 31 * You should have received a copy of the GNU General Public License 32 * along with this program; if not, write to the Free Software 33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 34 * 35 **************************************************************************** 36 */ 40 37 if ( !defined( 'ABSPATH' ) ) { 41 38 exit; -
all-in-one-invite-codes/trunk/includes/admin/tree.php
r2381266 r2490141 56 56 $tabs['invite_codes_tree'] = 'Invite Codes Tree'; 57 57 $tabs['invite_codes_user_tree'] = 'User Tree'; 58 $tabs['invite_codes_user_tracker'] = 'User Tracker'; 58 59 59 60 … … 160 161 <?php 161 162 break; 163 case 'invite_codes_user_tracker' : ?> 164 <div class="metabox-holder"> 165 <div class="postbox all_in_one_invite_codes-metabox"> 166 <div class="inside"> 167 <?php 168 add_filter( 'wp_list_pages', 'all_in_one_invite_codes_user_tracker_wp_list_pages_filter', 10, 3 ); 169 add_filter( 'post_type_link', 'all_in_one_invite_codes_list_pages_permalink_filter', 10, 2 ); 170 171 wp_list_pages( array( 172 'post_type' => 'tk_invite_codes', 173 'title_li' => 'User Tracker', 174 'post_status' => 'publish' 175 176 ) ); 177 178 remove_filter( 'wp_list_pages', 'all_in_one_invite_codes_wp_list_pages_filter', 10, 3 ); 179 remove_filter( 'post_type_link', 'all_in_one_invite_codes_list_pages_permalink_filter', 10, 2 ); 180 ?> 181 </div><!-- .inside --> 182 </div><!-- .postbox --> 183 </div><!-- .metabox-holder --> 184 <?php 185 break; 162 186 163 187 default: … … 176 200 return get_edit_post_link( $page->ID ); 177 201 } 178 202 function all_in_one_invite_codes_user_tracker_wp_list_pages_filter($html, $key, $values){ 203 204 echo '<script src="'. TK_ALL_IN_ONE_INVITE_CODES_PLUGIN_URL.'assets/js/datatables.min.js'.'"></script>'; 205 echo '<link rel="stylesheet" href="'. TK_ALL_IN_ONE_INVITE_CODES_PLUGIN_URL.'assets/css/dataTables.min.css'.'"></link>'; 206 $user_tree_data = '['; 207 foreach ( $values as $key => $value ) { 208 $old_title = $value->post_title; 209 210 $values[ $key ] = $value; 211 212 $invite_key = get_post_meta( $value->ID, 'tk_all_in_one_invite_code', true ); 213 $invite_status = get_post_meta( $value->ID, 'tk_all_in_one_invite_code_status', true ); 214 $invite_options = get_post_meta( $value->ID, 'all_in_one_invite_codes_options', true ); 215 216 217 $email = $invite_options['email']; 218 if ( !empty($email)) { 219 220 $invited = get_user_by( 'email', $email ); 221 $inviter = get_user_by( 'ID',$value->post_author ); 222 $invited_by = $inviter->display_name; 223 $invited_user = $invited->display_name ? $invited->display_name : "not registered yet." ; 224 $user_tree_data.= '["'.$invited_by.'","'.$email.' (<b>'.$invited_user.'</b>)"],'; 225 226 } 227 228 //$html = str_replace( $old_title, $new_title, $html ); 229 } 230 $user_tree_data = rtrim($user_tree_data, ','); 231 $user_tree_data.=']'; 232 echo '<table id="tree_user_table" class="display"> 233 <thead> 234 <tr> 235 <th>User</th> 236 <th>Invited</th> 237 </tr> 238 </thead> 239 <tbody> 240 241 </tbody> 242 </table>'; 243 244 echo '</ul>'; 245 echo "<script> jQuery('#tree_user_table');"; 246 echo" jQuery('#tree_user_table').dataTable( {data: ".$user_tree_data."}) "; 247 248 echo "</script>"; 249 250 // return $html; 251 252 } 179 253 180 254 function all_in_one_invite_codes_user_tree_wp_list_pages_filter( $html, $key, $values ) { -
all-in-one-invite-codes/trunk/includes/shortcodes.php
r2462619 r2490141 2 2 3 3 if ( ! defined( 'ABSPATH' ) ) { exit; } 4 5 4 6 5 7 … … 96 98 return $tmp; 97 99 } 100 function all_in_one_invite_codes_invited_by_user($attr){ 101 102 ob_start(); 103 $filter_id = isset($attr['userid']) ? $attr['userid'] : get_current_user_id(); 104 105 $user = get_user_by( 'ID',$filter_id); 106 if ($user->ID){ 107 $email= $user->user_email; 108 $args = array( 109 110 'posts_per_page' => - 1, 111 'post_type' => 'tk_invite_codes', //you can use also 'any' 112 'orderby' => 'post_author', 113 'order' => 'ASC' 114 ); 115 $the_query = new WP_Query( $args ); 116 117 if ( $the_query->have_posts() ) { 118 119 while ( $the_query->have_posts() ) : $the_query->the_post(); 120 $all_in_one_invite_codes_options = get_post_meta( get_the_ID(), 'all_in_one_invite_codes_options', true ); 121 $email_needle = empty( $all_in_one_invite_codes_options['email'] ) ? '' : $all_in_one_invite_codes_options['email']; 122 123 124 if ( $email == $email_needle ) { 125 $author_id = (int)$the_query->post->post_author; 126 $inviter = get_user_by( 'ID',$author_id); 127 $invited_by = $inviter->display_name; 128 $post_date = $the_query->post->post_date; 129 130 $formattedDate = date(DATE_COOKIE , strtotime($post_date)); 131 echo sprintf(__('The user : %s was invited by %s on ','all_in_one_invite_codes'),$user->display_name,$invited_by) .$formattedDate; 132 wp_reset_postdata(); 133 134 $tmp = ob_get_clean(); 135 136 return $tmp; 137 138 } 139 140 141 142 143 endwhile; 144 } 145 echo sprintf(__('The user : %s was not invited by anyone','all_in_one_invite_codes'),$user->display_name); 146 wp_reset_postdata(); 147 148 $tmp = ob_get_clean(); 149 150 return $tmp; 151 } 152 echo __('No user was found with the ID : ','all_in_one_invite_codes').$filter_id; 153 wp_reset_postdata(); 154 155 $tmp = ob_get_clean(); 156 157 return $tmp; 158 159 160 } 98 161 99 162 add_shortcode( 'all_in_one_invite_codes_list_codes_by_user', 'all_in_one_invite_codes_list_codes' ); 163 add_shortcode( 'all_in_one_invite_codes_invited_by_user_filter', 'all_in_one_invite_codes_invited_by_user' ); 164 100 165 101 166 function all_in_one_invite_codes_create( $attr ) { -
all-in-one-invite-codes/trunk/readme.txt
r2462619 r2490141 3 3 Tags: registration, invite only, invite codes 4 4 Requires at least: 4.9 5 Tested up to: 5. 55 Tested up to: 5.7 6 6 Requires PHP: 5.3 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPL 3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 84 84 85 85 == Changelog == 86 = 1.0.9 - 8 Mar 2021 = 87 * Added new feature to trace start to end of the invite codes information. 88 * Added shortcode to tracker who invited user from Front-end. 89 * Tested up with WordPress 5.7 90 86 91 = 1.0.8 - 26 Jan 2021 = 87 92 * Added first styles
Note: See TracChangeset
for help on using the changeset viewer.