Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,676 through 10,700 (of 32,504 total)
  • Author
    Search Results
  • #151703
    Stephen Edgar
    Keymaster

    You are correct, image attachments are not imported, most of the ins and outs are in the docs

    https://codex.bbpress.org/import-forums/phpbb/

    #151702
    Stephen Edgar
    Keymaster

    Maybe the site that works has a custom bbpress.php wrapper template or it is using a page with bbPress shortcodes, either or it’ll just take a bit more comparing the differences between the two.

    #151692

    In reply to: Slow to Post

    Stephen Edgar
    Keymaster

    Firstly, a quick breakdown via pingdom, quite a delay in getting your JavaScript files, I’d get these into your Amazon CDN.

    As you stated above “ive eliminated all the points you’ve made above, and the site only chokes when users are submitting posts in the forum, so I’m confident i’ve isolated the issue.”

    • What happens when you deactivate either/or “Go to first unread” & “Unread posts” plugins you’re using and submit a reply to an affected topic?
    • Another test, this time with the ‘Quotes’ plugin disabled submit a reply to an affected topic.
    • Another, what code and/or plugin are you using to show the user registration in each reply e.g. Join Date: Mar 2009
    • And another, what code and/or plugin are you using for the counts shown next to the username in each reply e.g Posts: 4529

    Can you run the following two queries in phpMyAdmin, it will give me an idea of the state of the data in your database, it is the topic and three replies (two imported replies and one new bbPress reply) from the ~10k topic you have:

    
    SELECT ID, post_author, post_parent, menu_order, post_type
    FROM  wp_posts
    WHERE  ID
    IN ( 490979, 831628, 837704, 1031603 ) 
    

    and

    
    SELECT * 
    FROM  wp_postmeta
    WHERE  post_id
    IN ( 490979, 831628, 837704, 1031603 ) 
    

    Once you have the results of each (they don’t show any ‘sensitive’ data) click the “Print View” and copy and paste them to a text file, a Gist or to pastebin for me to checkout please.

    Over the weekend I had to reinstall everything here locally (and my online servers for a different reason) as something was up with my database, I’ve created a topic here locally with ~10,000 replies today (similar in size to your second most popular topic) and it takes ~1.6 seconds to post a reply to this topic. To time the queries, install the following plugin and of course only have it activated whilst your debugging this stuff https://wordpress.org/plugins/query-monitor/

    #151691
    Stephen Edgar
    Keymaster

    I just tested this and it works fine, as it states: “Disallow editing after ‘x’ minutes”, that does not infer setting to 0 will disable topic/reply editing 😉

    Thus, if you set it to 1 editing will be disabled after 1 minute, the default is 5 minutes.

    If this is not working for you check your time and date settings, someone else had this issue a while back and as they had the incorrect time zone configured it was adding the time zone difference to the allowed editable time 🙂

    #151689

    Topic: GD BBpress Tools

    in forum Plugins
    sickwit
    Participant

    Iv installed this and when i go to make a post the addons are not. What is missing is things like youtube and such

    Adds different expansions and tools to the bbPress 2.0 plugin powered forums: BBCode support, signatures, custom views, quote…

    http://lio2.site.nfoservers.com/forums/topic/i-like-this/

    #151688

    In reply to: Theme Problems

    Robkk
    Moderator

    did you create a bbpress.php and put it into your themes folder??

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #151687

    In reply to: Theme Problems

    Robkk
    Moderator

    try this

    .bbpress .singular .entry-content {
    margin: 0 auto;
    width: 68.9%;
    float: right!important;
    }
    #151683

    In reply to: No spacing in posts.

    Robkk
    Moderator

    add this to anywhere you can put custom css

    .bbp-reply-content p {
    margin-bottom:10px;
    }
    #151679
    Nicolas Korobochkin
    Participant

    BTW, issue with cyrillic links also on ru.forums.wordpress.org. And all time then I copy link I can’t send it in twitter or with message on facebook. Ok. Some browsers encode cyrilic letters:

    original:
    https://ru.forums.wordpress.org/topic/Пустая-страница-1?replies=3
    
    encoded:
    https://ru.forums.wordpress.org/topic/%D0%9D%D0%B5%D1%80%D0%B0%D0%B1%D0%BE%D1%87%D0%B8%D0%B5-%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B8-%D0%BD%D0%B0-ruforumswordpressorg

    but not Safari.

    #151676
    Robkk
    Moderator

    i would create a page and put the forum archive shortcode and the single topic shortcode to display both with no problems.

    https://codex.bbpress.org/shortcodes/

    There is probably another way , but this is the first i thought of.

    #151674

    In reply to: Theme Problems

    Robkk
    Moderator

    the sidebar and the forum display overlap.

    put this where you can put custom css and tell how it is.

    #bbpress .singular .entry-content {
    margin: 0 auto;
    width: 68.9%;
    float: right;
    }
    #151672
    Robkk
    Moderator

    The only way is with a php code to create a bbpress profile link ?

    well maybe if you have a shortcode to display the users “login name” then you could probably replace the the php code with the shortcode. idk if it works though havent really tried anything like that just yet.

    alternative is allow php in widgets, which is unsafe.

    and also you could a link to profile in your menu.

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) {  
        if (!is_user_logged_in())
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_login ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/">View Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
         
    }
    #151669

    In reply to: Delete Topic Function

    gusrb84
    Participant

    I have same issue! delete_others_replies work, but not delete_replies..

    Temporary solution would be changing bbpress core (/includes/replies/capabilities.php)
    from:

    case 'delete_reply' :
    // Get the post
    $_post = get_post( $args[0] );
    if ( !empty( $_post ) ) {
    	// Get caps for post type object
    	$post_type = get_post_type_object( $_post->post_type );
    	$caps      = array();
    	// Add 'do_not_allow' cap if user is spam or deleted
    	if ( bbp_is_user_inactive( $user_id ) ) {
    	$caps[] = 'do_not_allow';
    	// Moderators can always edit forum content
    	} elseif ( user_can( $user_id, 'moderate' ) ) {
    	$caps[] = 'moderate';
    	// Unknown so map to delete_others_posts
    	} else {
    	$caps[] = $post_type->cap->delete_others_posts;
    	}
    }
    break;

    To:

    case 'delete_reply' :
    // Get the post
    $_post = get_post( $args[0] );
    if ( !empty( $_post ) ) {
    	// Get caps for post type object
    	$post_type = get_post_type_object( $_post->post_type );
    	$caps      = array();
    	// Add 'do_not_allow' cap if user is spam or deleted
    	if ( bbp_is_user_inactive( $user_id ) ) {
    	$caps[] = 'do_not_allow';
    	// Moderators can always edit forum content
    	} elseif ( user_can( $user_id, 'moderate' ) ) {
    	$caps[] = 'moderate';
    	// User is author so allow edit if not in admin
    	} elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
    	$caps[] = $post_type->cap->delete_posts;
    	// Unknown so map to delete_others_posts
    	} else {
    	$caps[] = $post_type->cap->delete_others_posts;
    	}
    }
    break;

    But I do not want to touch the core. How can I update my functions.php file to do the same? (i.e. add_filter)

    I’m very new to WP and BBP..

    Robkk
    Moderator

    @marximusmg use robins code, his version is a better way

    #151664
    gusrb84
    Participant

    I just wanted to give general users capabilities to delete their own topics/replies, so I added custom role for bbpress forums.

    I followed: http://codex.bbpress.org/custom-capabilities/, to add ‘PPH General User’ and I see the forum role in Edit User page. I also changed Auto role in Forums Settings so that the website can automatically give registered visitor ‘PPH General User’ role.

    In ‘usermeta’ database, I see that it assigned ‘a:1:{s:16:”pph_general_user”;b:1;}’ to capabilities key. It is good so far.

    However, when I open the forum with PPH General User account, all bbpress capabilities for ‘PPH General User’ are disabled.

    Even reading a forum shows nothing with body class = “error404 logged-in”
    If I change the user account to Participant, all bbpress functions work as expected.
    (with body class = “forum bbpress single single-forum postid-42 logged-in”)

    With PPH General Account,

    
    $cur_user_id = get_current_user_id();
    $roles=get_userdata( $cur_user_id );
    echo 'User Role:'; print_r($roles->roles); echo '<br />';
    $role_caps = bbp_get_caps_for_role($roles->roles[0]);
    echo 'User Cap:'; print_r($role_caps); echo '<br />';
    if (current_user_can( 'spectate')){echo 'You can spectate';}
    	else{echo 'You cannot spectate';};
    

    prints out:
    User Role:Array ( [0] => pph_general_user )
    User Cap:Array ( [spectate] => 1 [participate] => 1 [read_private_forums] => 1 [publish_topics] => 1 [edit_topics] => 1 [delete_topics] => 1 [read_private_topics] => 1 [publish_replies] => 1 [edit_replies] => 1 [delete_replies] => 1 [read_private_replies] => 1 [manage_topic_tags] => 1 [edit_topic_tags] => 1 [delete_topic_tags] => 1 [assign_topic_tags] => 1 )
    You cannot spectate

    If the account is changed to ‘Participant’ then it prints out:
    User Role:Array ( [0] => bbp_participant )
    User Cap:Array ( [spectate] => 1 [participate] => 1 [read_private_forums] => 1 [publish_topics] => 1 [edit_topics] => 1 [publish_replies] => 1 [edit_replies] => 1 [assign_topic_tags] => 1 )
    You can spectate

    Someone please help me. I spent so many hours debugging this..

    #151663
    David_PR
    Participant

    I’m running WP 3.9.2 and bbPress 2.5.4.
    I have created several forums and populated some with Topics and Replies.
    I wish to display the list of forums at wordpress/forums.

    I followed the instructions in ‘Step by step guide to setting up a bbPress forum – Part 1.
    I tried Method 1 (created a page titled ‘forums’ and added it to the main menu), and Method 2 (shortcode in page)…neither worked for me. When I use the menu to go to wordpress/forums I don’t see the forums but, instead, a list of old posts.
    I am using the plugin ‘bbPress Topics for Posts’ and it works…I have forums displaying as expected at the bottom of pages.

    I’m stumped. Any suggestions would be appreciated.

    David

    Robin W
    Moderator

    sorry, I completely misread what marximusmg was asking, and thought he wanted to replace the whole reply form area with a button that would fire up a reply area.

    Now I understand what marximusmg is after, the solution is

    add_filter( 'bbp_get_the_content', 'amend_reply', 10, 3);
    
    Function amend_reply ($output, $args, $post_content) {
    if ($args['context'] == 'reply' && $post_content == '') $output=str_replace('></textarea>', 'placeholder="Reply..." ></textarea>',$output) ;
    return $output ;
    }
    #151658
    vegas778
    Participant

    Ha yes this link is working : <a class="bbp-profile-button" href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>">Profile Settings</a>

    But I think my plugin user meta does not accept php code that is why it is not working. The only way is with a php code to create a bbpress profile link ?

    #151656
    vegas778
    Participant

    This link is not working : <p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>

    I dont know which link should I add in the widget to redirect to this pages for users : http://www.example.org/forums/user/admin/

    #151651
    divyesh25
    Participant

    Hi Everyone,

    i am make one function in function.php file in which i wrote my own query. now i want set pagination(bbpress pagination). i dont know about and any idea. please help me . below my function.

    function best_conversationstarters(){
    	global $wpdb, $paged, $max_num_pages;
    
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $post_per_page = (intval(get_query_var('posts_per_page'))>0) ? intval(get_query_var('posts_per_page')) : 5;
        $offset =  ($paged - 1)*$post_per_page;
    	
    	$best_conversation_starter =  "SELECT COUNT(*) topic, post_author FROM {$wpdb->posts} WHERE {$wpdb->posts}.post_type LIKE '%topic%' GROUP BY post_author ORDER BY topic DESC LIMIT ".$offset.", ".$post_per_page;
    	$sql_result = $wpdb->get_results( $best_conversation_starter, OBJECT);
    	
    	/* Determine the total of results found to calculate the max_num_pages
         for next_posts_link navigation */
        $sql_posts_total = $wpdb->get_var( "SELECT FOUND_ROWS();" );
        $max_num_pages = ceil($sql_posts_total / $post_per_page);
    
        return $sql_result;
    }

    thanks.

    #151643
    Robin W
    Moderator

    This should do it

    add_filter( 'bbp_get_breadcrumb', 'change_breadcrumb_text' );
    
    Function change_breadcrumb_text ($trail) {
    $trail = str_replace ('No Labels Community Forum','N L C F',$trail) ;
    return $trail ;
    }
    #151638
    Robkk
    Moderator

    you could add a link to the login widget , but you have to do this every upgrade.

    if you dont want to do that there is also 2 other solutions to this too in the link

    Layout and functionality – Examples you can use

    #151637

    In reply to: Breadcrumb Problem

    Robkk
    Moderator

    you need to make a bbpress.php file , edit out number of comments and whatever is calling the continue reading link.

    then your forum archive should look normal after that.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #151636
    Robkk
    Moderator

    you might be able to do this with css if the forum root has a certain class or id

    if it does use :before after the class/id and content:"N C L F" and then just style it to fit the rest of your breadcrumbs

    Robkk
    Moderator

    @robin-w

    idk what your talking about here when its all about a placeholder, that only a user can see if there logged in, you might be over-thinking it when you say this or you reply your information to the wrong topic that this user has.

    Maybe this??

    Customizing "Reply To Topic" Area


    @marximusmg

    i actually got a placeholder in my reply area , but you will lose the quick tag toolbar by doing it this way.

    in form-reply.php replace

    <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
    
    					<?php bbp_the_content( array( 'context' => 'reply' ) ); ?>
    
    					<?php do_action( 'bbp_theme_after_reply_form_content' ); ?>

    with this

    <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
    
    					<textarea placeholder="Reply..." id="bbp_reply_content" tabindex="104" name="bbp_reply_content"></textarea>
    
    					<?php do_action( 'bbp_theme_after_reply_form_content' ); ?>

    heres a snippet of form-reply.php with the code inserted

    <div class="bbp-template-notice">
    						<p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
    					</div>
    
    				<?php endif; ?>
    
    				<?php do_action( 'bbp_template_notices' ); ?>
    
    				<div>
    
    					<?php bbp_get_template_part( 'form', 'anonymous' ); ?>
    
    					<?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
    
    					<textarea placeholder="Reply..." id="bbp_reply_content" tabindex="104" name="bbp_reply_content"></textarea>
    
    					<?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
    
    					<?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
    
    						<p class="form-allowed-tags">
    							<label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
    							<code><?php bbp_allowed_tags(); ?></code>
    						</p>
Viewing 25 results - 10,676 through 10,700 (of 32,504 total)
Skip to toolbar