| | 15 | |
|---|
| | 16 | ### Function: Install BbLD Configuration |
|---|
| | 17 | $install = (basename($_SERVER['SCRIPT_NAME']) == 'plugins.php' && isset($_GET['activate']));; |
|---|
| | 18 | if ($install) { |
|---|
| | 19 | bbld_install(); |
|---|
| | 20 | } |
|---|
| | 21 | |
|---|
| | 22 | function bbld_install() { |
|---|
| | 23 | if (get_option('wpbb_status') == FALSE) { |
|---|
| | 24 | $bbpath = '/bbpress'; // Adjust the path to suit your bbpress location. Example: '/forums' |
|---|
| | 25 | $wpbburl = get_settings('home') . $bbpath; |
|---|
| | 26 | update_option('wpbb_path', $wpbburl); |
|---|
| | 27 | $forum_slimit = '10'; // Adjust the limit to show |
|---|
| | 28 | update_option('wpbb_limit', $forum_slimit); |
|---|
| | 29 | $bbdb_prefix = 'bb_'; // Set Bbpress Prefix |
|---|
| | 30 | update_option('wpbb_bbprefix', $bbdb_prefix); |
|---|
| | 31 | $limit = '100'; |
|---|
| | 32 | update_option('wpbb_slimit', $limit); |
|---|
| | 33 | update_option('wpbb_permalink', false); |
|---|
| | 34 | update_option('wpbb_intergrated', false); |
|---|
| | 35 | update_option('wpbb_exdb', false); |
|---|
| | 36 | update_option('wpbb_dbuser', DB_USER); |
|---|
| | 37 | update_option('wpbb_dbpass', DB_PASSWORD); |
|---|
| | 38 | update_option('wpbb_dbname', DB_NAME); |
|---|
| | 39 | update_option('wpbb_dbhost', DB_HOST); |
|---|
| | 40 | $install_status = 'install'; |
|---|
| | 41 | update_option('wpbb_status', $install_status); |
|---|
| | 42 | } |
|---|
| | 43 | } |
|---|
| 52 | | } |
|---|
| 53 | | elseif (get_option('wpbb_path') == FALSE) { |
|---|
| 54 | | $bbpath = '/bbpress'; // Adjust the path to suit your bbpress location. Example: '/forums' |
|---|
| 55 | | $wpbburl = get_settings('home') . $bbpath; |
|---|
| 56 | | update_option('wpbb_path', $wpbburl); |
|---|
| 57 | | } |
|---|
| 58 | | elseif (get_option('wpbb_limit') == FALSE) { |
|---|
| 59 | | $forum_slimit = '10'; // Adjust the limit to show |
|---|
| 60 | | update_option('wpbb_limit', $forum_slimit); |
|---|
| 61 | | } |
|---|
| 62 | | elseif (get_option('wpbb_bbprefix') == FALSE) { |
|---|
| 63 | | $bbdb_prefix = 'bb_'; // Set Bbpress Prefix |
|---|
| 64 | | update_option('wpbb_bbprefix', $bbdb_prefix); |
|---|
| 65 | | } |
|---|
| 66 | | elseif (get_option('wpbb_slimit') == FALSE) { |
|---|
| 67 | | $limit = '100'; |
|---|
| 68 | | update_option('wpbb_slimit', $limit); |
|---|
| 69 | | } |
|---|
| 70 | | elseif (get_option('wpbb_permalink') == FALSE) { |
|---|
| 71 | | update_option('wpbb_permalink', false); |
|---|
| 72 | | } |
|---|
| 73 | | elseif (get_option('wpbb_intergrated') == FALSE) { |
|---|
| 74 | | update_option('wpbb_intergrated', false); |
|---|
| 75 | | } |
|---|
| 76 | | elseif (get_option('wpbb_exdb') == FALSE) { |
|---|
| 77 | | update_option('wpbb_exdb', false); |
|---|
| 78 | | } |
|---|
| 79 | | elseif (get_option('wpbb_dbuser') == FALSE) { |
|---|
| 80 | | update_option('wpbb_dbuser', DB_USER); |
|---|
| 81 | | } |
|---|
| 82 | | elseif (get_option('wpbb_dbpass') == FALSE) { |
|---|
| 83 | | update_option('wpbb_dbpass', DB_PASSWORD); |
|---|
| 84 | | } |
|---|
| 85 | | elseif (get_option('wpbb_dbname') == FALSE) { |
|---|
| 86 | | update_option('wpbb_dbname', DB_NAME); |
|---|
| 87 | | } |
|---|
| 88 | | elseif (get_option('wpbb_dbhost') == FALSE) { |
|---|
| 89 | | update_option('wpbb_dbhost', DB_HOST); |
|---|