Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 726 through 750 (of 32,358 total)
  • Author
    Search Results
  • #234031
    Robin W
    Moderator

    bbp style pack

    lets you style your forums

    you can also use the translations tab of this to change Posts to Replies

    there is also

    bbPress Styling Crib

    which contains styling guides

    #234004
    Ludovic S. Clain
    Participant

    Hey ๐Ÿ‘‹ย 
    Thank you @Robin-W,
    In the meantime I got to know the WP-Cli-Cli package specific to WordPress, which does not work either (I opened an issue visible here).

    To locate the context, I use WooCommerce Subscription plugin and I needed that when a subscription is canceled, access to the bbPress forum is blocked.

    I leave here the snippet that I made and that does the job:

    add_action('woocommerce_subscription_status_cancelled', 'block_forum_user_after_subscription_cancellation_s', 10, 1);
    function block_forum_user_after_subscription_cancellation_s($subscription)
    {
        $user_id = $subscription->get_user_id();
        $new_role = 'bbp_blocked';
        bbp_set_user_role($user_id, $new_role);
    }

    (I also have a webhook version with the WordPress Rest API for remote use, if necessary contact me)

    #234000
    Robin W
    Moderator

    bbp_set_user_role( $user_id, $new_role )

    #233997
    Ludovic S. Clain
    Participant

    Hi there ๐Ÿ‘‹ย 

    Thanks to the details of @stanis I am understanding why when I use WP-Cli with the line:
    wp user set-role <User id> bbp_blocked

    It blows up the existing role of the User on WordPress (in my case it was “customer” which becomes ” – no role for this site -“)

    But it’s still unclear for me. How to modify the role of an User on BBPPRESS without touching its WordPress role?

    Because the opposite is also true, if I do :
    wp user set-role <User ID> customer

    This time it is the role of the User on the forum that jumps and becomes “-No Role for these forums-”

    PS: I also tried
    wp user update <User ID> --role=customer --bbp-forums-role=bbp_blocked
    And that doesn’t do the job too ๐Ÿ™

    Thanks for your lights!
    Warm regards,
    Ludovic

    #233962

    In reply to: User email management

    timholland
    Participant

    Hi Robin,

    I looked at the forum screens and there is a button for adding a forum to a digest. I clicked it and it changed to give me the option to remove it from the digest.

    A second link is there for editing digest settings, however when I click it, I get:

    Page Not Found
    The page you were looking for could not be found. It might have been removed, renamed, or did not exist in the first place.

    The link is https://somd-scalemodelers.club/members/timh/edit/#bbp-digest-check-row

    And if I understand correctly, thatโ€™s a function in the bbpress digest plugin php code.

    Any ideas where I should look next?

    Regards,
    Tim

    #233937

    In reply to: Archives:Forums

    Robin W
    Moderator

    Try this

    add_filter( 'get_the_archive_title', 'to_archive_title_remove_prefix' );
    function to_archive_title_remove_prefix( $title ) {
    if ( is_post_type_archive() ) {
    $title = post_type_archive_title( '', false );
    }
    return $title;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #233915
    Robin W
    Moderator

    1. only replies
    2. bespoke code needed

    #233842
    Robin W
    Moderator

    2nd – works in my browser for your site – can you close and reopen and check again, or post a new image showing what is still wrong, and links to an exact example.

    3rd – I don’t know what ‘no output results’ means ??? again it seems to have gone from your site in my browser.

    I did see that I had not taken out the ‘author/posts’ from the footer – you can add this

    .forums.bbp-replies li.bbp-footer {
            display: none;
    }
    #233839

    In reply to: Custom Profile Fields

    scottmotion
    Participant

    First you could try Robin’s bbPress plugin: https://wordpress.org/plugins/bbp-profile-information/
    Same with BuddyPress integration: https://wordpress.org/plugins/bbp-buddypress-profile-information/

    If you’re not using BuddyPress though I would highly recommend looking into it. You can enable “Extended Profile Fields” and there’s also a plugin for custom field types: https://wordpress.org/plugins/bp-xprofile-custom-field-types/

    As far as the outbound links themselves go you might need to code/style them yourself unless your theme automatically converts links.

    #233838
    Robin W
    Moderator

    my code above corrected works, but yes do come back and let us know if you find the problem or need further help

    #233837
    saciojote
    Participant

    Yes I did I noticed that before I tried the code. I will play around and see if I can find the problem, if the get_page_by_title() works as I would like then it must be an error somewhere else.

    Thank you for your help!

    #233835
    Robin W
    Moderator

    put this in the custom css of you theme

    div.bbp-template-notice.info {
    	display: none;
    }
    
    .bbp-pagination-count {
    	display: none;
    }
    
    .forums.bbp-replies li.bbp-header {
            display: none;
    }
    #233827
    Robin W
    Moderator

    ok, based on that I have no idea what you mean by embedding.

    bbpress does not have a ‘login page’ it has shortcodes and widgets.

    the template used by bbpress for login is

    bbpress\templates\default\bbpress\form-user-login.php

    to customise :

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-user-login.php

    transfer this to your pc and edit as desired

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-user-login.php

    bbPress will now use this template instead of the original

    #233826
    pcwd
    Participant

    Theme my login does not allow embedding.
    As I wrote at the beginning of the post, I would like to customize the bbpress login page.
    Can you help me run that PHP code with Code Snippets?
    Thank you very much!

    #233823
    pcwd
    Participant
    <?php
    if ( ! is_user_logged_in() ) { // Display WordPress login form:
        $args = array(
            'redirect' => admin_url(), 
            'form_id' => 'loginform-custom',
            'label_username' => __( 'Username custom text' ),
            'label_password' => __( 'Password custom text' ),
            'label_remember' => __( 'Remember Me custom text' ),
            'label_log_in' => __( 'Log In custom text' ),
            'remember' => true
        );
        wp_login_form( $args );
    } else { // If logged in:
        wp_loginout( home_url() ); // Display "Log Out" link.
        echo " | ";
        wp_register('', ''); // Display "Site Admin" link.
    }
    ?>

    I entered that code with the Code Snippets Plugin but it didnโ€™t work ๐Ÿ™

    #233821
    Robin W
    Moderator

    that is a page full of code – so what did you put in?

    #233820
    pcwd
    Participant

    Hi Robin,
    thanks for your reply.

    I entered that code with the Code Snippets Plugin but it didn’t work. Why?

    #233819
    Robin W
    Moderator

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #233815
    Robin W
    Moderator

    did you correct the error in this line

    if (!empty ($topic) {

    should be

    if (!empty ($topic)) {

    #233805
    saciojote
    Participant

    Hi Robin, thank you for the example code! I have tried it and it seems to return the same value regardless of the title, so I am unsure…

    Here is the sample code that I have used the function within:

    function return_content_replies() {
    	
    	$title = $_POST['title'];
    	$topic_id = rew_find_topic_id($title);
    	
    	if ( $topic_id == 'empty' ) { 
    	  	// create the topic here
    	} else {
    		$args = array(
    			  'post_parent' => $topic_id, // ID of the topic
    			  'order'       => 'ASC', // Order of the replies (ASC or DESC)
    			);
    			
    			$replies_array = array();
    		
    			if ( bbp_has_replies( $args ) ) {
    			  while ( bbp_replies() ) {
    				bbp_the_reply();
    				$replies_array[] = array(
    				  'id' => bbp_get_reply_id(),
    				  'content' => bbp_get_reply_content(),
    				  'date' => bbp_get_reply_post_date(),
    				);
    			}
    		}
    			$response = array( 'status' => 'success', 'message' => $topic_id);
    	}
    	wp_send_json($response);
    }
    #233793
    Robin W
    Moderator

    if title is unique then

    get_page_by_title()

    untested but something like :

    function rew_find_topic_id ($title) {
    	$topic = get_page_by_title($title, OBJECT, bbp_get_topic_post_type());
    	if (!empty ($topic) {
    		$topic_id = $topic->ID ;
    		return $topic_id ;
    	}
    	else {
    		return 'empty' ;
    	}
    }
    scottmotion
    Participant

    These 3 items show nothing on the user profile Forums tab. Inspector shows that div.bp-user-section is empty, and there is no “Oh bother!” message displayed on the page.
    However, Replies Created DOES show replies or the “Oh bother!” message if empty.

    I know Favorites were displaying when I first set up the site, but now that i’m circling back to deal with notifications and such I just noticed that it is gone. So I can’t say when/how it was broken.

    I ran the forum fixes and purged cache but there was no change. I’ve tried disabling some BP/bbp related plugins but also no luck. I DO have Favorites and Engagements enabled under Settings>Forums. I’ve implemented various pieces of custom code related to BP/bbp but I don’t see how they would interfere with only those 3 items and not the replies.

    Hoping someone might know offhand what could be interfering with this data being displayed, or at least a way to debug it.

    #233765

    Topic: Custom Profile Fields

    in forum Plugins

    I have searched these forums and for the life of me can not find exactly what I am aiming for.

    Basically I run a gaming community. For the most part, everyone uses discord, and the new forum system discord currently has. However our website has been a beacon that has kept us getting back in touch with each other for over 25 year and im trying to not only keep it alive, but adding content.

    Basically I have the WP Discord plugin. I want to have BBPress allow the user to add their specific game names (battle net, steam, EA, Activision IDs) to their website / forum profile. I downloaded and installed the Advanced custom field plugin via wordpress, but it doesm’t seem to work with BBpress. If I make a new page or post I can add the fields, but I am looking more in terms of the wordpress user adding them upon registering on the site, then showing in the BBpress profile.

    I used to modify SMF years ago and played around a lot with different content management forum software, but am fairly new to wordpress itself, and I ABSOLUTELY LOVE how bbpress feels familiar to me. I feel like this is something super simple and easy to accomplish and im just looking in the wrong place.

    On our old SMF forum, I literally had it setup in a URL format to where you would put your Steam username, but then on your profile it would be a clickable link to your steam page. It was super easy and literally required modifying the code 2 or 3 lines to fix once installing a basic plugin for SMF. I feel like this should be easier.

    Can someone please point me in the right direction? Also, thank you all for what you do!

    #233731
    Robin W
    Moderator

    yes

    $replies = bbp_has_replies( $args );

    in \bbpress\includes\replies\template.php

    it has these default args (some set by code above this section)

    $default = array(
    		'post_type'              => $default_post_type,         // Only replies
    		'post_parent'            => $default_post_parent,       // Of this topic
    		'posts_per_page'         => bbp_get_replies_per_page(), // This many
    		'paged'                  => bbp_get_paged(),            // On this page
    		'orderby'                => 'date',                     // Sorted by date
    		'order'                  => 'ASC',                      // Oldest to newest
    		'hierarchical'           => $default_thread_replies,    // Hierarchical replies
    		'ignore_sticky_posts'    => true,                       // Stickies not supported
    		'update_post_term_cache' => false,                      // No terms to cache

    but whatever you pass in $args will overwrite these

    #233725
    saciojote
    Participant

    Is there a function that returns all the replies when the topicID is passed into a function?

    Some example code is below for better understanding of the function I am asking about –

    
    $args = array(
    	'post_parent' => $NUM, // ID of the topic
    	'order'       => 'ASC', // Order of the replies (ASC or DESC)
    	);
    
    $replies = bbp_get_replies_function( $args ); // function i would like
    $response = array(
          	status' => 'success',
          	'message' => $replies,
        	);
    
Viewing 25 results - 726 through 750 (of 32,358 total)
Skip to toolbar