PluginProbe
Insert PHP Code Snippet / 1.0
Insert PHP Code Snippet v1.0
1.4.7 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 1.4.4 1.4.5 1.4.6 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 All 27 releases
insert-php-code-snippet / admin / install.php

install.php in Insert PHP Code Snippet 1.0, at admin/install.php

53 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function xyz_ips_network_install($networkwide) {
4 global $wpdb;
5
6 if (function_exists('is_multisite') && is_multisite()) {
7 // check if it is a network activation - if so, run the activation function for each blog id
8 if ($networkwide) {
9 $old_blog = $wpdb->blogid;
10 // Get all blog ids
11 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
12 foreach ($blogids as $blog_id) {
13 switch_to_blog($blog_id);
14 xyz_ips_install();
15 }
16 switch_to_blog($old_blog);
17 return;
18 }
19 }
20 xyz_ips_install();
21 }
22
23
24 function xyz_ips_install(){
25
26 global $wpdb;
27 //global $current_user; get_currentuserinfo();
28
29
30 if(get_option('xyz_credit_link') == "")
31 {
32 add_option("xyz_credit_link",0);
33 }
34
35 add_option('xyz_ips_limit',20);
36 $queryInsertPhp = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."xyz_ips_short_code (
37 `id` int NOT NULL AUTO_INCREMENT,
38 `title` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
39 `content` longtext COLLATE utf8_unicode_ci NOT NULL,
40 `short_code` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
41 `status` int NOT NULL,
42 PRIMARY KEY (`id`)
43 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1";
44 $wpdb->query($queryInsertPhp);
45 }
46
47 register_activation_hook( XYZ_INSERT_PHP_PLUGIN_FILE ,'xyz_ips_network_install');
48
49
50
51
52
53