PluginProbe
wpForo Forum / 1.4.0
wpForo Forum v1.4.0
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
wpforo / wpf-admin / options-tabs / general.php

general.php in wpForo Forum 1.4.0, at wpf-admin/options-tabs/general.php

106 lines 7.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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(!$wpforo->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( $wpforo->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 ($wpforo->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($wpforo->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/&#10;<?php echo esc_url( home_url('/') ) ?>hello-world/&#10; ..."
35 ><?php echo esc_textarea( $wpforo->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 = $wpforo->db->get_var("SELECT `ID` FROM `{$wpforo->db->prefix}posts` WHERE `ID` = ".intval($wpforo->pageid)." AND `post_content` LIKE '%[wpforo%' AND `post_status` LIKE 'publish' AND `post_type` IN('post', 'page')"); ?>
40 <?php if( !$wpforo->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/">' . __('suppor topic', 'wpforo') . '&raquo;</a>' . '</span>'; ?>
42 <?php else: ?>
43 <?php _e('Forum Page ID', 'wpforo'); ?>: <?php echo $wpforo->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($wpforo->general_options['title'])) wpfo( $wpforo->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($wpforo->general_options['description'])) wpfo( $wpforo->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($wpforo->general_options['menu_position'])) $wpforo->general_options['menu_position'] = 23; wpfo($wpforo->general_options['menu_position']); ?>"/>&nbsp;
63 <a href="https://developer.wordpress.org/reference/functions/add_menu_page/" target="_blank" style="text-decoration:none;">More info &raquo;</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 $wpforo->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', $wpforo ); ?>
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 ?>