Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,576 through 1,600 (of 32,436 total)
  • Author
    Search Results
  • #221109
    bobdobbs
    Participant

    I’ve set up a set of discussion forums on a site. Now I want to the purpose of each forum to be clear.

    One forum is called ‘Introductions’.
    I’d like to have a message on the page saying something like “Hi. This is where we get to know each other”.

    I guess I could hack up something with ACF and put some logic in the page template that shows the forums. But I’m wondering if there’s a faster option.

    Is there an inbuilt way to make add non-hardcoded content to the forum pages?

    #221104

    In reply to: error 401

    Robin W
    Moderator

    without knowing how you are set up, I cannot answer, and as I say I cannot visit your site to see where the login is.

    but try dashboard>permalimks and just click save – this resets the permalinks and may help.

    Otherwise where are your users logging in ? a page, or widget and if so what shortcode for the page or what widget?

    #221093
    djintelbe
    Participant

    Hello,

    Some mathematical objects written in mathjax/latex use backslash (\). For example, one use \sqrt{} for the square root function, \mathbb{} for the set of numbers. In bbpress forums, these objects work perfectly but when the forums are displayed in buddypress activities streams, the backslash disappears and therefore the mathematical symbols are not rendered and make the texts difficult to read. If the texts are typed directly in buddypress side, things are also alright. So, the problem seems to be in the transition from forum to the buddypress activities.

    I tried some solutions but nothing work. For example, I tried this solution: remove_filter( ‘bp_get_the_topic_post_content’, ‘stripslashes_deep’ ); but it did not work.
    So I am asking for help; how can I do to solve the problem?

    Thank you in advance

    Wordpress 5.7.2
    bbpress 2.6.6

    Regards

    Nestor

    Robin W
    Moderator

    @mike80222 looking again, your code might need

    $subscription = $event->get_data();
    $user = $subscription->user();
    $user_id = something more to get the ID ;

    but I’d suggest you raise a ticket or look through the documentation.

    Robin W
    Moderator

    BOTH

    You will need to test the below, as I don’t use either plugin on any forum site.

    PM PRO

    for PMpro you have the following hooks :

    Action and Filter Hooks

    I am guessing that pmpro_membership_post_membership_expiry is the correct hook.

    so the code you need is :

    add_action( 'pmpro_membership_post_membership_expiry', 'rew_remove_subscriptions') ;
    
    function rew_remove_subscriptions ($user_id=0) {
    	$forums = bbp_get_user_subscribed_forum_ids ($user_id) ;
    	foreach ($forums as $forum=>$id) {
    		bbp_remove_user_subscription ($user_id, $id, 'post' ) ;
    	}
    	$topics = bbp_get_user_subscribed_topic_ids ($user_id) ;
    	foreach ($topics as $topic=>$id) {
    	bbp_remove_user_subscription ($user_id, $id , 'post' ) ;
    	}
    }

    MEMBERPRESS

    for Memberpress you have the following links

    https://docs.memberpress.com/article/325-action-hooks-in-memberpress

    I am guessing that ‘mepr-event-subscription-stopped`

    is the correct one, but you might need to query with memberpress

    so for memberpress you would have

    add_action( 'mepr-event-subscription-stopped', 'rew_remove_subscriptions') ;
    
    function rew_remove_subscriptions ($event) {
    	$subscription = $event->get_data();
    	$user_id = $subscription->user();
    	$forums = bbp_get_user_subscribed_forum_ids ($user_id) ;
    	foreach ($forums as $forum=>$id) {
    		bbp_remove_user_subscription ($user_id, $id, 'post' ) ;
    	}
    	$topics = bbp_get_user_subscribed_topic_ids ($user_id) ;
    	foreach ($topics as $topic=>$id) {
    	bbp_remove_user_subscription ($user_id, $id , 'post' ) ;
    	}
    }

    BOTH

    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

    Robin W
    Moderator

    I’m playing with some code, give me a while to work it out !!

    #221071
    bobdobbs
    Participant

    I’ve installed bbpress and created a set of forums.

    On the forums page of my website, a linked list of forums shows… which is great.

    However, I now want to alter the order in which the forums are listed.

    Usually for post types, the admin screen allows a re-ordering of posts via the ‘quick edit’ link.
    However, in the bbpress forums admin screens, forums don’t have the ‘quick edit’ listing.

    I’ve installed and configured a couple of plugins that allow admins to re-order post types. These don’t seem to touch bbpress forums.

    At a last resort I’m sure I could find a code snippet online. But I’d like to work within the CMS admin as much as I can.

    Is there a way to alter the order of the bbpress forums list display without falling back to code?

    vincenzon617
    Participant

    I am thinking about editing what the shortcode [bbp-single-view id=’popular’] displays. What I would like to change it to is to display the most popular topics per day. For example, a topic that has 10 replies one day and so classed as ‘popular’ has 1 the next day and so it is no longer on the list.

    I have made a function that returns the number of replies in the current day by using the topicID but I am unsure where to go from here, to link it to this feature.

    Any help is greatly appreciated!

    #221055
    jason4locations
    Participant

    When I use the bbPress forum search form, it adds it to the search form that was already there, so now there are two. I’d prefer to only have one, the bbPress one. I thought removing the one that was already there would be a WordPress problem (not a bbPress problem) because, to remove it, I could use the Disable Search plugin or the code at

    https://www.wpbeginner.com/awp-tutorials/how-to-disable-the-search-feature-in-wordpress/

    with Code Snippets. But, neither of those two methods worked. I couldn’t find the form that was already there at the widgets page. I also couldn’t remove it by customizing a header. I know that this might seem like more of a WordPress or theme problem, but because bbPress has the option of adding its forum search form, I thought a lot of people who use bbPress might wind up with too many forms (and bring it up at this forum). But, I couldn’t find anyone who has the same problem as me, at this forum. My site is at dancing4locations.org. There, you can see the bbPress form that I want to keep below the login form, and the form that I want to remove (which is to the left of the login form).

    Thank you.

    #221028
    vincenzon617
    Participant

    Thanks for your reply. This is what I thought originally but I checked it and I have already turned this off so I am unsure. I could remove the code <?php bbp_reply_admin_links(); ?> from my ‘loop-single-reply.php’ file but this means I cannot moderate the comments which isn’t ideal.

    #221006
    jason4locations
    Participant

    I got back in, but then I got messages that said “There has been a critical error on your website. Please check your site admin email inbox for instructions” whenever I clicked on Dashboard and a lot of the other things, even while using ?snippets-safe-mode=true (which I can tell you about if you’re interested). So, maybe I’m not in. I don’t know if the problem was only because of how I used the Code Snippets plugin, or if it was because of how I used it with bbPress.

    #221000
    jason4locations
    Participant

    I got back in, but I had to use what is called safe mode, which means that I am still trying to get that code to work.

    #220999
    Back to Front
    Participant

    Hi sorry its been a while! Been busy with other projects.


    @robin-w
    @webmasterfreya this is what I’ve done to reverse the reply order on certain topics. And now I’ve come back to it after a month, I can’t reproduce the issue of it breaking the pagination. It seems to work as expected, without adding another function to mess with the pagination.

    Install

    bbPress – Sort topic replies

    Remove the parts that sort the forum’s topic order, as they are causing errors, and they aren’t desired for this purpose (sorting the reply order)

    // Adds meta box to the side bar of the Forums edit pages
    add_action( 'add_meta_boxes', 'bbPress_meta_box_add' );
    function bbPress_meta_box_add(){
    	add_meta_box( 'bbPress_meta_box_sort_desc', 'Sort Replies', 'bbPress_forum_meta_box', 'forum', 'side', 'high' );
    }
    

    and

    	// Save sort settings for forum
    		if( $_POST['str-bbpress-sort-replies'] == "desc" ){
    			update_post_meta($post_id, '_bbp_sort_desc', 'desc');
    		}elseif( $_POST['str-bbpress-sort-replies'] == "asc" ){
    			update_post_meta($post_id, '_bbp_sort_desc', 'asc');
    		}else{
    			update_post_meta($post_id, '_bbp_sort_desc', 'dft');
    		}
    

    and

    	// Save show lead settings for the forum
    		if( $_POST['str-bbpress-sort-replies-show-lead-topic-forum'] == "yes" ){
    			update_post_meta($post_id, '_bbp_topic_sort_show_lead_topic_forum', 'yes');
    		}elseif( $_POST['str-bbpress-sort-replies-show-lead-topic-forum'] == "no" ){
    			update_post_meta($post_id, '_bbp_topic_sort_show_lead_topic_forum', 'no');
    		}else{
    			update_post_meta($post_id, '_bbp_topic_sort_show_lead_topic_forum', 'dft');
    		}
    

    I can send the whole file if thats more useful.

    Sorry I hope i’m not missing something that we noticed before? Actually my site is using threaded replies. So unfortunately it’s not using pagination, its unfortunate it can’t have both. But I turned it off to test this and it it worked.

    Regarding the buddypress activity stream…
    Here is an example of a member page with buddypress activity stream.
    https://houseonfire.backtofrontdesign.co/members/forum_2tbmmm/
    I think it also works as expected showing forum replies in the reverse chronological order.

    #220997
    jason4locations
    Participant

    I’m going to try the Code Snippets plugin. Please let me know if I am on the right track.

    Back to Front
    Participant

    Heres a get started guide!

    Customizing

    or tldr; copy the files from
    plugins/bbpress
    to
    your-child-theme/bbpress
    and edit them there!

    #220984

    In reply to: contact Form

    shahdoost.ali
    Participant

    I think the code belong to ‘Contact Form 7’ plugin. You should install the plugin and then design the contact form again and then replace this code (or only the ID part) with the code for your new contact form

    #220975
    jason4locations
    Participant

    I’m new at this, so this might not be a good question. Can I use

    Dashboard: Appearance > Customize > Additional CSS

    to make “No Topics” go away? If not, is there an “easy” way to do it, that just involves pasting code somewhere?

    I was able to make my site look nice using < li >, except for the fact that “No Topics” showed up scattered all over the page. I used < li > in one category or forum, and it effected all the others, which was good. So, now I’m trying to make “No Topics” go away.

    My site is at dancing4locations.org. If you go to my site now, it doesn’t look as good as it did before, when I was using parents (with < li >). I’m using version 5.5.5 of WordPress, and version 2.6.6 of bbPress.

    I’m sorry that my last post was marked as spam. It think it had to do with the fact that I didn’t put spaces between <, li, and >, and I kept on trying to edit it.

    Thank you.

    pandex
    Participant

    I want to make changes to the forum without using plugins, I want to mess with the code, but I don’t know where I get it and where to start

    Robin W
    Moderator

    ok, cab I just ask what you mean by ‘ I created a loop-topic-list with a layout that is quite different to the other forums. ‘

    Is this code, and if so what files have you amended or what have you done so far to achieve this?
    If not code, can you explain further

    #220950
    Robin W
    Moderator

    Step by step guide to setting up a bbPress forum – Part 1

    item 6 describes what you want to know, but in essence just set the forums to ‘private’

    If you need a more complicated setup, then use

    Private groups

    For users, if you are setting up manually, then you just need to create them in wordpress (bbpress just uses wordpress users and login), just make sure you’ve turned off auto registration in

    dashboard>settings>general>membership is unticked

    and that in

    dashboard>settings>forums>Roles is ticked and users assigned the participant role

    #220946
    Robin W
    Moderator

    you would create a page and use a shortcode block to add thw following shortcode

    [bbp-topic-form] – which displays the ‘New Topic’ form where you can choose from a drop down menu the forum that this topic is to be associated with.

    then on you home page, insert a ‘button’ block which links to this page

    #220903

    In reply to: Can’t post replies

    Robin W
    Moderator

    bbPress User Roles and Capabilities

    relevant ones are:

    publish_topics
    edit_topics
    publish_replies
    edit_replies

    #220882
    salar2
    Participant

    Hi,
    Is this right?

    #bbpress-forums div.bbp-forum-author img.avatar, #bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar {
      float: right !important;
      }
    #220878
    Robin W
    Moderator

    well you could learn php, some javascript and a little css, work through the security issues of letting users post via email (not sure how you do that), create a receiving handler, and then after many hundreds of hours release the code for free and then support it whilst people bitch about how stupid your plugin is….

    biznisoka
    Participant

    Hi,

    Have two bbpress forums on a webpage, a public one, for “usual” registered users, and private one, for “special” registered users.
    Used bbp private groups plug-in to create both groups.
    Would like to hide private forum menu item from the general registered users (not redirect to some custome page on something).
    Asked the question on plugin’s support page, but got no answer.
    Is there any code snippet or something I could use to hide the menu item which opens private forum? Now i get 404 error.

Viewing 25 results - 1,576 through 1,600 (of 32,436 total)
Skip to toolbar