/** * Makes a settings page for the plugin * * @uses bb_option_form_element() to generate the page */ function em_options() { global $em_plugopts; if ($_POST['em_opts_submit'] == 1) { /* Settings have been received, now save them! */ bb_check_admin_referer('em-save-chk'); /* Security Check */ /* Checks on options, and then save them */ $em_plugopts['link-tags'] = intval($_POST['link-tags']) == 1 ? 1 : 0; $em_plugopts['link-users'] = intval($_POST['link-users']) == 1 ? 1 : 0; $em_plugopts['link-user-to'] = $_POST['link-user-to'] == 'website' ? 'website' : 'profile'; $em_plugopts['reply-link'] = intval($_POST['reply-link']) == 1 ? 1 : 0; $em_plugopts['reply-text'] = esc_attr($_POST['reply-text']); bb_update_option(EM_OPTIONS, $em_plugopts); bb_admin_notice(__('The options were successfully saved!', 'easy-mentions')); } if ($ver = em_update_check()) { /* Check for Updates and if available, then notify */ bb_admin_notice(sprintf(__('New version (%1$s) of Easy Mentions is available! Please download the latest version from <a href="%2$s">here</a>.', 'easy-mentions'), $ver, 'http://bbpress.org/plugins/topic/easy-mentions/')); } /* Options in an array to be printed */ $options = array('link-tags' => array('title' => __('Link the Tags?', 'easy-mentions'), 'type' => 'checkbox', 'value' => $em_plugopts['link-tags'] == 1 ? '1' : '0', 'note' => sprintf(__('Check this option if you want the tags to be linked (by using %s) in the posts.', 'easy-mentions'), '<code>#tag</code>'), 'options' => array('1' => __('Yes', 'easy-mentions'))), 'link-users' => array('title' => __('Link the Users?', 'easy-mentions'), 'type' => 'checkbox', 'value' => $em_plugopts['link-users'] == 1 ? '1' : '0', 'note' => sprintf(__('Check this option if you want the users to be linked (by using %s) in the posts.', 'easy-mentions'), '<code>@user</code>'), 'options' => array('1' => __('Yes', 'easy-mentions'))), 'link-user-to' => array('title' => __('Link the user to profile or website?', 'easy-mentions'), 'type' => 'radio', 'value' => $em_plugopts['link-user-to'] == 'website' ? 'website' : 'profile', 'note' => __('If you selected the website option and the user\'s website does not exist, then the user will be linked to his or her profile page.', 'easy-mentions'), 'options' => array('profile' => __('Profile', 'easy-mentions'), 'website' => __('Website', 'easy-mentions'))), 'reply-link' => array('title' => __('Add a reply link below each post?', 'easy-mentions'), 'type' => 'checkbox', 'value' => $em_plugopts['reply-link'] == 1 ? '1' : '0', 'note' => sprintf(__('Before checking this option, please verify that there is a post form below the topic on each page. (<a href="%s">Help</a>)', 'easy-mentions'), 'http://bbpress.org/plugins/topic/easy-mentions/faq/'), 'options' => array('1' => __('Yes', 'easy-mentions'))), 'reply-text' => array('title' => __('Reply Text', 'easy-mentions'), 'class' => array('long'), 'value' => $em_plugopts['reply-text'] ? stripslashes($em_plugopts['reply-text']) : '<em>Replying to @%%USERNAME%%\'s <a href="%%POSTLINK%%">post</a>:</em>', 'after' => '<div style="clear:both;"></div>' . sprintf(__('Some HTML is allowed. The following keys can also be used:%1$s - Post\'s author\'s name%2$s - Post\'s link', 'after-the-deadline'), '<br /><strong>%%USERNAME%%</strong>', '<br /><strong>%%POSTLINK%%</strong>') . '<br />')); if ($em_plugopts['link-users'] != 1) { $options['link-user-to']['attributes'] = array('disabled' => 'disabled'); } if ($em_plugopts['reply-link'] != 1) { $options['reply-text']['attributes'] = array('disabled' => 'disabled'); } ?> <h2><?php _e('Easy Mentions', 'easy-mentions'); ?> </h2> <?php do_action('bb_admin_notices'); ?> <form method="post" class="settings options"> <fieldset> <?php foreach ($options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('em-save-chk'); ?> <input type="hidden" name="em_opts_submit" value="1"></input> <input class="submit" type="submit" name="submit" value="Save Changes" /> </fieldset> <p><?php printf(__('Happy with the plugin? Why not <a href="%1$s">buy the author a cup of coffee or two</a> or get him something from his <a href="%2$s">wishlist</a>?', 'easy-mentions'), 'http://gaut.am/donate/EM/', 'http://gaut.am/wishlist/'); ?> </p> </form> <?php }
function bb_ksd_configuration_page() { ?> <h2><?php _e('Akismet Settings'); ?> </h2> <?php do_action('bb_admin_notices'); ?> <form class="settings" method="post" action="<?php bb_uri('bb-admin/admin-base.php', array('plugin' => 'bb_ksd_configuration_page'), BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> "> <fieldset> <p><?php printf(__('For many people, <a href="%s">Akismet</a> will greatly reduce or even completely eliminate the spam you get on your site. If one does happen to get through, simply mark it as "spam" and Akismet will learn from the mistakes.'), 'http://akismet.com/'); ?> </p> <?php $after = ''; if (false !== ($key = bb_get_option('akismet_key'))) { if (bb_akismet_verify_key($key)) { $after = __('This key is valid'); } else { bb_delete_option('akismet_key'); } } bb_option_form_element('akismet_key', array('title' => __('WordPress.com API Key'), 'attributes' => array('maxlength' => 12), 'after' => $after, 'note' => sprintf(__('If you don\'t have a WordPress.com API Key, you can get one at <a href="%s">WordPress.com</a>'), 'http://wordpress.com/api-keys/'))); bb_option_form_element('akismet_stats', array('title' => __('Enable stats page'), 'type' => 'checkbox', 'options' => array(1 => __('Create a page that shows spam statistics.')), 'note' => __('This page will be viewable by moderators or higher.'))); ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-akismet-update'); ?> <input type="hidden" name="action" value="update-akismet-settings" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> <?php }
<?php do_action('bb_admin_notices'); ?> <form class="settings" method="post" action="<?php bb_uri('bb-admin/options-reading.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> "> <fieldset> <?php foreach ($reading_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-reading-update'); ?> <input type="hidden" name="action" value="update" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
<?php foreach ($recount_list as $item) { echo '<label class="checkboxs"><input type="checkbox" class="checkbox" name="' . esc_attr($item[0]) . '" id="' . esc_attr(str_replace('_', '-', $item[0])) . '" value="1" /> ' . esc_html($item[1]) . '</label>' . "\n"; } ?> </div> </div> <?php } else { ?> <p><?php _e('There are no re-count tools available.'); ?> </p> <?php } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('do-counts'); ?> <input class="submit" type="submit" name="submit" value="<?php _e('Recount Items'); ?> " /> </fieldset> </form> <?php bb_get_admin_footer();
</div> <div id="option-forum-delete-contents"> <label for="move-topics-forum"><?php _e('Replacement forum'); ?> </label> <div class="inputs"> <?php bb_forum_dropdown(array('id' => 'move_topics_forum', 'callback' => 'strcmp', 'callback_args' => array($deleted_forum->forum_id), 'selected' => $deleted_forum->forum_parent)); ?> </div> </div> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('delete-forums'); ?> <input type="hidden" name="action" value="delete" /> <input type="hidden" name="forum_id" value="<?php echo $deleted_forum->forum_id; ?> " /> <a href="<?php bb_uri('bb-admin/forums.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN); ?> " class="cancel"><?php _e('Cancel'); ?> </a> <input class="submit delete" type="submit" name="submit" value="<?php _e('Delete Forum');
<legend><?php _e('Avatars'); ?> </legend> <p> <?php _e('bbPress includes built-in support for <a href="http://gravatar.com/">Gravatars</a>. A Gravatar is an image that follows you from site to site, appearing beside your name when you comment on Gravatar enabled sites. Here you can enable the display of Gravatars on your site.'); ?> </p> <?php foreach ($avatar_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-discussion-update'); ?> <input type="hidden" name="action" value="update" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
function bb_forum_form($forum_id = 0) { $forum_id = (int) $forum_id; if ($forum_id && !($forum = bb_get_forum($forum_id))) { return; } $forum_name = ''; $forum_slug = ''; $forum_description = ''; $forum_position = ''; if ($forum_id) { $forum_name = get_forum_name($forum_id); $forum_slug = apply_filters('editable_slug', $forum->forum_slug); $forum_description = get_forum_description($forum_id); $forum_position = get_forum_position($forum_id); $legend = __('Edit Forum'); $submit = __('Save Changes'); $action = 'update'; } else { $legend = __('Add Forum'); $submit = __('Add Forum'); $action = 'add'; } $forum_options = array('forum_name' => array('title' => __('Name'), 'value' => $forum_name), 'forum_slug' => array('title' => __('Slug'), 'value' => $forum_slug), 'forum_desc' => array('title' => __('Description'), 'value' => $forum_description, 'class' => 'long'), 'forum_parent' => array('title' => __('Parent'), 'type' => 'select', 'options' => bb_get_forum_dropdown(array('cut_branch' => $forum_id, 'id' => 'forum_parent', 'none' => true, 'selected' => $forum_id ? get_forum_parent($forum_id) : 0, 'disable_categories' => 0, 'options_only' => true))), 'forum_order' => array('title' => __('Position'), 'value' => $forum_position, 'class' => 'short'), 'forum_is_category' => array('title' => __('Category'), 'type' => 'checkbox', 'options' => array(1 => array('label' => __('Make this forum a category'), 'value' => bb_get_forum_is_category($forum_id))), 'note' => __('Categories are forums where new topics cannot be created. Categories usually contain a group of sub-forums.'))); if (!$forum_id) { unset($forum_options['forum_slug']); unset($forum_options['forum_order']); } ?> <form class="settings" method="post" id="<?php echo $action; ?> -forum" action="<?php bb_uri('bb-admin/bb-forum.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> " class="add:forum-list: forum-form"> <fieldset> <legend><?php echo $legend; ?> </legend> <?php foreach ($forum_options as $option => $args) { bb_option_form_element($option, $args); } ?> <fieldset class="submit"> <?php if ($forum_id) { ?> <input type="hidden" name="forum_id" value="<?php echo $forum_id; ?> " /> <?php } ?> <?php bb_nonce_field('order-forums', 'order-nonce'); ?> <?php bb_nonce_field($action . '-forum'); ?> <input type="hidden" name="action" value="<?php echo $action; ?> " /> <input class="submit" type="submit" name="submit" value="<?php echo $submit; ?> " /> </fieldset> </fieldset> </form> <?php }
"> <legend><?php _e('Custom user tables'); ?> </legend> <p><?php _e('Only set these values if your user tables differ from the default NXTClass naming convention.'); ?> </p> <?php foreach ($custom_table_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-nxtclass-update-options'); ?> <input type="hidden" name="action" value="update-options" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
<legend><?php _e('Remote Publishing'); ?> </legend> <p> <?php _e('To interact with bbPress from a desktop client or remote website that uses the XML-RPC publishing interface you must enable it below.'); ?> </p> <?php foreach ($remote_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-writing-update'); ?> <input type="hidden" name="action" value="update" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
echo esc_attr($value); ?> "><?php echo esc_html($label); ?> </option> <?php } ?> </select> <input type="submit" value="<?php esc_attr_e('Apply'); ?> " class="button submit-input" /> <?php bb_nonce_field('topic-bulk'); ?> </fieldset> <div class="tablenav"> <?php if ($topic_query->found_rows) { ?> <div class="tablenav-pages"> <span class="displaying-num"><?php echo $displaying_num = sprintf(__('%1$s to %2$s of %3$s'), bb_number_format_i18n(($page - 1) * $topic_query->get('per_page') + 1), $page * $topic_query->get('per_page') < $topic_query->found_rows ? bb_number_format_i18n($page * $topic_query->get('per_page')) : '<span class="total-type-count">' . bb_number_format_i18n($topic_query->found_rows) . '</span>', '<span class="total-type-count">' . bb_number_format_i18n($topic_query->found_rows) . '</span>'); ?> </span><span class="displaying-pages"> <?php $_page_link_args = array('page' => $page, 'total' => $topic_query->found_rows, 'per_page' => $topic_query->get('per_page'), 'mod_rewrite' => false, 'prev_text' => __('«'), 'next_text' => __('»')); echo $page_number_links = get_page_number_links($_page_link_args);
function li_configuration_page() { ?> <h2><?php _e('Linkedin Connect Settings'); ?> </h2> <?php do_action('bb_admin_notices'); ?> <form class="settings" method="post" action="<?php bb_uri('bb-admin/admin-base.php', array('plugin' => 'li_configuration_page'), BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> "> <p>A LinkedIn Application ID and Secret Key are needed. These can be obtained from <a href="https://www.linkedin.com/secure/developer">Linkedin developer pages</a>.</p> <p>Remember to check that OAuth 2.0 support is enabled. This setting is located under Advanced-tab of your LinkedIn application page.</p> <fieldset class="submit"> <?php bb_option_form_element('li_app_id', array('title' => __('LinkedIn Application ID'), 'attributes' => array('maxlength' => 20), 'after' => '[Alphanumeric] Example: aQw3728er2')); bb_option_form_element('li_secret', array('title' => __('Linkedin Application Secret'), 'attributes' => array('maxlength' => 40), 'after' => "[Alphanumeric] Example: abcdef123456abcdef123456abcdef123456")); bb_option_form_element('li_displayname_from', array('title' => __('Set as Display Name'), 'type' => 'select', 'options' => array(0 => __('Full Name'), 1 => __('First Name'), 2 => __('Last Name')), 'after' => "The users Display Name will be set to this value as provided by LinkedIn")); bb_option_form_element('li_allow_useredit', array('title' => __('Allow User Edit'), 'type' => 'checkbox', 'options' => array(1 => __('Allow users to edit their own profile information, such as first name, last name and display name')))); bb_option_form_element('li_request_email', array('title' => __('Request Real Email'), 'type' => 'checkbox', 'options' => array(1 => __('Request users real email address from LinkedIn (user must accept this). A dummy email is set to new users if this is disabled.')))); bb_option_form_element('li_hide_post_login', array('title' => __('Hide login in post form'), 'type' => 'checkbox', 'options' => array(1 => __('Hide the "You must login to reply" in post-form for non-logged in users. This links to the traditional login page otherwise, which LinkedIn Connected users cannot use.')))); bb_option_form_element('li_get_jquery', array('title' => __('Include jQuery (require version 1.6+)'), 'type' => 'checkbox', 'options' => array(1 => __('Includes latest jQuery API from Google APIs.')))); ?> <?php bb_nonce_field('options-liconnect-update'); ?> <input type="hidden" name="action" value="update-li-settings" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> <?php }
function nospamuser_admin() { $settings = bb_get_option('nospamuser-settings'); $options = array('days' => array('title' => __('Maximum days', 'nospamuser'), 'note' => __('Any possible spammer that was last active over this many days ago will be allowed through.', 'nospamuser'), 'class' => 'short', 'value' => $settings['days']), 'min_occur' => array('title' => __('Minimum frequency', 'nospamuser'), 'note' => __('Any possible spammer that do not have at least this many reports will be allowed through.', 'nospamuser'), 'class' => 'short', 'value' => $settings['min_occur']), 'max_occur' => array('title' => __('Maximum frequency', 'nospamuser'), 'note' => __('Possible spammers that have at least this many reports will be disallowed in adaptive mode. This also affects agressive mode, where spammers with at least this many reports will be blocked even if the maximum days prerequisite is not met.', 'nospamuser'), 'class' => 'short', 'value' => $settings['max_occur']), 'api_key' => array('title' => __('Stop Forum Spam API key', 'nospamuser'), 'note' => __('Required to submit spammers to Stop Forum Spam. <a href="http://www.stopforumspam.com/signup">Get a Stop Forum Spam API key here</a>.', 'nospamuser'), 'class' => array('code', 'long'), 'value' => $settings['api_key']), 'recaptcha_mode' => array('title' => __('reCAPTCHA mode', 'nospamuser'), 'note' => __('All modes except aggressive require reCAPTCHA public and private keys.', 'nospamuser'), 'type' => 'radio', 'options' => array('aggressive' => __('<strong>Aggressive:</strong> Never allow possible spammers to override blocks.', 'nospamuser'), 'adaptive' => __('<strong>Adaptive:</strong> Allow possible spammers between the minimum and maximum frequency to override blocks.', 'nospamuser'), 'friendly' => __('<strong>Friendly:</strong> Allow all possible spammers to override blocks.', 'nospamuser')), 'value' => $settings['recaptcha_mode']), 'recaptcha_pub' => array('title' => __('reCAPTCHA public key', 'nospamuser'), 'note' => sprintf(__('<a href="%s">Get it here</a>.', 'nospamuser'), 'http://recaptcha.net/api/getkey?domain=' . urlencode($_SERVER['SERVER_NAME']) . '&app=bb-NoSpamUser'), 'class' => array('code', 'long'), 'value' => $settings['recaptcha_pub']), 'recaptcha_priv' => array('title' => __('reCAPTCHA private key', 'nospamuser'), 'note' => sprintf(__('<a href="%s">Get it here</a>.', 'nospamuser'), 'http://recaptcha.net/api/getkey?domain=' . urlencode($_SERVER['SERVER_NAME']) . '&app=bb-NoSpamUser'), 'class' => array('code', 'long'), 'value' => $settings['recaptcha_priv']), 'stats-public' => array('title' => __('Public statistics', 'nospamuser'), 'type' => 'radio', 'options' => array(0 => __('Keep all statistics private', 'nospamuser'), 1 => sprintf(__('Display the number of caught spammers on the <a href="%s">statistics page</a>.', 'nospamuser'), bb_get_uri('statistics.php'))), 'value' => $settings['stats-public'] ? $settings['stats-public'] : 0)); ?> <h2><?php _e('bb-NoSpamUser', 'nospamuser'); ?> </h2> <?php do_action('bb_admin_notices'); ?> <form class="settings" method="post" action="<?php bb_uri('bb-admin/admin-base.php', array('plugin' => 'nospamuser_admin'), BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> "> <fieldset> <?php foreach ($options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('nospamuser-admin'); ?> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> <?php if ($blocks = (int) bb_get_option('nospamuser-blocks')) { ?> <div style="font-size: .75em; position: absolute; bottom: 50px; right: 5px"><?php printf(_n('%s spammer blocked by bb-NoSpamUser', '%s spammers blocked by bb-NoSpamUser', $blocks, 'nospamuser'), bb_number_format_i18n($blocks)); ?> </div> <?php } }
function topic_move_dropdown($id = 0) { $topic = get_topic(get_topic_id($id)); if (!bb_current_user_can('move_topic', $topic->topic_id)) { return; } $dropdown = bb_get_forum_dropdown(array('callback' => 'bb_current_user_can', 'callback_args' => array('move_topic', $topic->topic_id), 'selected' => $topic->forum_id)); if (!$dropdown) { return; } echo '<form id="topic-move" method="post" action="' . bb_get_uri('bb-admin/topic-move.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN) . '">' . "\n\t"; echo "<input type='hidden' name='topic_id' value='{$topic->topic_id}' />\n\t"; echo $dropdown; bb_nonce_field('move-topic_' . $topic->topic_id); echo "<input class='button-secondary' type='submit' name='Submit' value='" . __('Move') . "' />\n</form>"; }
"> <fieldset> <p> <?php _e('By default bbPress uses web URLs which have question marks and lots of numbers in them, however bbPress offers you the ability to choose an alternative URL structure for your permalinks. This can improve the aesthetics, usability, and forward-compatibility of your links.'); ?> </p> <?php foreach ($permalink_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-permalinks-update'); ?> <input type="hidden" name="action" value="update" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> <?php if ($manual_instructions) { ?> <form class="settings" method="post" action="<?php bb_uri('bb-admin/options-permalinks.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>
} } ?> <p class="submit right"> <input type="submit" name="Submit" value="<?php echo esc_attr__('Update Profile »'); ?> " /> </p> </form> <form method="post" action="<?php profile_tab_link($user->ID, 'edit'); ?> "> <p class="submit left"> <?php bb_nonce_field('edit-profile_' . $user->ID); ?> <?php user_delete_button(); ?> </p> </form> <?php bb_get_footer();
function manage_tags_forms() { global $tag; if (!bb_current_user_can('manage_tags')) { return false; } $form = '<ul id="manage-tags">' . "\n"; $form .= '<li id="tag-rename">' . __('Rename tag:') . "\n\t"; $form .= '<form method="post" action="' . bb_get_uri('bb-admin/tag-rename.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN) . '"><div>' . "\n\t"; $form .= '<input type="text" name="tag" size="10" maxlength="30" />' . "\n\t"; $form .= '<input type="hidden" name="id" value="' . $tag->tag_id . '" />' . "\n\t"; $form .= "<input type='submit' name='Submit' value='" . __('Rename') . "' />\n\t"; echo $form; bb_nonce_field('rename-tag_' . $tag->tag_id); echo "\n\t</div></form>\n </li>\n "; $form = "<li id='tag-merge'>" . __('Merge this tag into:') . "\n\t"; $form .= "<form method='post' action='" . bb_get_uri('bb-admin/tag-merge.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN) . "'><div>\n\t"; $form .= "<input type='text' name='tag' size='10' maxlength='30' />\n\t"; $form .= "<input type='hidden' name='id' value='{$tag->tag_id}' />\n\t"; $form .= "<input type='submit' name='Submit' value='" . __('Merge') . "' "; $form .= 'onclick="return confirm(\'' . esc_js(sprintf(__('Are you sure you want to merge the "%s" tag into the tag you specified? This is permanent and cannot be undone.'), $tag->raw_tag)) . "');\" />\n\t"; echo $form; bb_nonce_field('merge-tag_' . $tag->tag_id); echo "\n\t</div></form>\n </li>\n "; $form = "<li id='tag-destroy'>" . __('Destroy tag:') . "\n\t"; $form .= "<form method='post' action='" . bb_get_uri('bb-admin/tag-destroy.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN) . "'><div>\n\t"; $form .= "<input type='hidden' name='id' value='{$tag->tag_id}' />\n\t"; $form .= "<input type='submit' name='Submit' value='" . __('Destroy') . "' "; $form .= 'onclick="return confirm(\'' . esc_js(sprintf(__('Are you sure you want to destroy the "%s" tag? This is permanent and cannot be undone.'), $tag->raw_tag)) . "');\" />\n\t"; echo $form; bb_nonce_field('destroy-tag_' . $tag->tag_id); echo "\n\t</div></form>\n </li>\n</ul>"; }
echo esc_attr($value); ?> "><?php echo esc_html($label); ?> </option> <?php } ?> </select> <input type="submit" value="<?php esc_attr_e('Apply'); ?> " class="button submit-input" /> <?php bb_nonce_field('post-bulk'); ?> </fieldset> <div class="tablenav"> <?php if ($total) { ?> <div class="tablenav-pages"> <span class="displaying-num"><?php echo $displaying_num = sprintf(__('%1$s to %2$s of %3$s'), bb_number_format_i18n(($page - 1) * $post_query->get('per_page') + 1), $page * $post_query->get('per_page') < $total ? bb_number_format_i18n($page * $post_query->get('per_page')) : '<span class="total-type-count">' . bb_number_format_i18n($total) . '</span>', '<span class="total-type-count">' . bb_number_format_i18n($total) . '</span>'); ?> </span><span class="displaying-pages"> <?php $_page_link_args = array('page' => $page, 'total' => $total, 'per_page' => $post_query->get('per_page'), 'mod_rewrite' => false, 'prev_text' => __('«'), 'next_text' => __('»')); echo $page_number_links = get_page_number_links($_page_link_args);
</fieldset> <?php $bb_install->input_buttons('forward_3_0'); ?> </form> <?php break; case 'complete': ?> <form action="install.php" method="post"> <?php $bb_install->messages(); ?> <fieldset> <?php bb_nonce_field('bbpress-installer'); ?> </fieldset> <?php $bb_install->hidden_step_inputs(2); $bb_install->hidden_step_inputs(); // The current step (3) is assumed here $bb_install->input_buttons('forward_3_1', 'back_3_1', 4); ?> </form> <?php break; } } $bb_install->step_footer(); if ($bb_install->step === 4) {
"> <legend><?php _e('Custom user tables'); ?> </legend> <p><?php _e('Only set these values if your user tables differ from the default WordPress naming convention.'); ?> </p> <?php foreach ($custom_table_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-wordpress-update-options'); ?> <input type="hidden" name="action" value="update-options" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
?> </noscript> <script type="text/javascript" charset="utf-8"> if (typeof jQuery != 'undefined') { jQuery('#user-login').attr( 'id', 'user_login' ); var meter = ('<div id="pass-strength-result">' + pwsL10n.short + '</div>'); jQuery('#option-pass-strength-fake-input div.inputs input').before( meter ); } else { document.writeln('<?php echo str_replace("'", "\\'", __('Disabled.')); ?> ') } </script> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('user-manage'); ?> <input type="hidden" name="action" value="create" /> <input class="submit" type="submit" name="submit" value="<?php _e('Create user'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
<form class="settings" method="post" action="<?php bb_uri('bb-admin/options-general.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> "> <fieldset> <?php foreach ($general_options as $option => $args) { bb_option_form_element($option, $args); } foreach ($time_options as $option => $args) { bb_option_form_element($option, $args); } ?> </fieldset> <fieldset class="submit"> <?php bb_nonce_field('options-general-update'); ?> <input type="hidden" name="action" value="update" /> <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes'); ?> " /> </fieldset> </form> </div> <?php bb_get_admin_footer();
_e('Database upgrade failed'); ?> </h2> <div> <form action="<?php bb_uri('bb-admin/upgrade.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?> " method="post"> <p class="error"> <?php _e('The upgrade process seems to have failed. Check the upgrade messages below for more information.<br /><br />Attempting to go to the admin area without resolving the listed errors will return you to this upgrade page.'); ?> </p> <fieldset> <?php bb_nonce_field('bbpress-upgrader'); ?> <?php echo $forced_input; ?> <label class="has-label for-toggle" for="upgrade_log_container_toggle" style="margin-bottom: 1.9em;"> <span> <?php _e('Show upgrade messages'); ?> <input class="checkbox" type="checkbox" id="upgrade_log_container_toggle" value="1" onclick="toggleAdvanced('upgrade_log_container_toggle', 'upgrade_log_container');" /> </span> <div class="clear"></div> </label> </fieldset> <div class="toggle" id="upgrade_log_container" style="display:none;">
function mass_edit() { if (!bb_current_user_can('browse_deleted')) { die(__("Now how'd you get here? And what did you think you'd be doing?")); } add_action('bb_get_option_page_topics', 'mass_edit_topic_limit', 250); global $bbdb, $bb_post_cache, $bb_user_cache, $bb_posts, $bb_post, $page, $mass_edit_options; if (isset($_GET['mass_edit_reset'])) { bb_delete_option('mass_edit_options'); wp_redirect(remove_query_arg(array('mass_edit_options', 'mass_edit_reset'))); } if (!empty($_POST['mass_edit_save_options'])) { $mass_edit_options['mass_edit_columns'] = implode(",", array_unique(array_map('trim', explode(",", strtolower(stripslashes($_POST['mass_edit_columns'] . ", checkbox , excerpt , name , meta , actions")))))); $mass_edit_options['mass_edit_css'] = stripslashes($_POST['mass_edit_css']); bb_update_option('mass_edit_options', $mass_edit_options); wp_redirect(remove_query_arg(array('mass_edit_options', 'mass_edit_reset'))); // may not work since headers are already sent } echo '<div style="text-align:right;margin-bottom:-1.5em;">'; if (isset($_GET['mass_edit_options'])) { echo '[ <a href="' . bb_get_admin_tab_link("mass_edit") . '&mass_edit_reset=1">Reset To Defaults</a> ]'; } else { echo '[ <a href="' . bb_get_admin_tab_link("mass_edit") . '&mass_edit_options=1">Settings</a> ]'; } echo '</div>'; echo "<h2><a style='color:black;border:0;text-decoration:none;' href='" . bb_get_admin_tab_link("mass_edit") . "'>" . __('Mass Edit') . "</a></h2>"; if (!isset($mass_edit_options)) { $mass_edit_options = bb_get_option('mass_edit_options'); } if (!isset($mass_edit_options['mass_edit_columns']) || is_array($mass_edit_options['mass_edit_columns'])) { $mass_edit_options['mass_edit_columns'] = "checkbox , excerpt , name , meta , actions"; bb_update_option('mass_edit_options', $mass_edit_options); } $mass_edit_columns = explode(",", strtolower($mass_edit_options['mass_edit_columns'])); array_walk($mass_edit_columns, create_function('&$arr', '$arr=trim($arr);')); if (isset($_GET['mass_edit_options'])) { ?> <form action="<?php echo bb_get_admin_tab_link("mass_edit"); ?> " method="post" id="mass-edit-options"> <fieldset><legend><strong>Mass Edit Column Order</strong> - default: checkbox , excerpt , name , meta , actions</legend> <input name="mass_edit_columns" id="mass_edit_columns" type="text" size="50" value="<?php echo $mass_edit_options['mass_edit_columns']; ?> " /> <span style="padding-left:2em;" class=submit><input class=submit type="submit" name="mass_edit_save_options" value="<?php _e('Save Options'); ?> »" /></span> </fieldset> <fieldset><legend><b>Mass Edit CSS</b></legend> <textarea name="mass_edit_css" id="mass_edit_css" cols="100" rows="10"><?php echo $mass_edit_options['mass_edit_css']; ?> </textarea> </fieldset> </form> <br clear=both /> <hr /> <?php } /* add_filter( 'get_topic_where', 'no_where' ); add_filter( 'get_topic_link', 'bb_make_link_view_all' ); $bb_post_query = new BB_Query_Form( 'post',array( 'post_status' => 0, 'count' => true )); $bb_posts =& $bb_post_query->results; $total = $bb_post_query->found_rows; */ if (!empty($_POST['mass_edit_delete_posts'])) { bb_check_admin_referer('mass-edit-bulk-posts'); $i = 0; $bbdb->hide_errors(); // bbPress still has some db function issues with topic delete/undelete foreach ($_POST['mass_edit_delete_posts'] as $bb_post_id) { // Check the permissions on each $bb_post_id = (int) $bb_post_id; // $bb_post_id = $bbdb->get_var("SELECT post_id FROM $bbdb->posts WHERE post_id = $bb_post"); // $authordata = bb_get_usermeta( $bbdb->get_var("SELECT poster_id FROM $bbdb->posts WHERE ID = $bb_post_id") ); if (bb_current_user_can('delete_posts', $bb_post_id)) { if (!empty($_POST['mass_edit_spam_button'])) { bb_delete_post($bb_post_id, 2); } if (!empty($_POST['mass_edit_delete_button'])) { bb_delete_post($bb_post_id, 1); } if (!empty($_POST['mass_edit_undelete_button'])) { bb_delete_post($bb_post_id, 0); } ++$i; } } $bbdb->show_errors(); // bbPress still has some db function issues with topic delete/undelete // $bbdb->flush(); // global $bb_cache,$bb_post_cache, $bb_topic_cache; unset($bb_cache); unset($bb_post_cache); unset($bb_topic_cache); echo '<div id="message" class="updated fade" style="clear:both;"><p>'; if (!empty($_POST['mass_edit_spam_button'])) { printf(__('%s posts marked as spam.'), $i); } if (!empty($_POST['mass_edit_delete_button'])) { printf(__('%s posts deleted.'), $i); } if (!empty($_POST['mass_edit_undelete_button'])) { printf(__('%s posts undeleted.'), $i); } echo '</p></div>'; } if (isset($_GET['post_text'])) { $post_text = substr($bbdb->escape($_GET['post_text']), 0, 100); } else { $post_text = ""; } if (isset($_GET['post_author'])) { $post_author = substr($bbdb->escape($_GET['post_author']), 0, 30); } else { $post_author = ""; } if (isset($_GET['post_status'])) { $post_status = substr($bbdb->escape($_GET['post_status']), 0, 3); } else { $post_status = "0"; } if (isset($_GET['post_order'])) { $post_order = $_GET['post_order'] == "ASC" ? "ASC" : "DESC"; } else { $post_order = "DESC"; } if (isset($_GET['exact_match'])) { $exact_match = intval($_GET['exact_match']); } else { $exact_match = 0; } if (isset($_GET['per_page'])) { $per_page = intval(substr($bbdb->escape($_GET['per_page']), 0, 3)); } else { $per_page = "20"; } $offset = (intval($page) - 1) * $per_page; // if (isset($_GET['page'])) {} else {$offset = 0;} $query = " FROM {$bbdb->posts} "; if ($post_text || $post_author || $post_status != "all") { $query .= " WHERE "; } if ($post_text) { if ($exact_match) { $query .= " (post_text REGEXP '[[:<:]]" . $post_text . "[[:>:]]'\tOR poster_ip = '" . $post_text . "') "; } else { $query .= " (post_text LIKE '%{$post_text}%' OR poster_ip LIKE '%{$post_text}%' ) "; } } if ($post_author) { $authors = "SELECT ID FROM {$bbdb->users} WHERE "; $authors .= $exact_match ? " (user_login REGEXP '[[:<:]]" . $post_author . "[[:>:]]') " : " (user_login LIKE '%{$post_author}%') "; $authors .= " LIMIT 99"; if ($authors = $bbdb->get_results($authors)) { if (is_array($authors)) { foreach ($authors as $key => $value) { $trans[] = $value->ID; } $authors = join(',', $trans); } } else { $authors = "-1"; } $query .= ($post_text ? " AND " : "") . " poster_id IN ({$authors}) "; } if ($post_status != "all") { $query .= ($post_text || $authors ? " AND " : "") . " post_status = '{$post_status}' "; } $restrict = " ORDER BY post_time {$post_order} LIMIT {$offset},{$per_page}"; // echo $query; // diagnostic $total = $bbdb->get_var("SELECT COUNT(*) " . $query); // intval(bb_count_last_query($query)); if ($total) { $bb_posts = $bbdb->get_results("SELECT * " . $query . $restrict); } else { unset($bb_posts); } ?> <form action="<?php echo bb_get_admin_tab_link("mass_edit"); ?> " method="get" id="post-search-form" class="search-form"> <fieldset><legend><?php _e('Show Posts or IPs That Contain …'); ?> </legend> <input name="post_text" id="post-text" class="text-input" type="text" value="<?php echo wp_specialchars($post_text); ?> " size="30" /> </fieldset> <?php /* selection by forum and tag not included in initial versions <fieldset><legend>Forum …</legend> <select name="forum_id" id="forum-id" tabindex="5"> <option value="0">Any</option> <option value="1"> bbPress chat</option> </select> </fieldset> <fieldset><legend>Tag…</legend> <input name="tag" id="topic-tag" class="text-input" value="" type="text" /> </fieldset> */ ?> <fieldset><legend>Post Author…</legend> <input name="post_author" id="post-author" class="text-input" type="text" value="<?php if (isset($_GET['post_author'])) { echo wp_specialchars($_GET['post_author'], 1); } ?> " /> </fieldset> <fieldset><legend>Post Status …</legend> <select name="post_status" id="post-status"> <option value="0" <?php echo $post_status == 0 ? 'selected="selected"' : ''; ?> >Visible</option> <option value="1" <?php echo $post_status == 1 ? 'selected="selected"' : ''; ?> >Deleted</option> <option value="2" <?php echo $post_status == 2 ? 'selected="selected"' : ''; ?> >Spam</option> <option value="all" <?php echo $post_status == "all" ? 'selected="selected"' : ''; ?> >All</option> </select> </fieldset> <fieldset><legend>Sort Order …</legend> <select name="post_order" id="post-order"> <option value="DESC" <?php echo $post_order == "DESC" ? 'selected="selected"' : ''; ?> >Newest</option> <option value="ASC" <?php echo $post_order == "ASC" ? 'selected="selected"' : ''; ?> >Oldest</option> </select> </fieldset> <fieldset><legend>Per Page</legend> <select name="per_page" id="per-page"> <option value="20" <?php echo $per_page == 20 ? 'selected="selected"' : ''; ?> >20</option> <option value="50" <?php echo $per_page == 50 ? 'selected="selected"' : ''; ?> >50</option> <option value="100" <?php echo $per_page == 100 ? 'selected="selected"' : ''; ?> >100</option> </select> </fieldset> <fieldset><legend>Exact Match</legend> <input type="hidden" name="plugin" value="mass_edit" /> <span style="padding-left:1em;"><input style="height:1.4em;width:1.4em;" name="exact_match" id="exact-match" class="checkbox" type="checkbox" value="1" <?php echo $exact_match ? 'checked="checked"' : ''; ?> /></span> <span style="padding-left:1em;" class=submit><input class=submit type="submit" name="submit" value="<?php _e('Search'); ?> »" /></span> </fieldset> </form> <?php if ($total) { echo $pagelinks = "<p style='clear:left'>[ " . ($total > $per_page ? "showing " . (($page - 1) * $per_page + 1) . " - " . ($total < $page * $per_page ? $total : $page * $per_page) . " of " : "") . "{$total} posts found ] " . '<span style="padding-left:1em">' . get_page_number_links($page, $total) . "</span></p>"; } if ($bb_posts) { // lazy cache loading to radically reduce query count foreach ($bb_posts as $bb_post) { $users[$bb_post->poster_id] = $bb_post->poster_id; $topics[$bb_post->topic_id] = $bb_post->topic_id; } bb_cache_users($users); unset($users); $topics = join(',', $topics); $topics = $bbdb->get_results("SELECT topic_id,topic_title,topic_slug FROM {$bbdb->topics} WHERE topic_id IN ({$topics})"); $topics = bb_append_meta($topics, 'topic'); unset($topics); echo '<form name="deleteposts" id="deleteposts" action="" method="post"> '; bb_nonce_field('mass-edit-bulk-posts'); echo '<table class="widefat"> <thead> <tr>'; foreach ($mass_edit_columns as $position) { switch ($position) { case "checkbox": echo '<th scope="col"><input type="checkbox" onclick="checkAll(this,document.getElementById(\'deleteposts\'));" /></th>'; break; case "excerpt": echo '<th scope="col" width="90%">' . __('Post Excerpt') . '</th>'; break; case "name": echo '<th scope="col">' . __('Name') . '</th>'; break; case "meta": echo '<th scope="col">' . __('Meta') . '</th>'; break; case 'actions': echo '<th scope="col" colspan="2">' . __('Actions') . '</th>'; break; } } echo '</tr></thead>'; foreach ($bb_posts as $bb_post) { $bb_post_cache[$bb_post->post_id] = $bb_post; // yes this is naughty but lazy workaround for using internal functions without extra mysql queries switch ($bb_post->post_status) { case 0: $del_class = ''; break; case 1: $del_class = 'deleted'; break; case 2: $del_class = 'spam'; break; default: $del_class = apply_filters('post_del_class', $bb_post->post_status, $bb_post->post_id); } ?> <tr id="post-<?php echo $bb_post->post_id; ?> " <?php alt_class('post', $del_class); ?> > <?php foreach ($mass_edit_columns as $position) { switch ($position) { case "checkbox": ?> <td><?php if (bb_current_user_can('edit_post', $bb_post->post_id)) { ?> <input type="checkbox" name="mass_edit_delete_posts[]" value="<?php echo $bb_post->post_id; ?> " /><?php } ?> </td> <?php break; case "excerpt": ?> <td><?php echo "<a class=metext href='" . mass_edit_get_post_link() . "'>[<strong>" . get_topic_title($bb_post->topic_id) . "</strong>] " . mass_edit_scrub_text($bb_post->post_text, $post_text, 45, $exact_match) . '</a>'; ?> </td> <?php break; case "name": ?> <td><a href="<?php echo attribute_escape(get_user_profile_link($bb_post->poster_id)); ?> "><?php echo get_user_name($bb_post->poster_id); ?> </a></td> <?php break; case "meta": ?> <td><span class=timetitle title="<?php echo date("r", strtotime(bb_get_post_time())); ?> "><?php printf(__('%s ago'), bb_get_post_time()); ?> </span> <?php post_ip_link(); ?> </td> <?php break; case "actions": ?> <td><a href="<?php post_link(); ?> "><?php _e('View'); ?> </a> <?php if (bb_current_user_can('edit_post', $bb_post->post_id)) { post_edit_link(); } ?> </td> <td><?php if (bb_current_user_can('edit_post', $bb_post->post_id)) { post_delete_link(); } ?> </td> <?php } } echo '</tr>'; } // end foreach unset($bb_posts); ?> </table> <?php if ($total) { echo $pagelinks; } ?> <p class="submit"> <input type="submit" class="deleted" name="mass_edit_delete_button" value="<?php _e('Delete Checked posts »'); ?> " onclick="var numchecked = getNumChecked(document.getElementById('deleteposts')); if(numchecked < 1) { alert('<?php _e("Please select some posts to delete"); ?> '); return false } return confirm('<?php printf(__("You are about to delete %s posts \\n \\'Cancel\\' to stop, \\'OK\\' to delete."), "' + numchecked + '"); ?> ')" /> <input type="submit" class="spam" name="mass_edit_spam_button" value="<?php _e('Mark Checked posts as Spam »'); ?> " onclick="var numchecked = getNumChecked(document.getElementById('deleteposts')); if(numchecked < 1) { alert('<?php _e("Please select some posts to mark as spam"); ?> '); return false } return confirm('<?php printf(__("You are about to mark %s posts as spam \\n \\'Cancel\\' to stop, \\'OK\\' to spam."), "' + numchecked + '"); ?> ')" /> <input type="submit" class="normal" name="mass_edit_undelete_button" value="<?php _e('Undelete Checked posts »'); ?> " onclick="var numchecked = getNumChecked(document.getElementById('deleteposts')); if(numchecked < 1) { alert('<?php _e("Please select some posts to delete"); ?> '); return false } return confirm('<?php printf(__("You are about to undelete %s posts \\n \\'Cancel\\' to stop, \\'OK\\' to undelete."), "' + numchecked + '"); ?> ')" /> </form> <div id="ajax-response"></div> <?php } else { ?> <p style="clear:both;"> <?php if ($exact_match) { echo " <strong>" . __('No results found for exact match.') . " "; echo ' <a href="' . attribute_escape(remove_query_arg('exact_match')) . '">' . __("Try non-exact?") . '</a></strong> '; } else { echo "<strong>" . __('No results found.') . "</strong>"; } ?> </p> <?php } // end if ($bb_posts) ?> </div> <?php }