Plugin Directory

Changeset 966275


Ignore:
Timestamp:
08/15/2014 10:15:37 AM (12 years ago)
Author:
Code-Ninja
Message:

Update to Version 1.2

Location:
ninja-notes/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ninja-notes/trunk/ninja-notes.php

    r966246 r966275  
    22/*
    33Plugin Name: Ninja Notes
    4 version: 1.1.3
     4version: 1.2
    55Plugin URI: http://www.code-ninja.co.uk/
    66Description: NOTES App for keeping track of various things
     
    4141add_action( 'admin_menu', 'nn_add_post_box' );
    4242add_action('admin_menu', 'ninjanotes_menu');
    43 add_action("save_post", "nn_save_details");
     43add_action("save_post", "nn_save_details",10,2);
    4444
    4545
    4646//This function adds the  meta baox to the Write Post Screen
    4747function nn_add_post_box() {
    48     add_meta_box('nn_options','Ninja Notes','nn_post_box_content','post','normal','high' );
    49     add_meta_box('nn_options','Ninja Notes','nn_post_box_content','page','normal','high' );
     48    add_meta_box('nn_options','Ninja Notes','nn_post_box_content','post','normal','high');
     49    add_meta_box('nn_options','Ninja Notes','nn_post_box_content','page','normal','high');
    5050}
    5151
     
    6565  };
    6666  $wpdb->update($wpdb->prefix."ninjanotes", array('notes' => $_POST['nnnotes']), array('id' => $_POST['nnselect']),array('%s'));
    67 
     67  update_post_meta( $post_id, 'ninjanotes', sanitize_text_field( $_POST['nnselect'] ) );
    6868}
    6969
     
    9999<?php
    100100$res = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."ninjanotes order by `name`");
     101$nid=get_post_meta( get_the_ID(), 'ninjanotes',true);
    101102foreach($res as $row){
    102 echo("<option value='".$row->id."'>".$row->name."</option>");
     103  echo("<option value='".$row->id."' ");
     104  if($row->id==$nid) echo(" SELECTED ");
     105  echo(">".$row->name."</option>");
    103106}
    104107?>
     
    153156$res = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."ninjanotes order by `name`");
    154157foreach($res as $row){
    155 echo("<option value='".$row->id."'>".$row->name."</option>");
     158  echo("<option value='".$row->id."' ");
     159  if($row->id==$_REQUEST['id']) echo(" SELECTED ");
     160  echo(">".$row->name."</option>");
    156161}
    157162?>
  • ninja-notes/trunk/notes.php

    r966237 r966275  
    11<?php
     2/*
     3Plugin Name: Ninja Notes
     4version: 1.2
     5Plugin URI: http://www.code-ninja.co.uk/
     6Description: NOTES App for keeping track of various things
     7Author: Code Ninja
     8Author URI: http://www.code-ninja.co.uk/
     9*/
    210$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
    311require_once( $parse_uri[0] . 'wp-load.php' );
     
    513if($_POST['submit']=="Save"){
    614    $wpdb->update($wpdb->prefix."ninjanotes", array('notes' => $_POST['nnnotes']), array('id' => $_POST['nnselect']),array('%s'));
    7     header("Location: ". $_SERVER["HTTP_REFERER"]);
     15    header("Location: ". $_SERVER["HTTP_REFERER"]."&id=".$_POST['nnselect']);
    816}elseif($_POST['submit']=="Delete"){
    917    $wpdb->query("delete from ".$wpdb->prefix."ninjanotes where `id`='".$_POST['nnselect']."'");
     
    1624}else{
    1725    $res = $wpdb->get_var("SELECT `notes` FROM ".$wpdb->prefix."ninjanotes where `id`='".$_POST['id']."'");
    18     echo($res);
     26    echo(stripslashes($res));
    1927}
    2028?>
  • ninja-notes/trunk/readme.txt

    r966237 r966275  
    44Requires at least:
    55Tested up to: 3.9.2
    6 Stable tag: 1.1.3
     6Stable tag: 1.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    1414Do you tend to keep all of your notes on a large collection of bits of paper? Would you rather keep them all easily accessable on your Wordpress site, so they are all there to your fingers? Then Ninja-Notes is for you.
    1515
    16 It lets you have as many sperate notepads as you want. It's a great way to keep track of things.
     16It lets you have as many separate notepads as you want. It's a great way to keep track of things.
    1717
    1818== Installation ==
     
    2121
    2222== Changelog ==
     231.2 Version Update to add features requested by kdunham on wordpress. Notes now remember which note you were on when you hit save, or update a post/page. Plus bugfix for erroneous slash issue.
     24
    23251.1.3 Fixed bug where notes would sometimes fail to update
    2426
Note: See TracChangeset for help on using the changeset viewer.