Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,076 through 4,100 (of 32,522 total)
  • Author
    Search Results
  • #196107
    lookingahead
    Participant

    I hate to resurrect an old thread, but it contains pretty much everything I’d need to reference.

    The code posted by @crzyhrse above WORKS — for removing the profile links from author avatars when those authors are replying to a thread in a forum. BRILLIANT!

    Now, I’d like to use the same technique/code on the ‘Group Administrator’ avatars.

    I want to KEEP the images, the name…just like how the code posted (above) by @crzyhrse works with people in a discussion. For the life of me, though, I can’t seem to figure out how to use that same code to disable the links in ‘Group Administrator’ avatars, while keeping the images and names intact.

    Anyone happen to have any ideas?

    Here’s the code I’m using…note that the first half is the code that works to shut off links to author profiles PERFECTLY…it’s the second chunk of code that doesn’t seem to affect ‘Group Administrators’ in the same manner.

    Here goes:

    /* Remove link urls from forum author instances...
    */
    add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2);
    add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2);
    add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2);
    function remove_author_links($author_link, $args) {
    $author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link);
    return $author_link;
    }
    
    /* Remove link urls from admin avatars...
    */
    add_filter( 'BBP_Users_Admin_link', 'remove_Users_Admin_links', 10, 2);
    function remove_Users_Admin_links($Users_Admin_link, $args) {
    $Users_Admin_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $Users_Admin_link);
    return $Users_Admin_link;
    }
    

    Thanks in advance for any and all assistance!

    #196089
    19dapperdrake53
    Participant

    HELP: WP 4.9.8; bbPress 2.5.15; site: azor.vip

    Hello, I am a senior citizen noob building a one-off site. I wish to post admin questions from my backend what will appear live on my site.

    I have written my post and clicked on Published. Nothing happens. Some time ago when I asked this same question, I was told to do something with shortcodes. I became frustrated because I don’t know what a shortcode is, where I find it, and what I do with it. So I am re-visiting my original question.

    I would be very grateful if you could give me some steps.

    #196065
    eigodeasobo
    Participant

    I would like to output topics with multiple tags.

    For that, I wrote the following code, but it did not work as I expected.

    <section class="fluits">				
    <?php
    $args_fluits = array(
      'post_type' => 'topic',
      'tax_query' => array(
        array(
          'taxonomy' => 'tag_fluits',
          'field'    => 'term_id',
          'terms'    => array( 11, 22 ),
        ),
      ),
    );
    $query_fluits = new WP_Query( $args_fluits );
    ?> 
    <?php if ( bbp_has_topics( $query_fluits ) ) : ?>
      <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
      <?php bbp_get_template_part( 'loop',       'topics'    ); ?>
      <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    <?php else : ?>
      <?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    <?php endif; ?>		
    </section>
    
    <section class="vegetables">				
    <?php
    $args_vegetables = array(
      'post_type' => 'topic',
      'tax_query' => array(
        array(
          'taxonomy' => 'tag_vegetables',
          'field'    => 'term_id',
          'terms'    => array( 33, 44 ),
        ),
      ),
    );
    $query_vegetables = new WP_Query( $args_vegetables );
    ?> 
    <?php if ( bbp_has_topics( $query_vegetables ) ) : ?>
      <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
      <?php bbp_get_template_part( 'loop',       'topics'    ); ?>
      <?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    <?php else : ?>
      <?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    <?php endif; ?>		
    </section>

    Any hints or different args to use to achieve this?

    Thanks.

    lookingahead
    Participant

    @robin-w oh, i used a string modifier to change ‘forum’ to ‘discussion’ — that is how i got the tabs in buddypress groups to say ‘discussion’ versus ‘forum’

    i’ll go back and modify it to say ‘chat’ later, but for now many things in the site that used to say ‘forum’ say ‘discussion’….because i can change that at-will and it’s not causing conflicts, i’ve not updated it yet to say ‘chat.’

    the problem that is currently unmovable though is the group forum slug name; it still says ‘forum’ at the end of all buddypress groups. that was unaffected by the string modifier, and is apparently hard-coded.

    i went to the wp_options table and it does currently say ‘chat’…..sooooo…….apparently that setting is not being used in buddypress when it creates group forum slugs. it is defaulting to ‘forum’ no matter what i do.

    is there another place within bbpress where the instructions on how to create a slug for any type of forum whatsoever is listed…even ‘hard-coded’ as a default setting?

    Robin W
    Moderator

    the slug is a setting held in the database, not in code or a file.

    the single forum root slug is held in wp_options in the database, and is changed by the setting in
    dashboard>settings>forums>single forum slug where you have a label of ‘discuusion’ and I even with buddypress have a description of ‘Forum’, so something is messing round with that and stopping you setting ‘forum’ I think.

    I don’t get ‘discussion’ as the single forum label when I use buddypress, so something else is setting that, hence my suggestions above.

    so if you go to wp_options table and find _bbp_root_slug you can see what it is set to.

    You could just go to wp_options table and find _bbp_root_slug and set it to ‘chat’

    #195994
    Robin W
    Moderator

    by code

    //create vertical list subforum layout
    function custom_bbp_sub_forum_list() {
      $args['separator'] = '
    ';
      return $args;
    }
     add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );

    or this plugin has it as a setting in

    dashboard>settings>bbp style pack>Forum Display

    bbp style pack

    #195990
    Martin J
    Participant

    On the home of the forum, I have categories with sub forums in them, but need to change the layout to be 2 columns instead of comma separated forums. What file can I add to my theme to override this? bbPress has a crazy common between the <li> tags and drives me nuts because you can’t remove that using css.

    lookingahead
    Participant

    @robin-w oh no worries on this being a ‘new’ thing for you to hear — as someone who does not work with buddypress like yourself you’re never going to hear this. it’s because it is a way that bbpress sends information to buddypress when buddypress pulls info from bbpress into it, when it uses bbpress programming to create ‘group forums.’

    it’s not a bug; it’s how the interface between bbpress and buddypress works.

    at least, that’s what i’m gathering now, after reading other people’s posts with the same issue in forums all over the web.

    so my question to you now: what is the file that bbpress uses to say what the slug is — the URL name, which in this case is just ‘forum’….not ‘forums’ but ‘forum’ — so i can alter that?

    i HHAAAATE altering core files, but in this case it’s likely needed.

    whatever ‘default URL/slug’ command is used when buddypress pulls in forum creation/function into bbpress……chances are, that is the file i will (gulp!) need to modify.

    i’m guessing that the same code/file is used to be the ‘default slug name’ in bbpress. which is….’forum’

    what file does that? creates a default ‘forum’ in the URL/slug when a forum is created?

    #195972

    In reply to: Theme

    Robin W
    Moderator

    unfortunately when themes don’t obbey the rules, I can’t code for them 🙂

    #195966

    In reply to: Theme

    Robin W
    Moderator

    apologies put

    .bbp-topic-content p {
        color: black !important;
    }
    #195961

    In reply to: Theme

    Robin W
    Moderator

    put this is my plugin’s custom css tab

    bbp-topic-content p {
        color: black !important;
    }
    #195956
    Robin W
    Moderator

    untested, but this should do it

    add_filter ('bbp_after_has_search_results_parse_args', 'my_function')
    
    my_function ($args) {
    	
    		// bbp_get_closed_status_id() REMOVED,
    		$post_statuses = array(
    			bbp_get_public_status_id(),
    			bbp_get_spam_status_id(),
    			bbp_get_trash_status_id()
    		);
    
    		// Add support for private status
    		if ( current_user_can( 'read_private_topics' ) ) {
    			$post_statuses[] = bbp_get_private_status_id();
    		}
    
    		// Join post statuses together
    		$args['post_status'] = implode( ',', $post_statuses );
    		
    return $args ;
    
    }
    #195947
    Vili
    Participant

    That is indeed it, thanks! So I was barking the wrong tree, nothing wrong with WordPress being able to access bbPress.

    Where should one look for bbPress function documentation these days? I notice that I have difficulties finding information, and when I do find something, figuring out if the functions are for bbPress 1, bbPress 2, or BuddyPress is sometimes difficult. There is some sort of a list here but bbp_get_topic_tag_names() is not included, among others.

    #195946
    Robin W
    Moderator

    sorry, untested and taken from my files – try

    function rew_no_reply_per_forum ($reply_address) {
    	$forum_id = bbp_get_forum_id() ;
    	if ($forum_id == 6 ) $reply_address =  'xxx@yyy.com' ;
    	if ($forum_id == 7) $reply_address =  'abd@hdhd.com' ;
    	return $reply_address ;
    }
    
    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply_per_forum') ;
    #195945
    maxlevel
    Participant

    I pasted it in the functions.php file of my child theme and it threw this error message before I could save it:
    ————————————-

    Your PHP code changes were rolled back due to an error on line 271 of file wp-content/themes/kleo-child/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘$forum_id’ (T_VARIABLE), expecting ‘(‘

    ————————————-

    Line 271 is:

    if $forum_id = 18747 $reply_address = 'mlt-club@monalisa-twins.com' ;

    The first item in the list of forums

    #195937
    Robin W
    Moderator

    try this in your functions file

    function rew_no_reply_per_forum ($reply_address) {
    	$forum_id = bbp_get_forum_id() ;
    	if $forum_id = 6 $reply_address =  'xxx@yyy.com' ;
    	if $forum_id = 7 $reply_address =  'abd@hdhd.com' ;
    	return $reply_address ;
    }
    
    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply_per_forum') ;
    #195933
    Robin W
    Moderator

    @mrwrongusername

    is doable but would require a small amount of custom code beyond free help

    contact me via

    http://www.rewweb.co.uk/contact-me/

    #195920
    billysgtr
    Participant

    I am replying my own post in case anyone has the same problem.
    I solved my problem using the following script https://gist.github.com/ntwb/7797990
    and I added style attribute for the html elements I need. Now everything works fine.

            // Span
            'span'             => array(
                'class'     => true,
                'style'     => true,
            ),
    #195917
    AiratTop
    Participant

    bbPress 2.5.14:

    FILE: /var/www/test.site/wp-content/plugins/bbpress/includes/admin/converter.php
    -------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------
     310 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4
    -------------------------------------------------------------------------------------------------
    
    FILE: /var/www/test.site/wp-content/plugins/bbpress/includes/admin/tools.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     144 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    -----------------------------------------------------------------------------------------------------------

    In bbPress 2.6-RC6 everything is good.

    bbPress 2.5.14
    PHP Compatibility Checker 1.4.6

    #195915
    billysgtr
    Participant

    I have enabled the Visual Editor for topics and replies using the following:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    The problem is that only administrator can add text-colors font-styes and other things like that.

    I am getting html format when a subscriber uses colors and font-styles
    <span style=”color: #00ff00;”><span style=”font-family: ‘book antiqua’, palatino, serif;”>wfwffwwf</span></span>

    WP Version 4.9.8
    bbPress Version 2.5.14

    I would really appreciate any help,
    Thanks!

    #195890
    Robin W
    Moderator

    this should do it – make sure anonymous is turned on to allow creation, then this stops topics being created – ie the topic form being shown

    add_filter ( 'bbp_current_user_can_publish_topics', 'rew_prevent_anonymous' );
    
    function rew_prevent_anonymous ($retval) {
    	// prevent topic creation if user is not logged in
    	if ( !is_user_logged_in()) {
    		$retval = false;
    	}
    
    return $retval;
    
    }

    if you don’t know how to add to the functions file, use this plugin and put the code in there

    Code Snippets

    #195889
    Robin W
    Moderator

    do you know how to add a function to a function file if I gave you the code ?

    #195844
    marketing050
    Participant

    Okay, i used shortcodes for pages and redirected the index to these specific pages. But now the different users can’t see the specific topics. They are listed in the index with all the topics, but when you click further on a specific topic, I still get an 404 error. How do i change this?

    #195789

    In reply to: Importer major issue

    Al_ambique
    Participant

    I forgot to mention the other SQL script required to fix the import.
    Only the first post of each topic was displayed. A quick glance at the database and I saw that post_parent of each reply was set on the forum and not the topic.
    So here we go :

    UPDATE wp_posts m1 
    LEFT JOIN wp_postmeta m2 ON m1.ID = m2.post_id AND meta_key = '_bbp_topic_id'
    LEFT JOIN wp_posts m3 ON m1.post_parent = m3.ID AND m3.post_type != 'forum'
    SET m1.post_parent = m2.meta_key
    WHERE m1.post_type = 'reply' AND m1.post_parent != m2.meta_value
Viewing 25 results - 4,076 through 4,100 (of 32,522 total)
Skip to toolbar