Advertisement
Viruthagiri

cp_install.php

Jan 30th, 2012
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // create database
  2.     global $wpdb;
  3.     if($wpdb->get_var("SHOW TABLES LIKE '".CP_DB."'") != CP_DB || (int) get_option('cp_db_version') < 1.3) {
  4.         $sql = "CREATE TABLE " . CP_DB . " (
  5.               id bigint(20) NOT NULL AUTO_INCREMENT,
  6.               uid bigint(20) NOT NULL,
  7.               type VARCHAR(256) NOT NULL,
  8.               data TEXT NOT NULL,
  9.               blog_id bigint(20) NOT NULL,
  10.               points bigint(20) NOT NULL,
  11.              timestamp bigint(20) NOT NULL,
  12.               UNIQUE KEY id (id)
  13.             );";
  14.         require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
  15.         dbDelta($sql);
  16.         add_option("cp_db_version", 1.3);
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement