Plugin Directory

Changeset 2163758


Ignore:
Timestamp:
09/26/2019 02:15:37 PM (7 years ago)
Author:
118group
Message:

v 1.5.5
Added archive and filter funcitonality

Location:
team-118group-agent/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • team-118group-agent/trunk/modules/ajax.php

    r2148498 r2163758  
    6262}
    6363
    64  
     64 add_action('wp_ajax_archive_redirect', 'wtf_archive_redirect');
     65add_action('wp_ajax_nopriv_archive_redirect', 'wtf_archive_redirect');
     66
     67function 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}
    6595
    6696?>
  • team-118group-agent/trunk/modules/css/admin.css

    r2148498 r2163758  
    2828    z-index: 100000;
    2929}
     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  
    11<?php
    2    
     2add_Action('init', 'wtf_init');
     3function 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
     10WHERE 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}
    316 
    417   
  • team-118group-agent/trunk/modules/js/admin.js

    r2148498 r2163758  
    9393
    9494   
     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            });
    95137     
     138    })
    96139   
    97140   
     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   
    98160});
  • team-118group-agent/trunk/modules/settings.php

    r2160077 r2163758  
    104104    </form>
    105105        <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>
    107128          <tbody>
    108129            ';
     
    136157                }
    137158                </style>
    138                 <tr>
     159                <tr  class="single_row row_'.$isngle_res->id.'  '.( $isngle_res->is_archive == '1' ? ' is_archived ' : '' ).'" >
    139160                  <td scope="col">
    140161                    <div class="row_container  alert alert-info">
     
    151172                            <b>Redirect To:</b>
    152173                            <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>&nbsp;<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>&nbsp;
     177                                <button data-id="'.$isngle_res->id.'" class="btn btn-info btn-sm archive_redirect">Archive</button>&nbsp;
     178                                <button data-id="'.$isngle_res->id.'" class="btn btn-danger btn-sm delete_redirect">Delete</button>
     179                                </div>
    155180                            </div>
    156181                           
  • team-118group-agent/trunk/readme.txt

    r2161970 r2163758  
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
    9 Stable tag: 1.5.4
    10 Version: 1.5.4
     9Stable tag: 1.5.5
     10Version: 1.5.5
    1111
    1212Performs 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  
    33Plugin Name: Team 118GROUP Agent
    44Description: Team 118GROUP Web Design Plugin to assist with monitoring your WordPress installation and assisting with system care
    5 Version: 1.5.4
     5Version: 1.5.5
    66Author: Team118GROUP
    77Author URI: http://www.118group.com
    8 Stable tag: 1.5.4
     8Stable tag: 1.5.5
    99*/
    1010
     
    6464  `timestamp` longtext NOT NULL,
    6565  `redirect_url` longtext NOT NULL,
     66  `is_archive` mediumint(1) NOT NULL,
    6667 
    6768  UNIQUE KEY `id` (`id`)
Note: See TracChangeset for help on using the changeset viewer.