Changeset 2163758
- Timestamp:
- 09/26/2019 02:15:37 PM (7 years ago)
- Location:
- team-118group-agent/trunk
- Files:
-
- 7 edited
-
modules/ajax.php (modified) (1 diff)
-
modules/css/admin.css (modified) (1 diff)
-
modules/hooks.php (modified) (1 diff)
-
modules/js/admin.js (modified) (1 diff)
-
modules/settings.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
wp-tga-filter.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
team-118group-agent/trunk/modules/ajax.php
r2148498 r2163758 62 62 } 63 63 64 64 add_action('wp_ajax_archive_redirect', 'wtf_archive_redirect'); 65 add_action('wp_ajax_nopriv_archive_redirect', 'wtf_archive_redirect'); 66 67 function wtf_archive_redirect(){ 68 global $current_user, $wpdb; 69 70 $table_name = 'wtf_404_log'; 71 $table_name = $wpdb->prefix.$table_name; 72 73 $res = $wpdb->update( 74 $table_name, 75 array( 76 'is_archive' => "1" 77 ), 78 array( 79 'id' => sanitize_text_field( $_POST['id'] ) 80 ), 81 array( 82 '%d' 83 ) 84 ); 85 86 if( $res ){ 87 echo json_encode( array( 'result' => 'success' ) ); 88 }else{ 89 echo json_encode( array( 'result' => 'error' ) ); 90 } 91 92 93 die(); 94 } 65 95 66 96 ?> -
team-118group-agent/trunk/modules/css/admin.css
r2148498 r2163758 28 28 z-index: 100000; 29 29 } 30 .is_archived{ 31 display: none; 32 } 33 .is_archived.archived_visible{ 34 display:block; 35 } -
team-118group-agent/trunk/modules/hooks.php
r2161970 r2163758 1 1 <?php 2 2 add_Action('init', 'wtf_init'); 3 function wtf_init(){ 4 global $wpdb; 5 6 $table_name = 'wtf_404_log'; 7 $table_name = $wpdb->prefix.$table_name; 8 9 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS 10 WHERE table_name = '$table_name' AND column_name = 'is_archive'" ); 11 12 if(empty($row)){ 13 $wpdb->query("ALTER TABLE $table_name ADD is_archive mediumint(1) NOT NULL"); 14 } 15 } 3 16 4 17 -
team-118group-agent/trunk/modules/js/admin.js
r2148498 r2163758 93 93 94 94 95 $('body').on( 'click', '.archive_redirect', function( e ){ 96 97 if( !confirm("Are you sure?") ){ 98 return false; 99 } 100 101 // recaptcha validation 102 var id = $(this).attr('data-id'); 103 var pnt = $(this); 104 var data = { 105 id : id, 106 107 action : 'archive_redirect' 108 } 109 jQuery.ajax({url: wtf_local_data.ajaxurl, 110 type: 'POST', 111 data: data, 112 beforeSend: function(msg){ 113 jQuery('body').prepend('<div class="loader"></div>'); 114 }, 115 success: function(msg){ 116 $('.loader').replaceWith(''); 117 118 console.log( msg ); 119 var obj = jQuery.parseJSON( msg ); 120 121 if( obj.result == 'success'){ 122 123 pnt.parents('.row_container').fadeOut(function(){ 124 pnt.parents('.row_container').replaceWith(); 125 }) 126 127 128 } else{ 129 alert('Error'); 130 } 131 132 } , 133 error: function(msg) { 134 135 } 136 }); 95 137 138 }) 96 139 97 140 141 // filterts 142 $('body').on( 'change', '#display_archived', function(){ 143 if( $(this).attr('checked') == 'checked' ){ 144 $('.is_archived').addClass('archived_visible'); 145 }else{ 146 $('.is_archived').removeClass('archived_visible'); 147 } 148 }) 149 150 $('body').on( 'change', '#show_empty_redirects', function(){ 151 $('.single_row').each(function(){ 152 if( $('.redirect_url_field', this).val() != '' ){ 153 $(this).fadeOut(); 154 }else{ 155 $(this).fadeIn(); 156 } 157 }) 158 }) 159 98 160 }); -
team-118group-agent/trunk/modules/settings.php
r2160077 r2163758 104 104 </form> 105 105 <table class="table result_data"> 106 106 <thead> 107 <tr> 108 <td> 109 <div class="row"> 110 <div class="col-6 text-center"> 111 <input class="form-check-input" type="checkbox" value="on" id="display_archived"> 112 <label class="form-check-label" for="defaultCheck1"> 113 Display Archived URLs 114 </label> 115 </div> 116 <div class="col-6 text-center"> 117 <input class="form-check-input" type="checkbox" value="on" id="show_empty_redirects"> 118 <label class="form-check-label" for="defaultCheck1"> 119 Show Empty Redirects 120 </label> 121 </div> 122 </div> 123 124 </td> 125 126 </tr> 127 </thead> 107 128 <tbody> 108 129 '; … … 136 157 } 137 158 </style> 138 <tr >159 <tr class="single_row row_'.$isngle_res->id.' '.( $isngle_res->is_archive == '1' ? ' is_archived ' : '' ).'" > 139 160 <td scope="col"> 140 161 <div class="row_container alert alert-info"> … … 151 172 <b>Redirect To:</b> 152 173 <div class="row"> 153 <div class="col-10"><input value="'.$isngle_res->redirect_url.'" class=" form-control col-12 redirect_url_'.$isngle_res->id.'"/></div> 154 <div class="col-2"><button data-id="'.$isngle_res->id.'" class="btn btn-success btn-sm save_redirect">Save</button> <button data-id="'.$isngle_res->id.'" class="btn btn-danger btn-sm delete_redirect">Delete</button></div> 174 <div class="col-9"><input value="'.$isngle_res->redirect_url.'" class=" form-control col-12 redirect_url_field redirect_url_'.$isngle_res->id.'"/></div> 175 <div class="col-3"> 176 <button data-id="'.$isngle_res->id.'" class="btn btn-success btn-sm save_redirect">Save</button> 177 <button data-id="'.$isngle_res->id.'" class="btn btn-info btn-sm archive_redirect">Archive</button> 178 <button data-id="'.$isngle_res->id.'" class="btn btn-danger btn-sm delete_redirect">Delete</button> 179 </div> 155 180 </div> 156 181 -
team-118group-agent/trunk/readme.txt
r2161970 r2163758 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 Stable tag: 1.5. 410 Version: 1.5. 49 Stable tag: 1.5.5 10 Version: 1.5.5 11 11 12 12 Performs a variety of functions to assist your web designer with wordpress data and system care -
team-118group-agent/trunk/wp-tga-filter.php
r2161970 r2163758 3 3 Plugin Name: Team 118GROUP Agent 4 4 Description: Team 118GROUP Web Design Plugin to assist with monitoring your WordPress installation and assisting with system care 5 Version: 1.5. 45 Version: 1.5.5 6 6 Author: Team118GROUP 7 7 Author URI: http://www.118group.com 8 Stable tag: 1.5. 48 Stable tag: 1.5.5 9 9 */ 10 10 … … 64 64 `timestamp` longtext NOT NULL, 65 65 `redirect_url` longtext NOT NULL, 66 `is_archive` mediumint(1) NOT NULL, 66 67 67 68 UNIQUE KEY `id` (`id`)
Note: See TracChangeset
for help on using the changeset viewer.