Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,701 through 10,725 (of 32,521 total)
  • Author
    Search Results
  • #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>
    #151632
    gmichel
    Participant

    I have the latest WP installed with OptimizePress 2, Buddy Press and BBpress (latest versions) installed. I am building the forums in the private section of a membership site.

    I am having issues with the Breadcrumb links.

    I used method 2, a page for the forums index with short code. The forums display properly.
    >> http://www.imstudy.club/forums-welcome/

    Then when I click on each forum it goes to the correct page, I have set-up “Content Aware Sidebars” to show widgets in the sidebar and the forums in the content area. It works.

    Now when I am on one of these forums the breadcrumb shows:
    IM Study Club’s Public Home › Forums › Site Feedback

    The link “Forums”, is the Forum root and it goes here:
    http://www.imstudy.club/forums/

    That’s a Blog Archives page with a link “continue reading” going nowhere.

    How can I have this “Forums” link in the breadcrumb go to my custom page “forums-welcome” instead.

    I have tried to change the name of the root forum to match the page, but it doesn’t works, always get the blog archives page… I also tried to redirect, but got a loop.

    Any idea?

    Thank you very much for your help.

    Michel

    vegas778
    Participant

    Hi All,

    I would like to create a link in a wordpress widget that redirects the logged in user to his user forum profile page but I cannot manage… I dont know what code should I use.

    Example : it should redirects to the page : http://www.example.org/forums/user/admin/

    Thanks in advance

    Regards,

    #151628
    Anonymous User 9493778
    Inactive

    Thanks Robin.

    It worked a little too well in my case. On the front end the WordPress Toolbar was also hidden for Administrators. At least in my case.

    Here is a code snippet that lets only Administrators see the WordPress Toolbar on the front end of a site. The toolbar is hidden for all other users.
    https://support.woothemes.com/hc/en-us/articles/203107607-Hide-WordPress-Admin-Bar-for-Users

    add_action(‘after_setup_theme’, ‘remove_admin_bar’);

    function remove_admin_bar() {
    if (!current_user_can(‘administrator’) && !is_admin()) {
    show_admin_bar(false);
    }
    }

    Thanks for your help. This can be added into the documentation overhaul.

    #151620
    Techknowledgic
    Participant

    I posted it here because the sign up is by the bbpress widget using this code [bbp-register]

    and before I was having an issue which is many users with weird names and emails are registering with my websites and I have been told to use captcha so a real person can sign up only but now even with capthca I am having spam users idk how!

    knowing that I am the only admin and I changed my pass and email several times and didn’t work

    #151614
    Robin W
    Moderator

    The way profiles are shown requires some coding – would a menu item do you?

    Layout and functionality – Examples you can use

    #151613
    Robin W
    Moderator

    Kevin,

    How I hate the toolbar – it should only be seen by admins

    add the following code into your functions file

    add_filter('show_admin_bar', '__return_false');
    

    Functions files and child themes – explained !

    #151612
    Anonymous User 9493778
    Inactive

    Hi,

    is there a short code to display the users profile?

    After reading the documentation and working with bbpress the only way a user can see their profile is if they have already created a topic or replied to a topic.

    Some users only want to favorite a few topics. However they can not see their favorites unless they can see their user profile.

    Included is a screen shot of what is wanted.
    https://www.dropbox.com/s/qtwtvfwckswjfk9/profile_shortcode.jpg?dl=0

    Thanks,
    Kevin

    #151590

    In reply to: current in forum root

    Robkk
    Moderator
Viewing 25 results - 10,701 through 10,725 (of 32,521 total)
Skip to toolbar