Search Results for 'code'
-
AuthorSearch Results
-
February 14, 2015 at 2:01 pm #158442
In reply to: Layout in progress
peter-hamilton
ParticipantHi Robkk, thanks for having a look again.
I agree with the profile nav and am changing that next, have just downloaded the plugin you mentioned and will have a look at it, looks a lot bigger then the code I am using…but has a lot more functions I like to include like sharing those backgrounds on activity etc, will use it tomorrow.
I also removed all Epicweb stuff so the forums page looks normal again, I was long focused on creating the right category/forum list, but ended up using a page with shortcodes in the end, so that code was just clutter anyway, so thanks again.
Peter Hamilton
February 14, 2015 at 1:34 pm #158440In reply to: Remove About Author from the Forums
Robkk
Moderatorusually creating the bbpress.php file and removing the about author code should fix it
February 14, 2015 at 12:40 pm #158426In reply to: My Account Link on this site
Robkk
ModeratorDoes anyone know if this is a plugin or is this all back end coded?
its all custom code
The more I look at it, it appears to be the core WordPress “Howdy, User” admin bar
that it , even in the source it says
#wpadminbarFebruary 14, 2015 at 12:26 pm #158423In reply to: Oh Brother…
Robkk
Moderatorok so copy page.php and rename the copied version to bbpress.php and make sure its at the root of your theme with the page.php file and single.php file and see if it works.
you can test it out by removing the
<?php get_sidebar(); ?>code and see if the sidebar is removed only on bbpress pages and posts.February 14, 2015 at 10:35 am #158419In reply to: Error in permalink
Robkk
Moderatoryeah this could happen on an active site especially if a popular topic is posted after post #1001
then someone bumped the topic to #4938
you can check and see if a popular topic was posted between these posts by checking some topics post time.
you can show consecutive numbers though starting from #1 on each topic using
bbp_reply_position()to replace the reply id in loop-single-reply.phpbut if a spam post comes in it wont be consecutive anymore it will skip a few
February 14, 2015 at 10:21 am #158415In reply to: remove anonymous website field
Robkk
Moderatoryou can also hide it with CSS since it isnt required
i also included the topic form website field
.bbp-reply-form #bbp_anonymous_website, .bbp-topic-form #bbp_anonymous_website, label[for="bbp_anonymous_website"] { display: none !important; }February 14, 2015 at 9:49 am #158411In reply to: Oh Brother…
Robkk
Moderatorat the very top you posted code for your bbpress.php file
it isnt suppose to have code for the bbpress archive-forum.php file it is suppose to be similar to the themes page.php file nothing else.
maybe you doing the bbpress.php file incorrectly caused the issue.
February 14, 2015 at 9:38 am #158409In reply to: Virus in 'agyp' bbpress theme?
Robkk
Moderatoryou should follow this just in case you were hacked
February 14, 2015 at 8:00 am #158404In reply to: Edit the bbPress login widget
Robkk
Moderatoreveryone is trying to help you out so any code, suggestions is for you and your issue.
to help with the button because it looks to close to the input box try this css code
.bbp-login-form .bbp-submit-wrapper { margin-top: 10px; }February 14, 2015 at 7:31 am #158402In reply to: Change Font Color 'Error:'
Robkk
Moderatordoes this custom CSS help you
div.bbp-template-notice, div.indicator-hint { color: #fff; }February 14, 2015 at 7:15 am #158399In reply to: Subscription email notifications not working
Robkk
Moderatorthey mostly communicate on SLACK especially a meeting on Wednesdays.. they do creep the forums sometimes though
Any idea how I can get this to the attention of one of the authors
you could go on slack in the #bbpress channel and notify @jjj , there was another user who had an issue with subscriptions and he might look into it.
@robin-w you might as well check the slack channel too , especially on WednesdaysFebruary 14, 2015 at 6:49 am #158398In reply to: Display Forum Roles above Member Avatar in Topics
Robkk
Moderatoryou can also call the bbp reply link link three times but removes some arguments you dont want to show and only show the ones you want.
<?php bbp_reply_author_link( array('show_role' => true, 'type' => 'role' ) ); ?> <?php bbp_reply_author_link( array( 'show_role' => false, 'type' => avatar , 'size' => auto ) ); ?> <?php bbp_reply_author_link( array( 'show_role' => false,'type' => 'name' ) ); ?>February 14, 2015 at 6:38 am #158397Topic: BBPress is very slow on my 750k post site
in forum TroubleshootingDuncanMarshall
ParticipantIt seems this is a known issue for WordPress when ordering by meta query. BBPress does this to order by “last active” which is the default (and in my case, desired).
Loading a forum index, on my site, takes about 20 seconds.
Here is the offending SQL:
[9] => Array ( [0] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_parent = 9 AND wp_posts.post_type = 'topic' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'hidden') AND (wp_postmeta.meta_key = '_bbp_last_active_time' ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value DESC LIMIT 0, 15 [1] => 19.448324918747 [2] => require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), apply_filters('template_include'), call_user_func_array, bbp_template_include, apply_filters('bbp_template_include'), call_user_func_array, bbp_template_include_theme_compat, BBP_Shortcodes->display_forum, bbp_get_template_part, bbp_locate_template, load_template, require('/themes/xx/bbpress/content-single-forum.php'), bbp_has_topics, WP_Query->__construct, WP_Query->query, WP_Query->get_posts )There’s a ticket which seems to be addressing my problem here: https://bbpress.trac.wordpress.org/ticket/1925
Unless I’m misreading it, the upshot is “We should probably be using post_modified on the topic instead of a meta value for ‘last activity’, so as to avoid using the JOIN… but we haven’t yet”.
So how do other sites do it? This one, for instance? Or WordPress.org? They have more posts than I do, but have got around this issue somehow.
Any solution?
Thanks.
February 14, 2015 at 6:28 am #158395In reply to: How to customize TinyMCE toolbar button colors
Robkk
ModeratorThis is for TinyMCE
/* This is for the button color */ .mce-btn-group .mce-btn { background: black; } /* This is for the icon color */ .mce-toolbar .mce-ico { color: white; }this is for the quicktags toolbar
.wp-core-ui .button, .wp-core-ui .button-secondary { color: white; background: black; }February 14, 2015 at 6:15 am #158393In reply to: Reply Form within popup
Robkk
Moderatorthis would require some custom development
i think you could do it fiddling with the reply form shortcode below
[bbp-reply-form]
but you have to make sure it gets the topics id first though im not sure.
February 13, 2015 at 7:50 pm #158382In reply to: bbPress User Profile Manipulation
Robin W
Moderatorok, I’ve kicked the code around an adding this to your functions file will fix it.
I may add it as an option to the profile at some stage, but not likely that soon, so paste this code into your functions file
//* Code addition for bbP Profile Information Plugin add_action('register_form','myplugin_register_form'); function myplugin_register_form (){ $rpi_label1 = ( isset( $_POST['rpi_label1'] ) ) ? $_POST['rpi_label1']: ''; $rpi_label2 = ( isset( $_POST['rpi_label2'] ) ) ? $_POST['rpi_label2']: ''; ?> <p> <p> <label for="rpi_label1"><?php echo $rpi_options['item1_label'] ; ?><br /> <input type="text" name="rpi_label1" id="rpi_label1" class="input" value="<?php echo esc_attr(stripslashes($rpi_label1)); ?>" size="25" /></label> </p> <p> <label for="rpi_label2"><?php echo $rpi_options['item2_label'] ; ?><br /> <input type="text" name="rpi_label2" id="rpi_label2" class="input" value="<?php echo esc_attr(stripslashes($rpi_label2)); ?>" size="25" /></label> </p> <?php } add_filter('registration_errors', 'myplugin_registration_errors', 10, 3); function myplugin_registration_errors ($errors, $sanitized_user_login, $user_email) { if ( empty( $_POST['rpi_label1'] ) ) $errors->add( 'rpi_label1_error', __('ERROR: You must include a first name.','mydomain') ); if ( empty( $_POST['rpi_label2'] ) ) $errors->add( 'rpi_label2_error', __('ERROR: You must include a last name.','mydomain') ); return $errors; } add_action('user_register', 'myplugin_user_register'); function myplugin_user_register ($user_id) { if ( isset( $_POST['rpi_label1'] ) ) update_user_meta($user_id, 'rpi_label1', $_POST['rpi_label1']); if ( isset( $_POST['rpi_label2'] ) ) update_user_meta($user_id, 'rpi_label2', $_POST['rpi_label2']); }February 13, 2015 at 1:35 pm #158374In reply to: Moving Forums Root to sub page
Joe Dostie
ParticipantPosting that code seems to have screwed up the thread…oh boy!
Well in any case I have been doing some testing.
It looks to me like bbPress is expecting to always be in the ROOT of the site.
I can make some adjustments but it then appears to mess something else up.
Take a look at this forum, I will leave it alone for a whole so you can look at it. But it explains the issue.
If I make the forum a child page bbPress will not create the forum with the parent page.If you adjust the forum root setting to fix this, then bbPress takes over and the breadcrumb so the hierarchy is no longer correct.
At least that’s how it appears to me…
February 13, 2015 at 10:08 am #158352Robin W
ModeratorI have another plugin user with this issue, which helps as it should get me quicker to a solution.
But can I also ask your help?
Could I please ask you to do 2 things (or any combination will help me)
1. Could you try version 1.2 – I’m not sure if the latest version 1.3 is an issue
Therefore could you go to http://www.rewweb.co.uk/bbp-style-pack-1-2/ and follow the instructions.
If this works, then let me know, as it will eliminate much of my code as the issue.
2. If you are able to could you :
a. Deactivate all plugins except bbpress and bbp style pack and see if this fixes. if it does, re-enable one at a time to see which is causing the error when my plugin is also active.
b. If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentytwelve, and see if this fixes.Then switch back to your normal theme and re-enable all plugins (except mine as this is causing the issue) and come back with the results
February 13, 2015 at 10:03 am #158349In reply to: bbPress User Profile Manipulation
Robin W
Moderatorsorry I’m not ignoring you or abandoning you, I’d like to get this working as well, but one of my plugins is causing users issues, so have diverted my attention to that.
Just try pasting this into the line
<label for="rpi_label1"><?php _e('First Name as people call you eg Dave','mydomain') ?><br />If I’m right it will fall over on the next line, and I can tell you the issue.
If not, I’ll load you code into my test site and kick it when I get out from my plugin issue
February 12, 2015 at 10:21 pm #158315In reply to: Moving Forums Root to sub page
Joe Dostie
ParticipantI cant paste the html markup even with the code block..but.
Home/Forums
“<ul class=”breadcrumbs”>
- Home <span class=”bbp-breadcrumb-sep”> </span>
- <span class=”bbp-breadcrumb-current”>Forums</span>
“
February 12, 2015 at 8:26 pm #158304Robin W
ModeratorIt was quicker to code it than describe it.
Basically I’ve created a new widget called (rew) Login Widget
Copy all the below into your functions file
You’ll see that all it required was taking out the label, and putting ‘placeholder’ into the input line
I even changed lost password into forgot your password !
The go into widgets and you’ll see the new widget (rew) Login Widget
enjoy !
class Rew_Login_Widget extends WP_Widget { /** * bbPress Login Widget * * Registers the login widget * * @since bbPress (r2827) * * @uses apply_filters() Calls 'bbp_login_widget_options' with the * widget options */ public function __construct() { $widget_ops = apply_filters( 'rew_login_widget_options', array( 'classname' => 'bbp_widget_login', 'description' => __( 'A simple login form with optional links to sign-up and lost password pages.', 'bbpress' ) ) ); parent::__construct( false, __( '(rew) Login Widget', 'bbpress' ), $widget_ops ); } /** * Register the widget * * @since bbPress (r3389) * * @uses register_widget() */ public static function register_widget() { register_widget( 'Rew_Login_Widget' ); } /** * Displays the output, the login form * * @since bbPress (r2827) * * @param mixed $args Arguments * @param array $instance Instance * @uses apply_filters() Calls 'bbp_login_widget_title' with the title * @uses get_template_part() To get the login/logged in form */ public function widget( $args = array(), $instance = array() ) { // Get widget settings $settings = $this->parse_settings( $instance ); // Typical WordPress filter $settings['title'] = apply_filters( 'rew_widget_title', $settings['title'], $instance, $this->id_base ); // bbPress filters $settings['title'] = apply_filters( 'rew_login_widget_title', $settings['title'], $instance, $this->id_base ); $settings['register'] = apply_filters( 'rew_login_widget_register', $settings['register'], $instance, $this->id_base ); $settings['lostpass'] = apply_filters( 'rew_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base ); echo $args['before_widget']; if ( !empty( $settings['title'] ) ) { echo $args['before_title'] . $settings['title'] . $args['after_title']; } if ( !is_user_logged_in() ) : ?> <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form"> <fieldset> <legend><?php _e( 'Log In', 'bbpress' ); ?></legend> <div class="bbp-username"> <input type="text" name="log" placeholder = "Username" value="<?php bbp_sanitize_val( 'user_login', 'text' ); ?>" size="20" id="user_login" tabindex="<?php bbp_tab_index(); ?>" /> </div> <div class="bbp-password"> <input type="password" name="pwd" placeholder = "Password" value="<?php bbp_sanitize_val( 'user_pass', 'password' ); ?>" size="20" id="user_pass" tabindex="<?php bbp_tab_index(); ?>" /> </div> <div class="bbp-remember-me"> <input type="checkbox" name="rememberme" value="forever" <?php checked( bbp_get_sanitize_val( 'rememberme', 'checkbox' ), true, true ); ?> id="rememberme" tabindex="<?php bbp_tab_index(); ?>" /> <label for="rememberme"><?php _e( 'Remember Me', 'bbpress' ); ?></label> </div> <div class="bbp-submit-wrapper"> <?php do_action( 'login_form' ); ?> <button type="submit" name="user-submit" id="user-submit" tabindex="<?php bbp_tab_index(); ?>" class="button submit user-submit"><?php _e( 'Log In', 'bbpress' ); ?></button> <?php bbp_user_login_fields(); ?> </div> <?php if ( !empty( $settings['register'] ) || !empty( $settings['lostpass'] ) ) : ?> <div class="bbp-login-links"> <?php if ( !empty( $settings['register'] ) ) : ?> <a href="<?php echo esc_url( $settings['register'] ); ?>" title="<?php esc_attr_e( 'Register', 'bbpress' ); ?>" class="bbp-register-link"><?php _e( 'Register', 'bbpress' ); ?></a> <?php endif; ?> <?php if ( !empty( $settings['lostpass'] ) ) : ?> <a href="<?php echo esc_url( $settings['lostpass'] ); ?>" title="<?php esc_attr_e( 'Forgot Your Password', 'bbpress' ); ?>" class="bbp-lostpass-link"><?php _e( 'Forgot Your Password', 'bbpress' ); ?></a> <?php endif; ?> </div> <?php endif; ?> </fieldset> </form> <?php else : ?> <div class="bbp-logged-in"> <a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>" class="submit user-submit"><?php echo get_avatar( bbp_get_current_user_id(), '40' ); ?></a> <h4><?php bbp_user_profile_link( bbp_get_current_user_id() ); ?></h4> <?php bbp_logout_link(); ?> </div> <?php endif; echo $args['after_widget']; } /** * Update the login widget options * * @since bbPress (r2827) * * @param array $new_instance The new instance options * @param array $old_instance The old instance options */ public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['register'] = esc_url_raw( $new_instance['register'] ); $instance['lostpass'] = esc_url_raw( $new_instance['lostpass'] ); return $instance; } /** * Output the login widget options form * * @since bbPress (r2827) * * @param $instance Instance * @uses BBP_Login_Widget::get_field_id() To output the field id * @uses BBP_Login_Widget::get_field_name() To output the field name */ public function form( $instance = array() ) { // Get widget settings $settings = $this->parse_settings( $instance ); ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $settings['title'] ); ?>" /></label> </p> <p> <label for="<?php echo $this->get_field_id( 'register' ); ?>"><?php _e( 'Register URI:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'register' ); ?>" name="<?php echo $this->get_field_name( 'register' ); ?>" type="text" value="<?php echo esc_url( $settings['register'] ); ?>" /></label> </p> <p> <label for="<?php echo $this->get_field_id( 'lostpass' ); ?>"><?php _e( 'Lost Password URI:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'lostpass' ); ?>" name="<?php echo $this->get_field_name( 'lostpass' ); ?>" type="text" value="<?php echo esc_url( $settings['lostpass'] ); ?>" /></label> </p> <?php } /** * Merge the widget settings into defaults array. * * @since bbPress (r4802) * * @param $instance Instance * @uses bbp_parse_args() To merge widget settings into defaults */ public function parse_settings( $instance = array() ) { return bbp_parse_args( $instance, array( 'title' => '', 'register' => '', 'lostpass' => '' ), 'login_widget_settings' ); } } add_action( 'widgets_init', function(){ register_widget( 'Rew_Login_Widget' ); });February 12, 2015 at 7:40 pm #158303In reply to: Custom Roles & Capabilities
Robin W
Moderatorwill be at least tomorrow evening before I look at again, but the code does seem to work on my test stite with twenty ten, although I don’t know why it didn’t immediately !
February 12, 2015 at 7:12 pm #158297Robin W
Moderatorok, no easy filters, are you ok at coding, ie getting some code and amending it. If so i’ll come back with more info
February 12, 2015 at 6:58 pm #158296In reply to: Custom Roles & Capabilities
Robin W
ModeratorCome back if you rae still having problems tomorrow, but the code you posted works with bbpress !
February 12, 2015 at 6:57 pm #158295In reply to: Custom Roles & Capabilities
Robin W
Moderatorok, not sure why, but my code is now working without me changing, but I did shutdown all browsers and reload from scratch and that seemed to fix.
I can now change role capabilities at will, but initially like you the changes did not take effect.
by the by if you have several sessions in one browser they will take capabiliites of another session, so have you admin in say IE and your user you are testing in say Chrome !
-
AuthorSearch Results