PluginProbe
Insert Html Snippet / 1.2.2
Insert Html Snippet v1.2.2
1.4.6 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 All 27 releases
insert-html-snippet / admin / install.php

install.php in Insert Html Snippet 1.2.2, at admin/install.php

67 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) )
3 exit;
4 function xyz_ihs_network_install($networkwide) {
5 global $wpdb;
6
7 if (function_exists('is_multisite') && is_multisite()) {
8 // check if it is a network activation - if so, run the activation function for each blog id
9 if ($networkwide) {
10 $old_blog = $wpdb->blogid;
11 // Get all blog ids
12 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
13 foreach ($blogids as $blog_id) {
14 switch_to_blog($blog_id);
15 xyz_ihs_install();
16 }
17 switch_to_blog($old_blog);
18 return;
19 }
20 }
21 xyz_ihs_install();
22 }
23
24
25 function xyz_ihs_install(){
26
27 global $wpdb;
28 //global $current_user; wp_get_current_user();
29 if(get_option('xyz_ihs_sort_order')=='')
30 {
31 add_option('xyz_ihs_sort_order','desc');
32 }
33 if(get_option('xyz_ihs_sort_field_name')=='')
34 {
35 add_option('xyz_ihs_sort_field_name','id');
36 }
37
38 $ihsap_installed_date = get_option('ihsap_installed_date');
39 if ($ihsap_installed_date=="") {
40 $ihsap_installed_date = time();
41 update_option('ihsap_installed_date', $ihsap_installed_date);
42 }
43
44 if(get_option('xyz_credit_link') == "")
45 {
46 add_option("xyz_credit_link",0);
47 }
48
49 add_option('xyz_ihs_limit',20);
50 $queryInsertHtml = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."xyz_ihs_short_code (
51 `id` int NOT NULL AUTO_INCREMENT,
52 `title` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
53 `content` longtext COLLATE utf8_unicode_ci NOT NULL,
54 `short_code` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
55 `status` int NOT NULL,
56 PRIMARY KEY (`id`)
57 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1";
58 $wpdb->query($queryInsertHtml);
59 }
60
61 register_activation_hook( XYZ_INSERT_HTML_PLUGIN_FILE ,'xyz_ihs_network_install');
62
63
64
65
66
67