WordPress.org

Plugin Directory

Changeset 621391


Ignore:
Timestamp:
11/05/12 19:42:43 (18 months ago)
Author:
ramon fincken
Message:

Trunk

Location:
find-replace/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • find-replace/trunk/find_replace.php

    r515539 r621391  
    44Plugin URI: http://www.websitefreelancers.nl 
    55Description: Lets you find and replace pages and posts with a GUI. 
    6 Version: 1.8 
     6Version: 1.9 
    77Author: Ramon Fincken, Bas Bosman 
    88Author URI: http://www.websitefreelancers.nl 
  • find-replace/trunk/form.php

    r515528 r621391  
    4848        $prio           = ($_POST['low_priority'] == 'yes') ? ' LOW_PRIORITY ' : ''; 
    4949 
     50        $tmpquery = str_replace('WHERE','AND',$query); 
     51        $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE .$field LIKE('%s') AND $tmpquery", $search ); 
     52        $found =  intval($wpdb->num_rows); 
     53         
    5054        $updatequery = $wpdb->prepare( "UPDATE ".$prio." $wpdb->posts AS p SET p.".$field." = REPLACE(p.".$field.", '%s', '%s') $query", $search, $replace ); 
    5155 
     
    5660            $field = 'meta_value'; 
    5761 
    58             $updatequery = $wpdb->prepare( "UPDATE ".$prio." $wpdb->postmeta AS pm, $wpdb->posts AS p SET pm.".$field." = REPLACE(pm.".$field.", '%s', '%s') $query AND pm.post_id = p.ID", $search, $replace ); 
    59             $wpdb->query($updatequery); 
     62            $rows_query = $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE .$field LIKE('%s') AND $tmpquery", $search ); 
     63             
     64            $rows = $wpdb->get_results($rows_query); 
     65            $found +=  intval($wpdb->num_rows); 
     66            foreach ($users AS $row) { 
     67                 
     68            } 
     69             
     70            //$updatequery = $wpdb->prepare( "UPDATE ".$prio." $wpdb->postmeta AS pm SET pm.".$field." = REPLACE(pm.".$field.", '%s', '%s') $tmpquery", $search, $replace ); 
     71            //$wpdb->query($updatequery); 
    6072        } 
    6173 
     74         
    6275        if(empty($prio)) 
    6376        { 
     
    6780        { 
    6881            echo '<div id="message" class="updated fade">All instances of \'' . $search . '\' will be replaced with \''. $replace .'\' when server resources are available.</div>'; 
     82        } 
     83        if($found) 
     84        { 
     85            echo '<div id="message" class="updated fade">Rows found: ' . $found . '</div>'; 
    6986        } 
    7087    } 
  • find-replace/trunk/mijnpress_plugin_framework.php

    r514237 r621391  
    5959    var $showcredits = true; 
    6060    var $showcredits_fordevelopers = true; 
    61     var $all_plugins = array('Admin renamer extended','Find replace','Simple add pages or posts','Force apply terms and conditions','GTmetrix website performance','Antispam for all fields','Mass Delete Tags','Auto Prune Posts','Warm cache','See attachments','Automatic Comment Scheduler','Register plus redux export users','Subscribe2 widget','Define Constants','Mass Delete Unused Tags','Prevent core update','WPML flag in menu', 'WPsc MijnPress'); 
     61    var $all_plugins = array('Admin renamer extended','Find replace','Simple add pages or posts','Force apply terms and conditions','GTmetrix website performance','Antispam for all fields','Mass Delete Tags','Auto Prune Posts','Warm cache','See attachments','Automatic Comment Scheduler','Register plus redux export users','Subscribe2 widget','Define Constants','Mass Delete Unused Tags','Prevent core update','WPML flag in menu', 'WPsc MijnPress','Autoptimize admin bar fix'); 
    6262     
    6363    /** 
  • find-replace/trunk/readme.txt

    r515528 r621391  
    44Tags: rename,change,post,page,text,content,context,update,replace,change,server,url,cpt 
    55Requires at least: 2.0.2 
    6 Tested up to: 3.3.1 
    7 Stable tag: 1.8 
     6Tested up to: 3.4.2 
     7Stable tag: 1.9 
    88 
    99Lets you find and replace text in pages, posts, Custom Post types and trashed items with a GUI. 
     
    3333 
    3434== Changelog == 
     35= 1.9 = 
     36Added: Shows rows found and replaced 
     37xx 
     38 
    3539= 1.8 = 
    3640Bugfix: No post type selected error even though i am selecting pages<br> 
Note: See TracChangeset for help on using the changeset viewer.