예제 #1
0
function cp_tables_install()
{
    global $wpdb, $app_abbr;
    // create the ad forms table - store form data
    $sql = "\n\t\t\t\t\tid int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tform_name varchar(255) NOT NULL,\n\t\t\t\t\tform_label varchar(255) NOT NULL,\n\t\t\t\t\tform_desc longtext DEFAULT NULL,\n\t\t\t\t\tform_cats longtext NOT NULL,\n\t\t\t\t\tform_status varchar(255) DEFAULT NULL,\n\t\t\t\t\tform_owner varchar(255) DEFAULT NULL,\n\t\t\t\t\tform_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tform_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tPRIMARY KEY  (id)";
    scb_install_table('cp_ad_forms', $sql);
    // create the ad meta table - store form fields meta data
    $sql = "\n\t\t\t\t\tmeta_id int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tform_id int(10) NOT NULL,\n\t\t\t\t\tfield_id int(10) NOT NULL,\n\t\t\t\t\tfield_req varchar(255) NOT NULL,\n\t\t\t\t\tfield_pos int(10) NOT NULL,\n\t\t\t\t\tfield_search int(10) NOT NULL,\n\t\t\t\t\tPRIMARY KEY  (meta_id)";
    scb_install_table('cp_ad_meta', $sql);
    // create the ad fields table - store form fields data
    $sql = "\n\t\t\t\t\tfield_id int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tfield_name varchar(255) NOT NULL,\n\t\t\t\t\tfield_label varchar(255) NOT NULL,\n\t\t\t\t\tfield_desc longtext DEFAULT NULL,\n\t\t\t\t\tfield_type varchar(255) NOT NULL,\n\t\t\t\t\tfield_values longtext DEFAULT NULL,\n\t\t\t\t\tfield_tooltip longtext DEFAULT NULL,\n\t\t\t\t\tfield_search varchar(255) DEFAULT NULL,\n\t\t\t\t\tfield_perm int(11) NOT NULL,\n\t\t\t\t\tfield_core int(11) NOT NULL,\n\t\t\t\t\tfield_req int(11) NOT NULL,\n\t\t\t\t\tfield_owner varchar(255) NOT NULL,\n\t\t\t\t\tfield_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tfield_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tfield_min_length int(11) NOT NULL,\n\t\t\t\t\tfield_validation longtext DEFAULT NULL,\n\t\t\t\t\tPRIMARY KEY  (field_id)";
    scb_install_table('cp_ad_fields', $sql);
    // create the daily page view counter table
    $sql = "\n\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\ttime date NOT NULL DEFAULT '0000-00-00',\n\t\t\t\t\tpostnum int(11) NOT NULL,\n\t\t\t\t\tpostcount int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tPRIMARY KEY  (id)";
    scb_install_table('cp_ad_pop_daily', $sql);
    // create the all-time page view counter table
    $sql = "\n\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tpostnum int(11) NOT NULL,\n\t\t\t\t\tpostcount int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tPRIMARY KEY  (id)";
    scb_install_table('cp_ad_pop_total', $sql);
    // create the ad packs table - store ad package data
    $sql = "\n\t\t\t\t\tpack_id int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tpack_name varchar(255) NOT NULL,\n\t\t\t\t\tpack_desc longtext DEFAULT NULL,\n\t\t\t\t\tpack_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00',\n\t\t\t\t\tpack_duration int(5) NOT NULL,\n\t\t\t\t\tpack_images int(5) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\tpack_status varchar(50) NOT NULL,\n\t\t\t\t\tpack_owner varchar(255) NOT NULL,    \n\t\t\t\t\tpack_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tpack_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tpack_type varchar(255) NOT NULL,\n\t\t\t\t\tpack_membership_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00',\n\t\t\t\t\tPRIMARY KEY  (pack_id)";
    scb_install_table('cp_ad_packs', $sql);
    // create the coupons table - store coupon data
    $sql = "\n\t\t\t\t\tcoupon_id int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tcoupon_code varchar(100) NOT NULL,\n\t\t\t\t\tcoupon_desc longtext DEFAULT NULL,\n\t\t\t\t\tcoupon_discount decimal(10,2) unsigned NOT NULL DEFAULT '0.00',\n\t\t\t\t\tcoupon_discount_type varchar(50) NOT NULL,\n\t\t\t\t\tcoupon_start_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tcoupon_expire_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tcoupon_status varchar(50) NOT NULL,\n\t\t\t\t\tcoupon_use_count int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tcoupon_max_use_count int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tcoupon_owner varchar(255) NOT NULL,    \n\t\t\t\t\tcoupon_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tcoupon_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tPRIMARY KEY  (coupon_id),\n\t\t\t\t\tUNIQUE KEY coupon_code (coupon_code)";
    scb_install_table('cp_coupons', $sql);
    // create the orders table - store transaction data
    $sql = "\n\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tad_id int(10) NOT NULL,\n\t\t\t\t\tuser_id bigint(20) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\tfirst_name varchar(100) NOT NULL DEFAULT '',\n\t\t\t\t\tlast_name varchar(100) NOT NULL DEFAULT '',\n\t\t\t\t\tpayer_email varchar(100) NOT NULL DEFAULT '',\n\t\t\t\t\tstreet varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\tcity varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\tstate varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\tzipcode varchar(100) NOT NULL DEFAULT '',\n\t\t\t\t\tresidence_country varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\ttransaction_subject varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\tmemo varchar(255) DEFAULT NULL,\n\t\t\t\t\titem_name varchar(255) DEFAULT NULL,\n\t\t\t\t\titem_number varchar(255) DEFAULT NULL,\n\t\t\t\t\tquantity char(10) DEFAULT NULL,\n\t\t\t\t\tpayment_type varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\tpayer_status varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\tpayer_id varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\treceiver_id varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\tparent_txn_id varchar(30) NOT NULL DEFAULT '',\n\t\t\t\t\ttxn_id varchar(30) NOT NULL DEFAULT '',\n\t\t\t\t\ttxn_type varchar(10) NOT NULL DEFAULT '',\n\t\t\t\t\tpayment_status varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\tpending_reason varchar(50) DEFAULT NULL,\n\t\t\t\t\tmc_gross varchar(10) NOT NULL DEFAULT '',\n\t\t\t\t\tmc_fee varchar(10) NOT NULL DEFAULT '',\n\t\t\t\t\ttax varchar(10) DEFAULT NULL,\n\t\t\t\t\texchange_rate varchar(25) DEFAULT NULL,\n\t\t\t\t\tmc_currency varchar(20) NOT NULL DEFAULT '',\n\t\t\t\t\treason_code varchar(20) NOT NULL DEFAULT '',\n\t\t\t\t\tcustom varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\ttest_ipn varchar(20) NOT NULL DEFAULT '',\n\t\t\t\t\tpayment_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tcreate_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tPRIMARY KEY  (id)";
    scb_install_table('cp_order_info', $sql);
    // create the geocodes table - store geo location data
    $sql = "\n\t\t\t\t\tid int(20) NOT NULL auto_increment,\n\t\t\t\t\tpost_id int(20) NOT NULL DEFAULT '0',\n\t\t\t\t\tcategory varchar(200) NOT NULL,\n\t\t\t\t\tlat float( 10, 6 ) NOT NULL,\n\t\t\t\t\tlng float( 10, 6 ) NOT NULL,\n\t\t\t\t\tPRIMARY KEY  (id)";
    scb_install_table('cp_ad_geocodes', $sql);
}
예제 #2
0
파일: install.php 프로젝트: kalushta/darom
function cp_tables_install()
{
    global $wpdb;
    // create the ad forms table - store form data
    $sql = "\n\t\t\t\t\tid int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tform_name varchar(255) NOT NULL,\n\t\t\t\t\tform_label varchar(255) NOT NULL,\n\t\t\t\t\tform_desc longtext DEFAULT NULL,\n\t\t\t\t\tform_cats longtext NOT NULL,\n\t\t\t\t\tform_status varchar(255) DEFAULT NULL,\n\t\t\t\t\tform_owner varchar(255) NOT NULL DEFAULT 'admin',\n\t\t\t\t\tform_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tform_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tPRIMARY KEY  (id)";
    scb_install_table('cp_ad_forms', $sql);
    // create the ad meta table - store form fields meta data
    $sql = "\n\t\t\t\t\tmeta_id int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tform_id int(10) NOT NULL,\n\t\t\t\t\tfield_id int(10) NOT NULL,\n\t\t\t\t\tfield_req varchar(255) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_pos int(10) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_search int(10) NOT NULL DEFAULT '0',\n\t\t\t\t\tPRIMARY KEY  (meta_id)";
    scb_install_table('cp_ad_meta', $sql);
    // create the ad fields table - store form fields data
    $sql = "\n\t\t\t\t\tfield_id int(10) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\tfield_name varchar(255) NOT NULL,\n\t\t\t\t\tfield_label varchar(255) NOT NULL,\n\t\t\t\t\tfield_desc longtext DEFAULT NULL,\n\t\t\t\t\tfield_type varchar(255) NOT NULL,\n\t\t\t\t\tfield_values longtext DEFAULT NULL,\n\t\t\t\t\tfield_tooltip longtext DEFAULT NULL,\n\t\t\t\t\tfield_search varchar(255) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_perm int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_core int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_req int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_owner varchar(255) NOT NULL DEFAULT 'admin',\n\t\t\t\t\tfield_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tfield_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\tfield_min_length int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\tfield_validation longtext DEFAULT NULL,\n\t\t\t\t\tPRIMARY KEY  (field_id)";
    scb_install_table('cp_ad_fields', $sql);
    // create the geocodes table - store geo location data
    $sql = "\n\t\t\t\t\tpost_id bigint(20) unsigned NOT NULL,\n\t\t\t\t\tlat float( 10, 6 ) NOT NULL,\n\t\t\t\t\tlng float( 10, 6 ) NOT NULL,\n\t\t\t\t\tPRIMARY KEY  (post_id)";
    scb_install_table('cp_ad_geocodes', $sql);
}
예제 #3
0
파일: Table.php 프로젝트: Didox/beminfinito
 /**
  * Installs table.
  *
  * @return void
  */
 public function install()
 {
     scb_install_table($this->name, $this->columns, $this->upgrade_method);
 }
