Changeset 1523540
- Timestamp:
- 10/28/2016 04:20:57 AM (9 years ago)
- Location:
- tinywebdb-api
- Files:
-
- 2 added
- 3 edited
- 6 copied
-
tags/0.2.5 (copied) (copied from tinywebdb-api/trunk)
-
tags/0.2.5/LICENSE (copied) (copied from tinywebdb-api/trunk/LICENSE)
-
tags/0.2.5/master (added)
-
tags/0.2.5/menus.php (copied) (copied from tinywebdb-api/trunk/menus.php)
-
tags/0.2.5/readme.txt (copied) (copied from tinywebdb-api/trunk/readme.txt) (1 diff)
-
tags/0.2.5/tinywebdb-api.php (copied) (copied from tinywebdb-api/trunk/tinywebdb-api.php) (1 diff)
-
tags/0.2.5/tinywebdb.php (copied) (copied from tinywebdb-api/trunk/tinywebdb.php) (2 diffs)
-
trunk/master (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/tinywebdb-api.php (modified) (1 diff)
-
trunk/tinywebdb.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tinywebdb-api/tags/0.2.5/readme.txt
r1523028 r1523540 7 7 Requires at least: 4.0 8 8 Tested up to: 4.6.1 9 Stable tag: 0.2. 49 Stable tag: 0.2.5 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
tinywebdb-api/tags/0.2.5/tinywebdb-api.php
r1523028 r1523540 9 9 Author: Hong Chen 10 10 Author URI: http://edu2web.com/tinywebdb-api/ 11 Version: 0.2. 411 Version: 0.2.5 12 12 */ 13 13 14 14 15 15 define("TINYWEBDB", "tools.php?page=tinywebdb-api/tinywebdb-api.php"); 16 define("TINYWEBDB_VER", "0.2. 4");16 define("TINYWEBDB_VER", "0.2.5"); 17 17 18 18 //***** Hooks ***** -
tinywebdb-api/tags/0.2.5/tinywebdb.php
r1522886 r1523540 65 65 function wp_tinywebdb_api_get_postid($tagName){ 66 66 67 $postid = NULL; 68 $tagName = wp_strip_all_tags($tagName); 67 69 $tagtype = get_option("wp_tinywebdb_api_tag_type"); 68 70 if ($tagtype=='') { … … 124 126 public static function storeavalue($tagName, $tagValue) { 125 127 126 // Create post object 127 $args = array( 128 'post_title' => wp_strip_all_tags( $tagName ), 129 'post_content' => $tagValue, 130 'post_status' => 'publish', 131 ); 128 $postid = TinyWebDB::wp_tinywebdb_api_get_postid($tagName); 129 $tagValue = stripslashes($tagValue); 130 $tagValue = trim($tagValue, '"'); 131 132 $post = get_post( $postid ); 133 if (empty($post)) { 134 135 // Create post object 136 $args = array( 137 'post_title' => wp_strip_all_tags( $tagName ), 138 'post_name' => wp_strip_all_tags( $tagName ), 139 'post_content' => $tagValue, 140 'post_status' => 'publish', 141 ); 132 142 133 // Insert the post into the database 134 $postid = wp_insert_post( $args ); 135 if ($postid == 0) { 136 $postid = TinyWebDB::wp_tinywebdb_api_get_postid($tagName); 143 // Insert the post into the database 144 $postid = wp_insert_post( $args ); 145 } else { 137 146 $args = array( 138 'ID' => wp_strip_all_tags( $postid ),147 'ID' => $postid, 139 148 'post_content' => $tagValue, 140 149 ); -
tinywebdb-api/trunk/readme.txt
r1523028 r1523540 7 7 Requires at least: 4.0 8 8 Tested up to: 4.6.1 9 Stable tag: 0.2. 49 Stable tag: 0.2.5 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
tinywebdb-api/trunk/tinywebdb-api.php
r1523028 r1523540 9 9 Author: Hong Chen 10 10 Author URI: http://edu2web.com/tinywebdb-api/ 11 Version: 0.2. 411 Version: 0.2.5 12 12 */ 13 13 14 14 15 15 define("TINYWEBDB", "tools.php?page=tinywebdb-api/tinywebdb-api.php"); 16 define("TINYWEBDB_VER", "0.2. 4");16 define("TINYWEBDB_VER", "0.2.5"); 17 17 18 18 //***** Hooks ***** -
tinywebdb-api/trunk/tinywebdb.php
r1522886 r1523540 65 65 function wp_tinywebdb_api_get_postid($tagName){ 66 66 67 $postid = NULL; 68 $tagName = wp_strip_all_tags($tagName); 67 69 $tagtype = get_option("wp_tinywebdb_api_tag_type"); 68 70 if ($tagtype=='') { … … 124 126 public static function storeavalue($tagName, $tagValue) { 125 127 126 // Create post object 127 $args = array( 128 'post_title' => wp_strip_all_tags( $tagName ), 129 'post_content' => $tagValue, 130 'post_status' => 'publish', 131 ); 128 $postid = TinyWebDB::wp_tinywebdb_api_get_postid($tagName); 129 $tagValue = stripslashes($tagValue); 130 $tagValue = trim($tagValue, '"'); 131 132 $post = get_post( $postid ); 133 if (empty($post)) { 134 135 // Create post object 136 $args = array( 137 'post_title' => wp_strip_all_tags( $tagName ), 138 'post_name' => wp_strip_all_tags( $tagName ), 139 'post_content' => $tagValue, 140 'post_status' => 'publish', 141 ); 132 142 133 // Insert the post into the database 134 $postid = wp_insert_post( $args ); 135 if ($postid == 0) { 136 $postid = TinyWebDB::wp_tinywebdb_api_get_postid($tagName); 143 // Insert the post into the database 144 $postid = wp_insert_post( $args ); 145 } else { 137 146 $args = array( 138 'ID' => wp_strip_all_tags( $postid ),147 'ID' => $postid, 139 148 'post_content' => $tagValue, 140 149 );
Note: See TracChangeset
for help on using the changeset viewer.