Support » Plugin: Master Slider - Responsive Touch Slider » How to search and replace

  • Resolved christian-45

    (@christian-45)


    How can I search and replace params in Master Slider? e.g. Strings in Path “2017/12” -> “media7/12” ?
    Slides seams to be Base64 decoded in the Database. I tried to encode with
    update wp_masterslider_sliders set params = FROM_BASE64(params)
    then search and replace and then back with
    update wp_masterslider_sliders set params = TO_BASE64(params)
    But after this, Master Slider do not open the Slides.
    Have anyone an idea for search and replace in Master Slider?
    thanks a lot,
    Bernd

Viewing 1 replies (of 1 total)
  • Thread Starter christian-45

    (@christian-45)

    Solved with php
    <?php
    // Search and Replace in Master Slider params with php
    // Make backup before running the script
    $slider_db= mysqli_query($con1,”SELECT * FROM wp_masterslider_sliders ” );
    while($slider = mysqli_fetch_array($slider_db))
    {
    $params = $slider[“params”];

    $decoded = base64_decode($params); // decode
    $decoded = str_replace(‘2015/’, ‘dir15/’,$decoded); // search and replace
    $encoded_again = base64_encode($decoded); // encode again

    $sqlupdate = “UPDATE wp_masterslider_sliders SET params = ‘”.$encoded_again.”‘ WHERE ID = ” .$slider[“ID”];
    $result_b = mysqli_query($con,$sqlupdate) ;
    }
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘How to search and replace’ is closed to new replies.