Ejemplo n.º 1
0
function hocwp_post_trending_table_init()
{
    global $wpdb;
    $table_name = $wpdb->prefix . HOCWP_TRENDING_TABLE;
    $sql = "ID bigint(20) unsigned NOT NULL auto_increment,\r\n        post_id bigint(20) unsigned NOT NULL default '0',\r\n        post_date datetime NOT NULL default '0000-00-00 00:00:00',\r\n        post_type varchar(20) NOT NULL default 'post',\r\n        action varchar(20) NOT NULL default '',\r\n        PRIMARY KEY (ID),\r\n        KEY post_id (post_id)";
    hocwp_create_database_table($table_name, $sql);
}
Ejemplo n.º 2
0
function hocwp_statistics_table_init()
{
    global $wpdb;
    $table_statistics = $wpdb->prefix . HOCWP_COUNTER_TABLE_STATISTICS;
    $table_online = $wpdb->prefix . HOCWP_COUNTER_TABLE_ONLINE;
    $sql = "ID bigint(20) unsigned NOT NULL auto_increment,\r\n        user_id bigint(20) unsigned NOT NULL default '0',\r\n        visited datetime NOT NULL default '0000-00-00 00:00:00',\r\n        visited_timestamp int,\r\n        ip text,\r\n        pc_ip text,\r\n        browser text,\r\n        location text,\r\n        user_agent longtext,\r\n        PRIMARY KEY  (ID),\r\n        KEY user_id (user_id)";
    hocwp_create_database_table($table_statistics, $sql);
    hocwp_create_database_table($table_online, $sql);
}
Ejemplo n.º 3
0
function hocwp_term_meta_table_init()
{
    $version = hocwp_get_wp_version();
    if (version_compare($version, '4.4', '>=')) {
        return;
    }
    global $wpdb;
    $max_index_length = 191;
    $table = $wpdb->prefix . HOCWP_TERM_META_TABLE;
    $sql = "meta_id bigint(20) unsigned NOT NULL auto_increment,\r\n\t\tterm_id bigint(20) unsigned NOT NULL default '0',\r\n\t\tmeta_key varchar(255) default NULL,\r\n\t\tmeta_value longtext,\r\n\t\tPRIMARY KEY  (meta_id),\r\n\t\tKEY term_id (term_id),\r\n\t\tKEY meta_key (meta_key({$max_index_length}))";
    hocwp_create_database_table($table, $sql);
}