Changeset 966275
- Timestamp:
- 08/15/2014 10:15:37 AM (12 years ago)
- Location:
- ninja-notes/trunk
- Files:
-
- 3 edited
-
ninja-notes.php (modified) (5 diffs)
-
notes.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ninja-notes/trunk/ninja-notes.php
r966246 r966275 2 2 /* 3 3 Plugin Name: Ninja Notes 4 version: 1. 1.34 version: 1.2 5 5 Plugin URI: http://www.code-ninja.co.uk/ 6 6 Description: NOTES App for keeping track of various things … … 41 41 add_action( 'admin_menu', 'nn_add_post_box' ); 42 42 add_action('admin_menu', 'ninjanotes_menu'); 43 add_action("save_post", "nn_save_details" );43 add_action("save_post", "nn_save_details",10,2); 44 44 45 45 46 46 //This function adds the meta baox to the Write Post Screen 47 47 function 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'); 50 50 } 51 51 … … 65 65 }; 66 66 $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'] ) ); 68 68 } 69 69 … … 99 99 <?php 100 100 $res = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."ninjanotes order by `name`"); 101 $nid=get_post_meta( get_the_ID(), 'ninjanotes',true); 101 102 foreach($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>"); 103 106 } 104 107 ?> … … 153 156 $res = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."ninjanotes order by `name`"); 154 157 foreach($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>"); 156 161 } 157 162 ?> -
ninja-notes/trunk/notes.php
r966237 r966275 1 1 <?php 2 /* 3 Plugin Name: Ninja Notes 4 version: 1.2 5 Plugin URI: http://www.code-ninja.co.uk/ 6 Description: NOTES App for keeping track of various things 7 Author: Code Ninja 8 Author URI: http://www.code-ninja.co.uk/ 9 */ 2 10 $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] ); 3 11 require_once( $parse_uri[0] . 'wp-load.php' ); … … 5 13 if($_POST['submit']=="Save"){ 6 14 $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']); 8 16 }elseif($_POST['submit']=="Delete"){ 9 17 $wpdb->query("delete from ".$wpdb->prefix."ninjanotes where `id`='".$_POST['nnselect']."'"); … … 16 24 }else{ 17 25 $res = $wpdb->get_var("SELECT `notes` FROM ".$wpdb->prefix."ninjanotes where `id`='".$_POST['id']."'"); 18 echo( $res);26 echo(stripslashes($res)); 19 27 } 20 28 ?> -
ninja-notes/trunk/readme.txt
r966237 r966275 4 4 Requires at least: 5 5 Tested up to: 3.9.2 6 Stable tag: 1. 1.36 Stable tag: 1.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 Do 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. 15 15 16 It lets you have as many s perate notepads as you want. It's a great way to keep track of things.16 It lets you have as many separate notepads as you want. It's a great way to keep track of things. 17 17 18 18 == Installation == … … 21 21 22 22 == Changelog == 23 1.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 23 25 1.1.3 Fixed bug where notes would sometimes fail to update 24 26
Note: See TracChangeset
for help on using the changeset viewer.