Plugin Directory

Changeset 1688489


Ignore:
Timestamp:
06/30/2017 07:10:56 PM (9 years ago)
Author:
datainterlock
Message:

Update to 0.1.4 Hopefully fixing db not updating.

Location:
note-press/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • note-press/trunk/Note_Press.php

    r1688454 r1688489  
    1717 * Plugin URI:        http://www.datainterlock.com
    1818 * Description:       Add, edit and delete multiple notes and display them with icons on the Admin page.
    19  * Version:           0.1.3
     19 * Version:           0.1.4
    2020 * Author:            datainterlock
    2121 * Author URI:        http://www.datainterlock.com
  • note-press/trunk/README.txt

    r1688466 r1688489  
    7676
    7777== Changelog ==
     78= 0.1.4 =
     79Fixed update breaking as a result of the plugin not deactivating during upgrade.
     80
     81== Changelog ==
    7882= 0.1.3 =
    7983*Boilerplate updated.
     
    9094*Fixed column sorting which was broken in 0.1.2 as a result of preparing queries.
    9195
    92 
    9396= 0.1.2 =
    9497*Security update to reduce risk of SQL injection.
  • note-press/trunk/admin/Note_Press-admin-menu.php

    r1688470 r1688489  
    704704        }
    705705    }
    706    
    707 if (get_option("Note_Press_db_version", '2.0') == "1.0")
     706
     707function CheckDB()
    708708{
    709     Note_PressshowMessage(__('Please deactivate and re-activate Note Press to complete the upgrade.', 'Note_Press'), true);
    710     exit;
    711 }   
     709    global $wpdb;
     710    $tablename = $wpdb->prefix . "Note_Press";
     711    $SQL = "SHOW COLUMNS FROM $tablename LIKE 'Priority'";
     712    $wpdb->get_results($SQL);
     713    if ($wpdb->num_rows == 0)
     714    {
     715        Note_PressshowMessage(__('Please deactivate and re-activate Note Press to complete the upgrade.', 'Note_Press'), true);
     716        return true;
     717    }
     718    else
     719    {
     720        return false;
     721    }
     722}
     723
     724if (CheckDB())
     725{
     726    die();
     727}
     728else
     729{
    712730if (isset($_POST['Update']))
    713731    {
     
    782800    Note_Pressget_notes();
    783801    }
     802}
    784803?>
  • note-press/trunk/includes/class-Note_Press-activator.php

    r1688457 r1688489  
    7171        ";
    7272        $wpdb->query($sql);
    73         if (get_option("Note_Press_db_version", '2.0') == "1.0")
     73        $tablename = $wpdb->prefix . "Note_Press";
     74        $SQL = "SHOW COLUMNS FROM $tablename LIKE 'Priority'";
     75        $wpdb->get_results($SQL);
     76        if ($wpdb->num_rows == 0)
    7477            {
    7578            $table_name = $wpdb->prefix . "Note_Press";
Note: See TracChangeset for help on using the changeset viewer.