| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( !defined( 'ABSPATH' ) ) exit; |
| 4 |
if( !current_user_can('administrator') ) exit; |
| 5 |
?> |
| 6 |
|
| 7 |
<?php if( !isset( $_GET['action'] ) ): ?> |
| 8 |
|
| 9 |
<form action="" method="POST" class="validate"> |
| 10 |
<?php wp_nonce_field( 'wpforo-settings-general' ); ?> |
| 11 |
<table class="wpforo_settings_table"> |
| 12 |
<tbody> |
| 13 |
<tr> |
| 14 |
<th> |
| 15 |
<label for="wpforourl"><?php _e('Forum Base URL', 'wpforo'); ?></label> |
| 16 |
</th> |
| 17 |
<td align="left"> |
| 18 |
<?php if(!WPF()->use_home_url): ?> |
| 19 |
<span style="font-size:14px;"><?php echo esc_url( home_url('/') ) ?></span> |
| 20 |
<input required id="wpforourl" type="text" name="wpforo_url" value="<?php echo esc_attr( urldecode( WPF()->permastruct ) ) ?>" style="width:47%;"/>/<br> |
| 21 |
<?php endif; ?> |
| 22 |
<label for="wpforo_use_home_url"> |
| 23 |
<input id="wpforo_use_home_url" type="checkbox" name="wpforo_use_home_url" value="1" <?php echo (WPF()->use_home_url ? 'checked' : '') ?>/> |
| 24 |
<?php _e('Turn WordPress to wpForo', 'wpforo') ?> |
| 25 |
<p class="wpf-info"><?php _e('This option will disable WordPress on front-end. Only forum pages and excluded post/pages will be available. wpForo will look like as a stand-alone forum.', 'wpforo') ?></p> |
| 26 |
</label> |
| 27 |
<?php if(WPF()->use_home_url): ?> |
| 28 |
<label for="wpforo_excld_urls"><b style="font-weight: bold;">* <?php _e('Exclude page URLs', 'wpforo') ?></b> <span class="wpf-info">(<?php _e('one URL per line', 'wpforo') ?>)</span></label><br/> |
| 29 |
<textarea id="wpforo_excld_urls" |
| 30 |
style="font-size: 11px;" |
| 31 |
rows="4" |
| 32 |
cols="30" |
| 33 |
name="wpforo_excld_urls" |
| 34 |
placeholder="<?php echo esc_url( home_url('/') ) ?>sample-page/ <?php echo esc_url( home_url('/') ) ?>hello-world/ ..." |
| 35 |
><?php echo esc_textarea( WPF()->excld_urls ) ?></textarea> |
| 36 |
<br/> |
| 37 |
<?php endif; ?> |
| 38 |
<a href="<?php echo wpforo_home_url() ?>" target="_blank"><?php _e('Visit Forum', 'wpforo') ?></a> | |
| 39 |
<?php $page_id = WPF()->db->get_var("SELECT `ID` FROM `".WPF()->db->posts."` WHERE `ID` = ".intval(WPF()->pageid)." AND `post_content` LIKE '%[wpforo%' AND `post_status` LIKE 'publish' AND `post_type` IN('post', 'page')"); ?> |
| 40 |
<?php if( !WPF()->pageid || !$page_id ): ?> |
| 41 |
<?php echo '<span style="color:#DD0000">' . __('wpForo PageID doesn\'t exist. Forums will not be loaded, please read this') . ' <a href="http://wpforo.com/community/faq/how-to-add-forum-pageid/">' . __('support topic', 'wpforo') . '»</a>' . '</span>'; ?> |
| 42 |
<?php else: ?> |
| 43 |
<?php _e('Forum Page ID', 'wpforo'); ?>: <?php echo WPF()->pageid; ?> |
| 44 |
<?php endif; ?> |
| 45 |
</td> |
| 46 |
</tr> |
| 47 |
<tr> |
| 48 |
<th><label for="forum_title"><?php _e('Forum Title', 'wpforo'); ?></label></th> |
| 49 |
<td><input id="forum_title" type="text" name="wpforo_general_options[title]" value="<?php if(isset(WPF()->general_options['title'])) wpfo( WPF()->general_options['title'] ); ?>" required></td> |
| 50 |
</tr> |
| 51 |
<tr> |
| 52 |
<th><label for="forum_description"><?php _e('Forum Description', 'wpforo'); ?></label></th> |
| 53 |
<td><input id="forum_description" type="text" name="wpforo_general_options[description]" value="<?php if(isset(WPF()->general_options['description'])) wpfo( WPF()->general_options['description'] ); ?>" required></td> |
| 54 |
</tr> |
| 55 |
<tr> |
| 56 |
<th> |
| 57 |
<label><?php _e('Dashboard Menu Position', 'wpforo'); ?></label> |
| 58 |
<p class="wpf-info"><?php _e('The position in the menu order wpForo should appear.', 'wpforo'); ?></p> |
| 59 |
<p class="wpf-info" style="font-size:11px; line-height:14px;"><?php _e('Use greater than 5 - below Posts, 10 - below Media, 15 - below Links, 20 - below Pages, 25 - below comments, 60 - below first separator, 65 - below Plugins, 70 - below Users, 75 - below Tools, 80 - below Settings, 100 - below second separator', 'wpforo'); ?></p> |
| 60 |
</th> |
| 61 |
<td> |
| 62 |
<input type="number" name="wpforo_general_options[menu_position]" value="<?php if(!isset(WPF()->general_options['menu_position'])) WPF()->general_options['menu_position'] = 23; wpfo(WPF()->general_options['menu_position']); ?>"/> |
| 63 |
<a href="https://developer.wordpress.org/reference/functions/add_menu_page/" target="_blank" style="text-decoration:none;"><?php _e('More info', 'wpforo') ?> »</a> |
| 64 |
</td> |
| 65 |
</tr> |
| 66 |
<tr> |
| 67 |
<th> |
| 68 |
<label for="langid"><?php _e('Forum Language', 'wpforo'); ?></label> |
| 69 |
<p class="wpf-info"><?php _e('This option is only related to XML language files. You should upload a translation XML file to have a new language option in this drop-down. If you are using PO/MO translation files you should change WordPress Language in Dashboard > Settings admin page to load according translation for wpForo.', 'wpforo'); ?></p> |
| 70 |
</th> |
| 71 |
<td> |
| 72 |
<select id="langid" name="wpforo_general_options[lang]" style="float:left;"> |
| 73 |
<?php WPF()->phrase->show_lang_list() ?> |
| 74 |
</select> |
| 75 |
<h2 style="margin: 0;padding: 0;float: left;"><a href="<?php echo admin_url( 'admin.php?page=wpforo-settings&tab=general&action=newlang' ) ?>" class="add-new-h2"><?php _e('Add New', 'wpforo'); ?></a></h2> |
| 76 |
</td> |
| 77 |
</tr> |
| 78 |
<?php do_action( 'wpforo_settings_general'); ?> |
| 79 |
</tbody> |
| 80 |
</table> |
| 81 |
<div class="wpforo_settings_foot"> |
| 82 |
<input type="submit" class="button button-primary" value="<?php _e('Update Options', 'wpforo'); ?>" /> |
| 83 |
</div> |
| 84 |
</form> |
| 85 |
<?php endif ?> |
| 86 |
|
| 87 |
<?php if(isset( $_GET['action'] ) && $_GET['action'] == 'newlang' ): ?> |
| 88 |
<form action="" method="POST" name="add_lang" class="validate" enctype="multipart/form-data" > |
| 89 |
<?php wp_nonce_field( 'wpforo-settings-language' ); ?> |
| 90 |
<table class="wpforo_settings_table"> |
| 91 |
<tbody> |
| 92 |
<tr class="form-field form-required"> |
| 93 |
<td> |
| 94 |
<b><label><?php _e('Language XML file', 'wpforo') ?>: </label></b> |
| 95 |
</td> |
| 96 |
<td> |
| 97 |
<input type="file" name="add_lang[xml]" accept="text/xml" /> |
| 98 |
</td> |
| 99 |
</tr> |
| 100 |
</tbody> |
| 101 |
</table> |
| 102 |
<div class="wpforo_settings_foot"> |
| 103 |
<input type="submit" class="button button-primary" value="<?php _e('Add New Language', 'wpforo'); ?>"> |
| 104 |
</div> |
| 105 |
</form> |
| 106 |
<?php endif ?> |