$table_name = $key; $sql = "CREATE TABLE IF NOT EXISTS `" . $table_name . "` (\n\t\t\t\t `ID` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t\t\t PRIMARY KEY (`ID`)\n\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; $wpdb->query($sql); if (count($table) > 0) { foreach ($table as $key => $type) { wpfw_add_db_columns($table_name, $key, $type); } } } } } } if (!function_exists("wpfw_add_db_columns")) { function wpfw_add_db_columns($table_name, $column_name, $column_type) { global $wpdb; $check = $wpdb->get_results("SHOW COLUMNS FROM `" . $table_name . "` LIKE '" . $column_name . "'"); if (count($check) < 1) { $wpdb->query("ALTER TABLE `" . $table_name . "` ADD COLUMN `" . $column_name . "` " . $column_type . " NOT NULL"); } } } if (isset($external)) { require_once get_wp_path('wp-load.php'); } require_once get_wp_path('wp-includes/pluggable.php'); require_once get_wp_path('wp-admin/includes/upgrade.php'); if (isset($external)) { require_once get_wp_path('wp-admin/includes/image.php'); } global $wpdb;
/** * Add Favicon link to theme header */ function orbitnews_show_favicon() { $favicon_url = ot_get_option('orn_favicon'); if (empty($favicon_url)) { return false; } $favicon_dir = str_replace(get_site_url(), get_wp_path(), $favicon_url); if (file_exists($favicon_dir)) { echo '<link rel="shortcut icon" href="' . $favicon_url . '">'; } else { echo '<!-- No FavIcons Found -->'; } }