예제 #4
0
 static function install()
 {
     scb_install_table('p2p', "\n\t\t\tp2p_id bigint(20) unsigned NOT NULL auto_increment,\n\t\t\tp2p_from bigint(20) unsigned NOT NULL,\n\t\t\tp2p_to bigint(20) unsigned NOT NULL,\n\t\t\tp2p_type varchar(44) NOT NULL default '',\n\t\t\tPRIMARY KEY  (p2p_id),\n\t\t\tKEY p2p_from (p2p_from),\n\t\t\tKEY p2p_to (p2p_to),\n\t\t\tKEY p2p_type (p2p_type)\n\t\t");
     scb_install_table('p2pmeta', "\n\t\t\tmeta_id bigint(20) unsigned NOT NULL auto_increment,\n\t\t\tp2p_id bigint(20) unsigned NOT NULL default '0',\n\t\t\tmeta_key varchar(255) default NULL,\n\t\t\tmeta_value longtext,\n\t\t\tPRIMARY KEY  (meta_id),\n\t\t\tKEY p2p_id (p2p_id),\n\t\t\tKEY meta_key (meta_key)\n\t\t");
 }
예제 #5
0
파일: geo.php 프로젝트: kalushta/darom
 function install()
 {
     scb_install_table('app_geodata', "\n\t\t\tpost_id bigint(20) unsigned NOT NULL,\n\t\t\tlat decimal(10,6) NOT NULL,\n\t\t\tlng decimal(10,6) NOT NULL,\n\t\t\tPRIMARY KEY  (post_id)\n\t\t");
 }
