Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,026 through 4,050 (of 32,517 total)
  • Author
    Search Results
  • #196493
    stracy2
    Participant

    Can a custom (forum) import, import from “any SQL” database or does it have to be an “MySQL” database?

    The high level custom import documentation here states “to setup an import from any SQL database”.

    And the deeper link here state “to setup an import from any MySQL database.”

    #196490
    Robin W
    Moderator

    you can put the code in your child theme functions file or put it in a plugin like this which is probably easier

    Code Snippets

    #196486
    frog65
    Participant

    Hy RobinW
    nice plugin πŸ™‚
    additional, iam interessted in where i build in your code?
    Armin

    #196471
    Robin W
    Moderator
    function custom_bbp_sub_forum_list() {
      $args['separator'] = ';' ;
      return $args;
    }
     add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );

    or use

    bbp style pack

    to get the lists vertical

    #196438
    van24
    Participant

    We’ve been told that our forum may be causing an issue with Google’s thin content algorithm, so I’m looking to find a way to noised some of the pages with little content.

    I’ve already managed to noindex all the views, replies, users, and topics with replies (see the code below, if anyone’s interested).

    I would also like to noindex any forum topic that has total content of less than X words/characters. Is there any way to do that in functions.php? Thanks in advance!

    Here’s what I have so far:

    add_action( 'wp_head', 'topic_add_noindex' );
    function topic_add_noindex()
    {
      if (bbp_is_single_user())
      {
        wp_no_robots();
      }	
      if ( bbp_is_single_topic() && bbp_get_topic_reply_count()==0)
      {
        wp_no_robots();
      }
      if (bbp_is_single_view())
      {
        wp_no_robots();
      }	
      if (bbp_is_single_reply())
      {
        wp_no_robots();
      }	
    }
    #196421
    Robin W
    Moderator

    Import Forums

    although the best that offers is from version 1.1

    #196408

    In reply to: Custom Fields

    Clivesmith
    Participant

    Hi,
    I think that “custom post meta boxes” is more complicated than I need, it creates a new menu on the dashboard and I have to include what I want there, as I will use unique labels on each new topic I think it goes too far. I can see the fields I want with the code above on the front end ‘new topic’, I just want the code to show up in the backend “create new topic” if there is no way to include them in the backend ‘New Topic’ I will accept that.

    I then need to include these fields at the end of the content before posting both in the topic and the replies — content = content + bbp_extra_field1 + bbp_extra_field2 do you know where I can get at the content before it is written to the table.

    Thanks

    daniellekong
    Participant

    I found these instructions from Buddypress and followed the steps in “C. Set Up Group Forums Only” but it still doesn’t work. I still get taken to a non-group page when I click on sub-forums.

    Installing Group and Sitewide Forums

    daniellekong
    Participant

    I have a forum under a buddypress group with the permalink structure /groups/group-name/forum/
    I’ve created a sub-forum but when I click on it the permalink structure changes to /forums/forum/parent-forum-name/sub-forum-name/
    Which means that I’m now taken out of the groups page and in a separate forums page instead.

    Is it possible to change it so that all sub-categories and sub-forums stay within the group?

    I’m not great with code so I’m hoping there’s a really simple solution!

    #196380

    In reply to: Forum relpy deletion

    Robin W
    Moderator

    Custom Capabilities

    and add

    delete replies to participants

    #196379
    ehasimon
    Participant

    I would like to enable my users more power with their replies – i.e. if they wish to delete one they have posted. Where do I need to change the code?

    Robin W
    Moderator

    so 303 should read

    $sticky_query['perm'] = $r['perm'];

    yes ?

    robertstaddon
    Participant

    Here is the incorrect piece of code that is currently there:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['post_status'] = $r['perm'];
    	}

    And here is how the code should read:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['perm'] = $r['perm'];
    	}
    Robin W
    Moderator

    try this filter

    //make sure scheduled stickies don't show - pending fix by bbpress
    add_filter ('bbp_get_stickies', 'rew_get_stickies' , 10 , 2) ;
    function rew_get_stickies ($stickies, $forum_id ) {
    	$return = array () ;
    	//check if any are future
    	foreach ($stickies as $sticky) {
    		if (get_post_status( $sticky ) !='future') 
    		 array_push ($return, $sticky) ;
    	}
    return $return ;	
    }
    #196348
    Robin W
    Moderator

    your site is using the bbpress.min.css file

    you should copy the bbpress.css file to your childtheme as per

    Theme Compatibility

    and amend it there

    #196346

    In reply to: View group members

    Robin W
    Moderator

    I don’t know of any plugins that do this, and it si not settings, so you would need someone to write code to do this

    You will also under most countries data protection laws need the approval of users to their email address being published to other users.

    #196324
    clementeronimo
    Participant

    Hi I push this topic cause I have the same problem.

    I set up a topic on a specific page with shortcode [bbp-single-topic id=$topic_id] on this page https://www.lebanquetdesaintleu.fr/evenement/du-bruit-et-de-fureur-chronique-rap/2018-11-15/

    But when there are too many answers it creates a second page. And when I click I get a 404. But if I try to go to the forum with the direct URL it works. https://www.lebanquetdesaintleu.fr/forums/topic/forum-de-bruit-et-de-fureur-chronique-rap/

    I’m using Avada theme and Buddypress.

    How can I fix it ? Is there a way to show all the exchange on the same page ??

    Thanks,
    ClΓ©ment

    #196309

    In reply to: Custom Fields

    Robin W
    Moderator

    you need to alter ‘post’ to topic and reply eg (untested)

    function adding_custom_meta_boxes( $post_type, $post ) {
        add_meta_box( 
            'my-meta-box',
            __( 'My Meta Box' ),
            'render_my_meta_box',
            'topic',
            'normal',
            'default'
        );
    add_meta_box( 
            'my-meta-box2',
            __( 'My Meta Box 2' ),
            'render_my_meta_box',
            'reply',
            'normal',
            'default'
        );
    
    }
    add_action( 'add_meta_boxes', 'adding_custom_meta_boxes', 10, 2 );
    #196294
    elxafil
    Participant

    Greetings,

    I am looking for the pro version of the plugin: https://wordpress.org/plugins/bbp-user-ranks-lite/ which allows the ability for me to have role based badges below certain members on my forums however both the author’s website and the codecanyon posts of this plugin have been disabled so I am unable to get this plugin, if anyone has a copy they can send me or somewhere I can buy it I will be greatful.

    #196288
    Robin W
    Moderator

    I can’t immediately think of any existing code.

    Option 1 is the quick answer, but more manual.

    It could be coded, a simple way would be to stop replies on the front end if a reply didn’t exist unless an admin.

    you would need to amend form-reply.php – do you

    1. have a child theme and
    2. know how to ftp files to and from your PC?

    If so contact me via my website

    http://www.rewweb.co.uk

    #196287
    Robin W
    Moderator

    lots of ways to do this, you might want to have a think about the best for you

    I have a plugin called

    Private groups

    which lets you set up groups and may be the best solution

    alternately

    if you are able to ftp and edit files the message is held in

    wp-content/plugins/bbpress/templates/default/bbpress/feedback-no-forums.php

    so

    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

    find
    wp-content/plugins/bbpress/templates/default/bbpress/feedback-no-forums.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/feedback-no-forums.php
    bbPress will now use this template instead of the original
    and you can amend this

    so go into it and amend the message to what you desire.

    You could instead put this in your functions file or put it in a code plugin such as

    PHP code snippets (Insert PHP)

    function rew_change_text( $translated_text, $text, $domain ) {
    	if ( $text == 'Oh bother! No forums were found here!' ) {
    	$translated_text = 'whatever you want it to say in here!' ;
    	}
    	return $translated_text;
    }
    
    add_filter( 'gettext', 'rew_change_text', 20, 3 );
    
    #196284
    Robin W
    Moderator

    yes crack that code open it is in includes/widgets, you should find a good place to filter – probably change 159-161 – set the ‘post_parent__in’ to the forum of the current buddypress group, and the settings in the widget will be ignored.

    #196283
    rgilman
    Participant

    Hi Robin, thanks for your response. It looks like (style pack) latest activity gets me close and will provide a great starting point and tutorial from a bbp master.

    Apologies for the lack of clarity in my initial post. Let me explain a bit more.

    I’m developing a site that builds on Commons In A Box. You can see more about what we are doing at https://github.com/ContextInstitute/bfcom. The readme and wiki are out-of-date in the details but the general direction is right.

    We are designing for a large number of BuddyPress groups, each with its own forum. It will be a private site with access only to registered users. Most users will be involved in only a subset of the groups/forums.

    Each user will have a personalized home page/dashboard. One of the features on that dashboard will be a listing of the most recent posts/replies in topics in all of the forums to which that user belongs. So we need to start from something like groups_get_user_groups( bp_loggedin_user_id() ) and then go into something like what you do in (style pack) latest activity.

    Having (style pack) latest activity as a starting point feels like a tremendous help.

    Thank you again. πŸ™‚

    #196274

    Topic: Custom Fields

    in forum Troubleshooting
    Clivesmith
    Participant

    On my site I am the only one that can create a new topic (anyone can reply) I am trying to introduce a couple of pieces of text that will be added to the end of the content of each reply. (they are twitter names and twitter hashtags).

    I have found this piece of code that allows me to add some input fields to a new topic but it only works at the front end, I have been trying with no luck to find a hook I can use to get this to work on the back end. Can any one help please ?

    add_action ( ‘bbp_theme_before_topic_form_content’, ‘bbp_extra_fields’);
    function bbp_extra_fields() {
    $value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field1’, true);
    echo ‘<label for=”bbp_extra_field1″>hashtag</label><br>’;
    echo “<input type=’text’ name=’bbp_extra_field1′ value='”.$value.”<br>’>”;
    $value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field2’, true);
    echo ‘<br><label for=”bbp_extra_field2″>Twitter Name</label><br>’;
    echo “<input type=’text’ name=’bbp_extra_field2′ value='”.$value.”‘>”;
    }
    /* Write out to meta table */
    add_action ( ‘bbp_new_topic’, ‘bbp_save_extra_fields’, 10, 1 );
    add_action ( ‘bbp_edit_topic’, ‘bbp_save_extra_fields’, 10, 1 );
    $topic_id = bbp_get_topic_id();
    function bbp_save_extra_fields($topic_id) {
    if (isset($_POST) && $_POST[‘bbp_extra_field1’]!=”)
    update_post_meta( $topic_id, ‘bbp_extra_field1’, $_POST[‘bbp_extra_field1’] );
    if (isset($_POST) && $_POST[‘bbp_extra_field2’]!=”)
    update_post_meta( $topic_id, ‘bbp_extra_field2’, $_POST[‘bbp_extra_field2’] );
    }

    #196261
    Robin W
    Moderator

    not tested as going out soon, but this should work

    add_action ( 'bbp_new_topic', 'myprefix_assign_tag_to_post', 10, 4 );
    add_action ( 'bbp_edit_topic', 'myprefix_assign_tag_to_post', 10, 4 );
    
    function myprefix_assign_tag_to_post($topic_id, $forum_id, $anonymous_data, $topic_author) {
    if( $forum_id == '168'  && bbp_current_user_can_publish_topics() ) {
    	wp_set_post_terms( $topic_id, 'introductions', 'topic-tag', true );
    }
    
    elseif($forum_id == '1343' && bbp_current_user_can_publish_topics() ) {
    		wp_set_post_terms( $topic_id, 'discovery', 'topic-tag', true );
    
    }
    }
Viewing 25 results - 4,026 through 4,050 (of 32,517 total)
Skip to toolbar