Plugin Directory

Changeset 618883


Ignore:
Timestamp:
10/30/2012 03:17:02 AM (13 years ago)
Author:
Codevendor
Message:

Updated database

Location:
token-manager/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • token-manager/trunk/readme.txt

    r604953 r618883  
    66Tags: token, tokens, manager, code, PHP, CSS, javascript, HTML, js, develop, injection, inline
    77Requires at least: 3.0
    8 Tested up to: 3.4.1
    9 Stable tag: 1.0.3
     8Tested up to: 3.4.2
     9Stable tag: 1.0.4
    1010
    1111The Token Manager allows web developers to program PHP, HTML, CSS and JavaScript into tokens that can be used throughout WordPress.
     
    158158
    159159== Changelog ==
     160= 1.0.4 =
     161* Updated database and changed history data type from TEXT to MEDIUMTEXT to allow more token updates than 400+. Added in mysql return errors on update statements.
     162
    160163= 1.0.3 =
    161164* Security update to remove XSS with 'tid' in tokenedit.php and typeedit.php. No other changes, safe to update.
  • token-manager/trunk/token-manager.php

    r604953 r618883  
    55  Description: The Token Manager allows web developers to program PHP, HTML, CSS and JavaScript into tokens that can be used throughout Wordpress.
    66  Author: Codevendor
    7   Version: 1.0.3
     7  Version: 1.0.4
    88  Author URI: http://www.codevendor.com
    99*/ 
     
    3030global $PLUGIN_ICON2;
    3131
    32 $PLUGIN_TM_DB_VERSION = '0.1';
     32$PLUGIN_TM_DB_VERSION = '0.2';
    3333$OPTION_TM_INJECTURL = (get_option('tokenmanager_injecturl', false)==false)?false:true;
    3434$OPTION_TM_DISPLAYERRORS = (get_option('tokenmanager_displayerrors', false)==false)?false:true;
     
    459459          version int(10) unsigned DEFAULT '0' NOT NULL,
    460460          processorder int(0) unsigned DEFAULT '0' NOT NULL,
    461           history text NOT NULL,
     461          history MEDIUMTEXT NOT NULL,
    462462      UNIQUE KEY id (id)
    463463      );";
     
    499499          active tinyint(1) DEFAULT '0' NOT NULL,
    500500          version int(10) unsigned DEFAULT '0' NOT NULL,
    501           history text NOT NULL,
     501          history MEDIUMTEXT NOT NULL,
    502502      UNIQUE KEY id (id)
    503503      );";
     
    558558  }
    559559
    560   public static function tokens(){ include('tokens.php'); }
    561   public static function add(){ include('tokenadd.php'); }
    562   public static function edit(){ include('tokenedit.php'); }
    563   public static function types(){ include('types.php'); }
    564   public static function typeadd(){ include('typeadd.php'); }
    565   public static function typeedit(){ include('typeedit.php'); }
    566   public static function settings(){ include('settings.php'); }
    567   public static function pro(){ include('pro.php'); }
    568   public static function info(){ include('info.php'); }
     560  public static function tokens(){ tokenmanager::create(); include('tokens.php'); }
     561  public static function add(){ tokenmanager::create(); include('tokenadd.php'); }
     562  public static function edit(){ tokenmanager::create(); include('tokenedit.php'); }
     563  public static function types(){ tokenmanager::create(); include('types.php'); }
     564  public static function typeadd(){ tokenmanager::create(); include('typeadd.php'); }
     565  public static function typeedit(){ tokenmanager::create(); include('typeedit.php'); }
     566  public static function settings(){ tokenmanager::create(); include('settings.php'); }
     567  public static function pro(){ tokenmanager::create(); include('pro.php'); }
     568  public static function info(){ tokenmanager::create(); include('info.php'); }
    569569  public static function json(){ global $PLUGIN_TM_JSON_CALL; $PLUGIN_TM_JSON_CALL=true; include('json.php'); }
    570570
  • token-manager/trunk/tokenedit.php

    r604953 r618883  
    8989
    9090          // Setup version
    91           $wpdb->query("INSERT INTO $this->table_tokenversions (id, tokenid, datecreated, lastupdated, siteid, blogid, tokenname,
     91          if($wpdb->query("INSERT INTO $this->table_tokenversions (id, tokenid, datecreated, lastupdated, siteid, blogid, tokenname,
    9292                        htmlvalue, phpvalue, cssvalue, jsvalue, description, authorid, typeid, active, version)
    9393                        SELECT null, id, datecreated, lastupdated, siteid, blogid, tokenname, htmlvalue, phpvalue, cssvalue,
    9494                        jsvalue, description, authorid, typeid, active, version FROM $this->table_tokens
    95                         WHERE id='$tid' AND siteid='$this->siteid' AND blogid='$this->blogid' LIMIT 1;");
     95                        WHERE id='$tid' AND siteid='$this->siteid' AND blogid='$this->blogid' LIMIT 1;")==false)
     96      {
     97        echo $wpdb->last_error();
     98      }
    9699
    97100          // Insert into database
    98           $wpdb->query("UPDATE $this->table_tokens SET lastupdated = UNIX_TIMESTAMP(), tokenname = '$tokenname',
     101          if($wpdb->query("UPDATE $this->table_tokens SET lastupdated = UNIX_TIMESTAMP(), tokenname = '$tokenname',
    99102                        htmlvalue = '$htmlvalue', phpvalue = '$phpvalue', cssvalue = '$cssvalue', jsvalue = '$jsvalue',
    100103                        description = '$description', typeid = '$tokentype',
    101104                        history = (SELECT REPLACE(history, '<!-- NEXT -->', '$history')),
    102105                        version = version + 1
    103                         WHERE id='$tid' AND siteid='$this->siteid' AND blogid='$this->blogid';");
     106                        WHERE id='$tid' AND siteid='$this->siteid' AND blogid='$this->blogid';")==false)
     107      {
     108        echo $wpdb->last_error();
     109      }
     110
    104111        }
    105112      }
  • token-manager/trunk/typeedit.php

    r604953 r618883  
    7979
    8080          // Setup version
    81           $wpdb->query("INSERT INTO $this->table_typeversions (id, tokentypeid, datecreated, lastupdated, tokentype,
     81          if($wpdb->query("INSERT INTO $this->table_typeversions (id, tokentypeid, datecreated, lastupdated, tokentype,
    8282                        tokendescription, siteid, blogid, authorid, orderof, active, version)
    8383                        SELECT null, id, datecreated, lastupdated, tokentype, tokendescription, siteid, blogid, authorid,
    8484                        orderof, active, version FROM $this->table_types
    85                         WHERE id='$tid' AND siteid='$this->siteid' AND blogid='$this->blogid' LIMIT 1;");
     85                        WHERE id='$tid' AND siteid='$this->siteid' AND blogid='$this->blogid' LIMIT 1;")==false)
     86      {
     87        echo $wpdb->last_error();
     88          }
    8689
    8790
    8891          // Insert into database
    89           $wpdb->query("UPDATE $this->table_types SET lastupdated = UNIX_TIMESTAMP(),
     92          if($wpdb->query("UPDATE $this->table_types SET lastupdated = UNIX_TIMESTAMP(),
    9093                        tokentype = '$tokentype', tokendescription = '$tokendescription',
    9194                        history = (SELECT REPLACE(history, '<!-- NEXT -->', '$history')),
    9295                        version = version + 1
    93                         WHERE id = '$tid' AND siteid='$this->siteid' AND blogid='$this->blogid';");
     96                        WHERE id = '$tid' AND siteid='$this->siteid' AND blogid='$this->blogid';")==false)
     97      {
     98        echo $wpdb->last_error();
     99          }
    94100        }
    95101      }
Note: See TracChangeset for help on using the changeset viewer.