예제 #6
0
function cp_create_geocode_table()
{
    global $wpdb;
    // create the geocodes table - store geo location data
    $sql = "\n\t\t\t\t\tid int(20) NOT NULL auto_increment,\n\t\t\t\t\tpost_id int(20) NOT NULL DEFAULT '0',\n\t\t\t\t\tcategory varchar(200) NOT NULL,\n\t\t\t\t\tlat float( 10, 6 ) NOT NULL,\n\t\t\t\t\tlng float( 10, 6 ) NOT NULL,\n\t\t\t\t\tPRIMARY KEY (id)";
    scb_install_table('cp_ad_geocodes', $sql, '');
}
예제 #7
0
파일: stats.php 프로젝트: kalushta/darom
 /**
  * Installs stats tables.
  *
  * @return void
  */
 public static function install()
 {
     // create the daily page view counter table
     $sql = "\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime date NOT NULL DEFAULT '0000-00-00',\n\t\t\tpostnum int(11) NOT NULL,\n\t\t\tpostcount int(11) NOT NULL DEFAULT '0',\n\t\t\tPRIMARY KEY  (id)";
     scb_install_table('app_stats_daily', $sql);
     // create the all-time page view counter table
     $sql = "\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\tpostnum int(11) NOT NULL,\n\t\t\tpostcount int(11) NOT NULL DEFAULT '0',\n\t\t\tPRIMARY KEY  (id)";
     scb_install_table('app_stats_total', $sql);
 }
