forked from magic-fields-team/Magic-Fields-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mf_constants.php
49 lines (38 loc) · 1.78 KB
/
mf_constants.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
global $wpdb,$blog_id;
//useful for get quickly the path for images/javascript files and css files
//return something like: http://wordpress.local/wp-content/plugins/Magic-Fields/
define('MF_BASENAME',plugins_url().'/'.str_replace(basename(__FILE__),"",plugin_basename(__FILE__)));
define('MF_URL',MF_BASENAME);
//return something like: /Users/user/sites/wordpres/wp-content/plugins/Magic-Fields
define("MF_PATH", dirname(__FILE__));
define("PHPTHUMB",MF_URL."thirdparty/phpthumb/phpThumb.php");
define('MF_FILES_NAME','files_mf');
define('MF_CACHE_NAME','cache');
if( mf_mu2() ){
/* MU path /wp-content/blogs.dir/{id_blog}/files_mf */
define('MF_FILES_DIR', WP_CONTENT_DIR.DS.'blogs.dir'.DS.$blog_id.DS.MF_FILES_NAME.DS);
define('MF_FILES_URL', WP_CONTENT_URL.'/blogs.dir/'.$blog_id.'/'.MF_FILES_NAME.'/');
define('MF_CACHE_DIR', MF_FILES_DIR.MF_CACHE_NAME.DS);
define('MF_CACHE_URL', MF_FILES_URL.MF_CACHE_NAME.'/');
}else{
define('MF_FILES_DIR', WP_CONTENT_DIR.DS.MF_FILES_NAME.DS);
define('MF_FILES_URL', WP_CONTENT_URL.'/'.MF_FILES_NAME.'/');
define('MF_CACHE_DIR', MF_FILES_DIR.MF_CACHE_NAME.DS);
define('MF_CACHE_URL', MF_FILES_URL.MF_CACHE_NAME.'/');
}
//detect if install MF on mode normal
if( mf_mu_alone() ){
$mf_prefix = $wpdb->prefix;
}else{
$mf_prefix = $wpdb->base_prefix;
}
define( 'MF_TABLE_POSTTYPES', $mf_prefix . 'mf_posttypes' );
define( 'MF_TABLE_CUSTOM_TAXONOMY', $mf_prefix . 'mf_custom_taxonomy' );
define( 'MF_TABLE_CUSTOM_FIELDS', $mf_prefix . 'mf_custom_fields' );
define( 'MF_TABLE_CUSTOM_GROUPS', $mf_prefix . 'mf_custom_groups' );
define( 'MF_TABLE_POST_META', $wpdb->prefix.'mf_post_meta' );
//define name for settings MF
define('MF_SETTINGS_KEY', 'mf_settings');
define('MF_DB_VERSION_KEY', 'mf_db_version');
define('MF_DB_VERSION', 3);