Plugin Directory

Changeset 1523540


Ignore:
Timestamp:
10/28/2016 04:20:57 AM (9 years ago)
Author:
chen420
Message:

tagging version 0.2.5

Location:
tinywebdb-api
Files:
2 added
3 edited
6 copied

Legend:

Unmodified
Added
Removed
  • tinywebdb-api/tags/0.2.5/readme.txt

    r1523028 r1523540  
    77Requires at least: 4.0
    88Tested up to: 4.6.1
    9 Stable tag: 0.2.4
     9Stable tag: 0.2.5
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • tinywebdb-api/tags/0.2.5/tinywebdb-api.php

    r1523028 r1523540  
    99Author: Hong Chen
    1010Author URI: http://edu2web.com/tinywebdb-api/
    11 Version: 0.2.4
     11Version: 0.2.5
    1212*/
    1313
    1414
    1515define("TINYWEBDB", "tools.php?page=tinywebdb-api/tinywebdb-api.php");
    16 define("TINYWEBDB_VER", "0.2.4");
     16define("TINYWEBDB_VER", "0.2.5");
    1717
    1818//***** Hooks *****
  • tinywebdb-api/tags/0.2.5/tinywebdb.php

    r1522886 r1523540  
    6565    function wp_tinywebdb_api_get_postid($tagName){
    6666 
     67      $postid = NULL;
     68      $tagName = wp_strip_all_tags($tagName);
    6769        $tagtype = get_option("wp_tinywebdb_api_tag_type");
    6870        if ($tagtype=='') {
     
    124126    public static function storeavalue($tagName, $tagValue) {
    125127 
    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        );
    132142 
    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 {
    137146        $args = array(
    138           'ID'           => wp_strip_all_tags( $postid ),
     147          'ID'           => $postid,
    139148          'post_content' => $tagValue,
    140149        );
  • tinywebdb-api/trunk/readme.txt

    r1523028 r1523540  
    77Requires at least: 4.0
    88Tested up to: 4.6.1
    9 Stable tag: 0.2.4
     9Stable tag: 0.2.5
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • tinywebdb-api/trunk/tinywebdb-api.php

    r1523028 r1523540  
    99Author: Hong Chen
    1010Author URI: http://edu2web.com/tinywebdb-api/
    11 Version: 0.2.4
     11Version: 0.2.5
    1212*/
    1313
    1414
    1515define("TINYWEBDB", "tools.php?page=tinywebdb-api/tinywebdb-api.php");
    16 define("TINYWEBDB_VER", "0.2.4");
     16define("TINYWEBDB_VER", "0.2.5");
    1717
    1818//***** Hooks *****
  • tinywebdb-api/trunk/tinywebdb.php

    r1522886 r1523540  
    6565    function wp_tinywebdb_api_get_postid($tagName){
    6666 
     67      $postid = NULL;
     68      $tagName = wp_strip_all_tags($tagName);
    6769        $tagtype = get_option("wp_tinywebdb_api_tag_type");
    6870        if ($tagtype=='') {
     
    124126    public static function storeavalue($tagName, $tagValue) {
    125127 
    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        );
    132142 
    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 {
    137146        $args = array(
    138           'ID'           => wp_strip_all_tags( $postid ),
     147          'ID'           => $postid,
    139148          'post_content' => $tagValue,
    140149        );
Note: See TracChangeset for help on using the changeset viewer.