예제 #8
0
function cp_tables_install()
{
    global $wpdb, $app_abbr;
    // create the ad forms table - store form data
    $sql = "\r\n\t\t\t\t\tid int(10) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tform_name varchar(255) NOT NULL,\r\n\t\t\t\t\tform_label varchar(255) NOT NULL,\r\n\t\t\t\t\tform_desc longtext DEFAULT NULL,\r\n\t\t\t\t\tform_cats longtext NOT NULL,\r\n\t\t\t\t\tform_status varchar(255) DEFAULT NULL,\r\n\t\t\t\t\tform_owner varchar(255) DEFAULT NULL,\r\n\t\t\t\t\tform_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tform_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tPRIMARY KEY (id)";
    scb_install_table('cp_ad_forms', $sql);
    // create the ad meta table - store form fields meta data
    $sql = "\r\n\t\t\t\t\tmeta_id int(10) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tform_id int(10) NOT NULL,\r\n\t\t\t\t\tfield_id int(10) NOT NULL,\r\n\t\t\t\t\tfield_req varchar(255) NOT NULL,\r\n\t\t\t\t\tfield_pos int(10) NOT NULL,\r\n\t\t\t\t\tfield_search int(10) NOT NULL,\r\n\t\t\t\t\tPRIMARY KEY (meta_id)";
    scb_install_table('cp_ad_meta', $sql);
    // create the ad fields table - store form fields data
    $sql = "\r\n\t\t\t\t\tfield_id int(10) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tfield_name varchar(255) NOT NULL,\r\n\t\t\t\t\tfield_label varchar(255) NOT NULL,\r\n\t\t\t\t\tfield_desc longtext DEFAULT NULL,\r\n\t\t\t\t\tfield_type varchar(255) NOT NULL,\r\n\t\t\t\t\tfield_values longtext DEFAULT NULL,\r\n\t\t\t\t\tfield_tooltip longtext DEFAULT NULL,\r\n\t\t\t\t\tfield_search varchar(255) DEFAULT NULL,\r\n\t\t\t\t\tfield_perm int(11) NOT NULL,\r\n\t\t\t\t\tfield_core int(11) NOT NULL,\r\n\t\t\t\t\tfield_req int(11) NOT NULL,\r\n\t\t\t\t\tfield_owner varchar(255) NOT NULL,\r\n\t\t\t\t\tfield_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tfield_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tfield_min_length int(11) NOT NULL,\r\n\t\t\t\t\tfield_validation longtext DEFAULT NULL,\r\n\t\t\t\t\tPRIMARY KEY (field_id)";
    scb_install_table('cp_ad_fields', $sql);
    // create the daily page view counter table
    $sql = "\r\n\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\ttime date NOT NULL DEFAULT '0000-00-00',\r\n\t\t\t\t\tpostnum int(11) NOT NULL,\r\n\t\t\t\t\tpostcount int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\tUNIQUE KEY (id)";
    scb_install_table('cp_ad_pop_daily', $sql);
    // create the all-time page view counter table
    $sql = "\r\n\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tpostnum int(11) NOT NULL,\r\n\t\t\t\t\tpostcount int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\tUNIQUE KEY (id)";
    scb_install_table('cp_ad_pop_total', $sql);
    // create the ad packs table - store ad package data
    $sql = "\r\n\t\t\t\t\tpack_id int(10) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tpack_name varchar(255) NOT NULL,\r\n\t\t\t\t\tpack_desc longtext DEFAULT NULL,\r\n\t\t\t\t\tpack_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00',\r\n\t\t\t\t\tpack_duration int(5) NOT NULL,\r\n\t\t\t\t\tpack_images int(5) unsigned NOT NULL DEFAULT '0',\r\n\t\t\t\t\tpack_status varchar(50) NOT NULL,\r\n\t\t\t\t\tpack_owner varchar(255) NOT NULL,    \r\n\t\t\t\t\tpack_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tpack_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tpack_type varchar(255) NOT NULL,\r\n\t\t\t\t\tpack_membership_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00',\r\n\t\t\t\t\tPRIMARY KEY (pack_id)";
    scb_install_table('cp_ad_packs', $sql);
    // create the coupons table - store coupon data
    $sql = "\r\n\t\t\t\t\tcoupon_id int(10) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tcoupon_code varchar(100) NOT NULL,\r\n\t\t\t\t\tcoupon_desc longtext DEFAULT NULL,\r\n\t\t\t\t\tcoupon_discount decimal(10,2) unsigned NOT NULL DEFAULT '0.00',\r\n\t\t\t\t\tcoupon_discount_type varchar(50) NOT NULL,\r\n\t\t\t\t\tcoupon_start_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tcoupon_expire_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tcoupon_status varchar(50) NOT NULL,\r\n\t\t\t\t\tcoupon_use_count int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\tcoupon_max_use_count int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\tcoupon_owner varchar(255) NOT NULL,    \r\n\t\t\t\t\tcoupon_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tcoupon_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tPRIMARY KEY (coupon_id),\r\n\t\t\t\t\tUNIQUE KEY (coupon_code)";
    scb_install_table('cp_coupons', $sql);
    // create the orders table - store transaction data
    $sql = "\r\n\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tad_id int(10) NOT NULL,\r\n\t\t\t\t\tfirst_name varchar(100) NOT NULL DEFAULT '',\r\n\t\t\t\t\tlast_name varchar(100) NOT NULL DEFAULT '',\r\n\t\t\t\t\tpayer_email varchar(100) NOT NULL DEFAULT '',\r\n\t\t\t\t\tstreet varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t\tcity varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t\tstate varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t\tzipcode varchar(100) NOT NULL DEFAULT '',\r\n\t\t\t\t\tresidence_country varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t\ttransaction_subject varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t\tmemo varchar(255) DEFAULT NULL,\r\n\t\t\t\t\titem_name varchar(255) DEFAULT NULL,\r\n\t\t\t\t\titem_number varchar(255) DEFAULT NULL,\r\n\t\t\t\t\tquantity char(10) DEFAULT NULL,\r\n\t\t\t\t\tpayment_type varchar(50) NOT NULL DEFAULT '',\r\n\t\t\t\t\tpayer_status varchar(50) NOT NULL DEFAULT '',\r\n\t\t\t\t\tpayer_id varchar(50) NOT NULL DEFAULT '',\r\n\t\t\t\t\treceiver_id varchar(50) NOT NULL DEFAULT '',\r\n\t\t\t\t\tparent_txn_id varchar(30) NOT NULL DEFAULT '',\r\n\t\t\t\t\ttxn_id varchar(30) NOT NULL DEFAULT '',\r\n\t\t\t\t\ttxn_type varchar(10) NOT NULL DEFAULT '',\r\n\t\t\t\t\tpayment_status varchar(50) NOT NULL DEFAULT '',\r\n\t\t\t\t\tpending_reason varchar(50) DEFAULT NULL,\r\n\t\t\t\t\tmc_gross varchar(10) NOT NULL DEFAULT '',\r\n\t\t\t\t\tmc_fee varchar(10) NOT NULL DEFAULT '',\r\n\t\t\t\t\ttax varchar(10) DEFAULT NULL,\r\n\t\t\t\t\texchange_rate varchar(25) DEFAULT NULL,\r\n\t\t\t\t\tmc_currency varchar(20) NOT NULL DEFAULT '',\r\n\t\t\t\t\treason_code varchar(20) NOT NULL DEFAULT '',\r\n\t\t\t\t\tcustom varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t\t\ttest_ipn varchar(20) NOT NULL DEFAULT '',\r\n\t\t\t\t\tpayment_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tcreate_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\tPRIMARY KEY (id)";
    scb_install_table('cp_order_info', $sql);
    // create the geocodes table - store geo location data
    $sql = "\r\n\t\t\t\t\tid int(20) NOT NULL auto_increment,\r\n\t\t\t\t\tpost_id int(20) NOT NULL DEFAULT '0',\r\n\t\t\t\t\tcategory varchar(200) NOT NULL,\r\n\t\t\t\t\tlat float( 10, 6 ) NOT NULL,\r\n\t\t\t\t\tlng float( 10, 6 ) NOT NULL,\r\n\t\t\t\t\tPRIMARY KEY (id)";
    scb_install_table('cp_ad_geocodes', $sql);
    /**
     * Insert default data into tables
     *
     * Flag values for the cp_ad_fields table
     * =======================================
     * Field permissions (field name - field_perm) are 0,1,2 and are as follows:
     * 0 = rename label, remove from form layout, reorder, change values, delete
     * 1 = rename label, reorder
     * 2 = rename label, remove from form layout, reorder, change values
     *
     * please don't ask about the logic of the order. :-)
     *
     * field_core can be 1 or 0. 1 means it's a core field and will be included
     * in the default form if no custom form has been created
     *
     * field_req in this table is only used for the default form meaning if no
     * custom form has been created, use these fields with 1 meaning mandatory field
     *
     *
     */
    // Check to see if any rows already exist. If so, don't insert any data
    $wpdb->get_results("SELECT field_id FROM {$wpdb->cp_ad_fields} LIMIT 1");
    if ($wpdb->num_rows == 0) {
        // DO NOT CHANGE THE ORDER OF THE FIRST 9 RECORDS!
        // admin-options.php cp_add_core_fields() depends on these fields
        // add more records after the post_content row insert statement
        // Title field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => 'post_title', 'field_label' => 'Title', 'field_desc' => 'This is the name of the ad and is mandatory on all forms. It is a core ClassiPress field and cannot be deleted.', 'field_type' => 'text box', 'field_values' => '', 'field_search' => '', 'field_perm' => '1', 'field_core' => '1', 'field_req' => '1', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Price field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_price', 'field_label' => 'Price', 'field_desc' => 'This is the price field for the ad. It is a core ClassiPress field and cannot be deleted.', 'field_type' => 'text box', 'field_values' => '', 'field_search' => '', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '1', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Street field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_street', 'field_label' => 'Street', 'field_desc' => 'This is the street address text field. It is a core ClassiPress field and cannot be deleted. (Needed on your forms for Google maps to work best.)', 'field_type' => 'text box', 'field_values' => '', 'field_search' => '', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // City field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_city', 'field_label' => 'City', 'field_desc' => 'This is the city field for the ad listing. It is a core ClassiPress field and cannot be deleted. (Needed on your forms for Google maps to work best.)', 'field_type' => 'text box', 'field_values' => '', 'field_search' => '1', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // State field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_state', 'field_label' => 'State', 'field_desc' => 'This is the state/province drop-down select box for the ad. It is a core ClassiPress field and cannot be deleted. (Needed on your forms for Google maps to work best.)', 'field_type' => 'drop-down', 'field_values' => 'Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,District of Columbia,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Maryland,Massachusetts,Michigan,Minnesota,Mississippi,Missouri,Montana,Nebraska,Nevada,New Hampshire,New Jersey,New Mexico,New York,North Carolina,North Dakota,Ohio,Oklahoma,Oregon,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Texas,Utah,Vermont,Virginia,Washington,West Virginia,Wisconsin,Wyoming', 'field_search' => '1', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '1', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Country field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_country', 'field_label' => 'Country', 'field_desc' => 'This is the country drop-down select box for the ad. It is a core ClassiPress field and cannot be deleted.', 'field_type' => 'drop-down', 'field_values' => 'United States,United Kingdom,Afghanistan,Albania,Algeria,American Samoa,Angola,Anguilla,Antarctica,Antigua and Barbuda,Argentina,Armenia,Aruba,Ashmore and Cartier Island,Australia,Austria,Azerbaijan,Bahamas,Bahrain,Bangladesh,Barbados,Belarus,Belgium,Belize,Benin,Bermuda,Bhutan,Bolivia,Bosnia and Herzegovina,Botswana,Brazil,British Virgin Islands,Brunei,Bulgaria,Burkina Faso,Burma,Burundi,Cambodia,Cameroon,Canada,Cape Verde,Cayman Islands,Central African Republic,Chad,Chile,China,Christmas Island,Colombia,Comoros,Congo,Cook Islands,Costa Rica,Cote dIvoire,Croatia,Cuba,Cyprus,Czeck Republic,Denmark,Djibouti,Dominica,Dominican Republic,Ecuador,Egypt,El Salvador,Equatorial Guinea,Eritrea,Estonia,Ethiopia,Europa Island,Falkland Islands,Faroe Islands,Fiji,Finland,France,French Guiana,French Polynesia,French Southern and Antarctic Lands,Gabon,Gambia,Gaza Strip,Georgia,Germany,Ghana,Gibraltar,Glorioso Islands,Greece,Greenland,Grenada,Guadeloupe,Guam,Guatemala,Guernsey,Guinea,Guinea-Bissau,Guyana,Haiti,Heard Island and McDonald Islands,Honduras,Hong Kong,Howland Island,Hungary,Iceland,India,Indonesia,Iran,Iraq,Ireland,Ireland Northern,Isle of Man,Israel,Italy,Jamaica,Jan Mayen,Japan,Jarvis Island,Jersey,Johnston Atoll,Jordan,Juan de Nova Island,Kazakhstan,Kenya,Kiribati,Korea North,Korea South,Kuwait,Kyrgyzstan,Laos,Latvia,Lebanon,Lesotho,Liberia,Libya,Liechtenstein,Lithuania,Luxembourg,Macau,Macedonia,Madagascar,Malawi,Malaysia,Maldives,Mali,Malta,Marshall Islands,Martinique,Mauritania,Mauritius,Mayotte,Mexico,Micronesia,Midway Islands,Moldova,Monaco,Mongolia,Montserrat,Morocco,Mozambique,Namibia,Nauru,Nepal,Netherlands,Netherlands Antilles,New Caledonia,New Zealand,Nicaragua,Niger,Nigeria,Niue,Norfolk Island,Northern Mariana Islands,Norway,Oman,Pakistan,Palau,Panama,Papua New Guinea,Paraguay,Peru,Philippines,Pitcaim Islands,Poland,Portugal,Puerto Rico,Qatar,Reunion,Romania,Russia,Rwanda,Saint Helena,Saint Kitts and Nevis,Saint Lucia,Saint Pierre and Miquelon,Saint Vincent and the Grenadines,Samoa,San Marino,Sao Tome and Principe,Saudi Arabia,Scotland,Senegal,Seychelles,Sierra Leone,Singapore,Slovakia,Slovenia,Solomon Islands,Somalia,South Africa,South Georgia,Spain,Spratly Islands,Sri Lanka,Sudan,Suriname,Svalbard,Swaziland,Sweden,Switzerland,Syria,Taiwan,Tajikistan,Tanzania,Thailand,Tobago,Toga,Tokelau,Tonga,Trinidad,Tunisia,Turkey,Turkmenistan,Tuvalu,Uganda,Ukraine,United Arab Emirates,United Kingdom,United States,Uruguay,Uzbekistan,Vanuatu,Vatican City,Venezuela,Vietnam,Virgin Islands,Wales,Wallis and Futuna,West Bank,Western Sahara,Yemen,Yugoslavia,Zambia,Zimbabwe', 'field_search' => '1', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '1', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Zip/Postal Code field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_zipcode', 'field_label' => 'Zip/Postal Code', 'field_desc' => 'This is the zip/postal code text field. It is a core ClassiPress field and cannot be deleted. (Needed on your forms for Google maps to work best.)', 'field_type' => 'text box', 'field_values' => '', 'field_search' => '', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Tags field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => 'tags_input', 'field_label' => 'Tags', 'field_desc' => 'This is for inputting tags for the ad. It is a core ClassiPress field and cannot be deleted.', 'field_type' => 'text box', 'field_values' => '', 'field_search' => '', 'field_perm' => '2', 'field_core' => '1', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Description field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => 'post_content', 'field_label' => 'Description', 'field_desc' => 'This is the main description box for the ad. It is a core ClassiPress field and cannot be deleted.', 'field_type' => 'text area', 'field_values' => '', 'field_search' => '', 'field_perm' => '1', 'field_core' => '1', 'field_req' => '1', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Region field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_region', 'field_label' => 'Region', 'field_desc' => 'This is the region drop-down select box for the ad.', 'field_type' => 'drop-down', 'field_values' => 'San Francisco Bay Area,Orange County,Central Valley,Northern CA,Southern CA', 'field_search' => '1', 'field_perm' => '2', 'field_core' => '', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Size field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_size', 'field_label' => 'Size', 'field_desc' => 'This is an example of a custom drop-down field.', 'field_type' => 'drop-down', 'field_values' => 'XS,S,M,L,XL,XXL', 'field_search' => '', 'field_perm' => '', 'field_core' => '', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Feedback field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_feedback', 'field_label' => 'Feedback', 'field_desc' => 'This is an example of a custom text area field.', 'field_type' => 'text area', 'field_values' => '', 'field_search' => '', 'field_perm' => '', 'field_core' => '', 'field_req' => '', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
        // Currency field
        $wpdb->insert($wpdb->cp_ad_fields, array('field_name' => $app_abbr . '_currency', 'field_label' => 'Currency', 'field_desc' => 'This is the currency drop-down select box for the ad. Add it to the form below the price to allow users to choose the currency for the ad price.', 'field_type' => 'drop-down', 'field_values' => '$,€,£,¥', 'field_search' => '', 'field_perm' => '0', 'field_core' => '0', 'field_req' => '0', 'field_owner' => 'ClassiPress', 'field_created' => date_i18n("Y-m-d H:i:s"), 'field_modified' => date_i18n("Y-m-d H:i:s"), 'field_min_length' => '0'));
    }
    // Check to see if any rows already exist. If so, don't insert any data
    $sql = "SELECT pack_id FROM {$wpdb->cp_ad_packs} LIMIT 1";
    $wpdb->get_results($sql);
    if ($wpdb->num_rows == 0) {
        // Example Ad Pack
        $wpdb->insert($wpdb->cp_ad_packs, array('pack_name' => '30 days for only $5', 'pack_desc' => 'This is the default price per ad package created by ClassiPress.', 'pack_price' => '5.00', 'pack_duration' => '30', 'pack_images' => '3', 'pack_status' => 'active', 'pack_owner' => 'ClassiPress', 'pack_created' => date_i18n("Y-m-d H:i:s"), 'pack_modified' => date_i18n("Y-m-d H:i:s"), 'pack_type' => '', 'pack_membership_price' => '0.00'));
        // Example Membership Pack
        $wpdb->insert($wpdb->cp_ad_packs, array('pack_name' => '30 days publishing for only $2', 'pack_desc' => 'This is the default membership package created by ClassiPress.', 'pack_price' => '2.00', 'pack_duration' => '30', 'pack_images' => '3', 'pack_status' => 'active_membership', 'pack_owner' => 'ClassiPress', 'pack_created' => date_i18n("Y-m-d H:i:s"), 'pack_modified' => date_i18n("Y-m-d H:i:s"), 'pack_type' => 'required_static', 'pack_membership_price' => '15.00'));
    }
}
예제 #9
0
/**
 * Installs stats tables.
 */
function appthemes_install_stats_tables()
{
    if (!current_theme_supports('app-stats')) {
        return false;
    }
    list($options) = get_theme_support('app-stats');
    // create the daily page view counter table
    $sql = "\n\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\ttime date NOT NULL DEFAULT '0000-00-00',\n\t\tpostnum int(11) NOT NULL,\n\t\tpostcount int(11) NOT NULL DEFAULT '0',\n\t\tPRIMARY KEY  (id)";
    scb_install_table('app_stats_daily', $sql);
    // create the all-time page view counter table
    $sql = "\n\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\tpostnum int(11) NOT NULL,\n\t\tpostcount int(11) NOT NULL DEFAULT '0',\n\t\tPRIMARY KEY  (id)";
    scb_install_table('app_stats_total', $sql);
}