Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,376 through 8,400 (of 32,519 total)
  • Author
    Search Results
  • #164075

    In reply to: bbPress 2.5.8

    Avalon98
    Participant

    Curious… the solution:

    
    add_filter('private_title_format', 'ntwb_remove_private_title');
    function ntwb_remove_private_title($title) {
    	return '%s';
    }
    

    used to work for taking off the “Private” suffix for my Private forums… now it’s not working since the upgrade… any solutions??

    #164074
    Robkk
    Moderator

    Its some CSS in your theme something is hiding the .reply class probably in your WordPress comments and it is affecting bbPress replies.

    Adding this CSS should fix it.

    #bbpress-forums .reply {
      display: block
    }
    #164073
    division123
    Participant

    Hi, i am trying to remove the sidebar as well, below is my code from page.php which I have duplicated and renamed bbpress.php but I can’t see which code I need to remove?

    <?php get_header(); ?>

    <?php
    $options = get_option(‘sf_dante_options’);

    $default_show_page_heading = $options[‘default_show_page_heading’];
    $default_page_heading_bg_alt = $options[‘default_page_heading_bg_alt’];
    $default_sidebar_config = $options[‘default_sidebar_config’];
    $default_left_sidebar = $options[‘default_left_sidebar’];
    $default_right_sidebar = $options[‘default_right_sidebar’];
    $sidebar_width = $options[‘sidebar_width’];

    $pb_active = sf_get_post_meta($post->ID, ‘_spb_js_status’, true);
    $show_page_title = sf_get_post_meta($post->ID, ‘sf_page_title’, true);
    $page_title_style = sf_get_post_meta($post->ID, ‘sf_page_title_style’, true);
    $page_title = sf_get_post_meta($post->ID, ‘sf_page_title_one’, true);
    $page_subtitle = sf_get_post_meta($post->ID, ‘sf_page_subtitle’, true);
    $page_title_bg = sf_get_post_meta($post->ID, ‘sf_page_title_bg’, true);
    $fancy_title_image = rwmb_meta(‘sf_page_title_image’, ‘type=image&size=full’);
    $page_title_text_style = sf_get_post_meta($post->ID, ‘sf_page_title_text_style’, true);
    $fancy_title_image_url = “”;

    if ($show_page_title == “”) {
    $show_page_title = $default_show_page_heading;
    }
    if ($page_title_bg == “”) {
    $page_title_bg = $default_page_heading_bg_alt;
    }
    if ($page_title == “”) {
    $page_title = get_the_title();
    }

    foreach ($fancy_title_image as $detail_image) {
    $fancy_title_image_url = $detail_image[‘url’];
    break;
    }

    if (!$fancy_title_image) {
    $fancy_title_image = get_post_thumbnail_id();
    $fancy_title_image_url = wp_get_attachment_url( $fancy_title_image, ‘full’ );
    }

    $sidebar_config = sf_get_post_meta($post->ID, ‘sf_sidebar_config’, true);
    $left_sidebar = sf_get_post_meta($post->ID, ‘sf_left_sidebar’, true);
    $right_sidebar = sf_get_post_meta($post->ID, ‘sf_right_sidebar’, true);

    if ($sidebar_config == “”) {
    $sidebar_config = $default_sidebar_config;
    }
    if ($left_sidebar == “”) {
    $left_sidebar = $default_left_sidebar;
    }
    if ($right_sidebar == “”) {
    $right_sidebar = $default_right_sidebar;
    }

    sf_set_sidebar_global($sidebar_config);

    $page_wrap_class = $post_class_extra = $sidebar_class = ”;
    if ($sidebar_config == “left-sidebar”) {
    $page_wrap_class = ‘has-left-sidebar has-one-sidebar row’;
    if ($sidebar_width == “reduced”) {
    $post_class_extra = ‘push-right col-sm-9’;
    $sidebar_class = ‘col-sm-3’;
    } else {
    $post_class_extra = ‘push-right col-sm-8’;
    $sidebar_class = ‘col-sm-4’;
    }
    } else if ($sidebar_config == “right-sidebar”) {
    $page_wrap_class = ‘has-right-sidebar has-one-sidebar row’;
    if ($sidebar_width == “reduced”) {
    $post_class_extra = ‘col-sm-9’;
    $sidebar_class = ‘col-sm-3’;
    } else {
    $post_class_extra = ‘col-sm-8’;
    $sidebar_class = ‘col-sm-4’;
    }
    } else if ($sidebar_config == “both-sidebars”) {
    $page_wrap_class = ‘has-both-sidebars row’;
    $post_class_extra = ‘col-sm-9’;
    $sidebar_class = ‘col-sm-3’;
    } else {
    $page_wrap_class = ‘has-no-sidebar’;
    }

    $remove_breadcrumbs = sf_get_post_meta($post->ID, ‘sf_no_breadcrumbs’, true);
    $remove_bottom_spacing = sf_get_post_meta($post->ID, ‘sf_no_bottom_spacing’, true);
    $remove_top_spacing = sf_get_post_meta($post->ID, ‘sf_no_top_spacing’, true);

    if ($remove_bottom_spacing) {
    $page_wrap_class .= ‘ no-bottom-spacing’;
    }
    if ($remove_top_spacing) {
    $page_wrap_class .= ‘ no-top-spacing’;
    }

    $options = get_option(‘sf_dante_options’);
    $disable_pagecomments = false;
    if (isset($options[‘disable_pagecomments’]) && $options[‘disable_pagecomments’] == 1) {
    $disable_pagecomments = true;
    }

    ?>

    <?php if ($show_page_title) { ?>
    <div class=”container”>
    <div class=”row”>
    <?php if ($page_title_style == “fancy”) { ?>
    <?php if ($fancy_title_image_url != “”) { ?>
    <div class=”page-heading fancy-heading col-sm-12 clearfix alt-bg <?php echo $page_title_text_style; ?>-style fancy-image” style=”background-image: url(<?php echo $fancy_title_image_url; ?>);”>
    <?php } else { ?>
    <div class=”page-heading fancy-heading col-sm-12 clearfix alt-bg <?php echo $page_title_bg; ?>”>
    <?php } ?>
    <div class=”heading-text”>
    <h1 class=”entry-title”><?php echo $page_title; ?></h1>
    <?php if ($page_subtitle) { ?>
    <h3><?php echo $page_subtitle; ?></h3>
    <?php } ?>
    </div>
    </div>
    <?php } else { ?>
    <div class=”page-heading col-sm-12 clearfix alt-bg <?php echo $page_title_bg; ?>”>
    <div class=”heading-text”>
    <h1 class=”entry-title”><?php echo $page_title; ?></h1>
    </div>
    <?php
    // BREADCRUMBS
    if (!$remove_breadcrumbs) {
    echo sf_breadcrumbs();
    }
    ?>
    </div>
    <?php } ?>
    </div>
    </div>
    <?php } ?>

    <?php if ($sidebar_config != “no-sidebars” || $pb_active != “true”) { ?>
    <div class=”container”>
    <?php } ?>

    <div class=”inner-page-wrap <?php echo $page_wrap_class; ?> clearfix”>

    <?php if (have_posts()) : the_post(); ?>

    <!– OPEN page –>
    <div class=”clearfix <?php echo $post_class_extra; ?>” id=”<?php the_ID(); ?>”>

    <?php if ($sidebar_config == “both-sidebars”) { ?>
    <div class=”row”>
    <div class=”page-content col-sm-8″>
    <?php the_content(); ?>
    <div class=”link-pages”><?php wp_link_pages(); ?></div>

    <?php if ( comments_open() && !$disable_pagecomments ) { ?>
    <div id=”comment-area”>
    <?php comments_template(”, true); ?>
    </div>
    <?php } ?>
    </div>

    <aside class=”sidebar left-sidebar col-sm-4″>
    <div class=”sidebar-widget-wrap sticky-widget”>
    <?php dynamic_sidebar( $left_sidebar ); ?>
    </div>
    </aside>
    </div>
    <?php } else { ?>
    <div class=”page-content clearfix”>

    <?php the_content(); ?>

    <div class=”link-pages”><?php wp_link_pages(); ?></div>

    <?php if ( comments_open() && !$disable_pagecomments ) { ?>
    <?php if ($sidebar_config == “no-sidebars” && $pb_active == “true”) { ?>
    <div id=”comment-area” class=”container”>
    <?php } else { ?>
    <div id=”comment-area”>
    <?php } ?>
    <?php comments_template(”, true); ?>
    </div>
    <?php } ?>
    </div>
    <?php } ?>

    <!– CLOSE page –>
    </div>

    <?php endif; ?>

    <?php if ($sidebar_config == “left-sidebar”) { ?>
    <aside class=”sidebar left-sidebar <?php echo $sidebar_class; ?>”>
    <div class=”sidebar-widget-wrap sticky-widget”>
    <?php dynamic_sidebar( $left_sidebar ); ?>
    </div>
    </aside>
    <?php } else if ($sidebar_config == “right-sidebar”) { ?>
    <aside class=”sidebar right-sidebar <?php echo $sidebar_class; ?>”>
    <div class=”sidebar-widget-wrap sticky-widget”>
    <?php dynamic_sidebar( $right_sidebar ); ?>
    </div>
    </aside>
    <?php } else if ($sidebar_config == “both-sidebars”) { ?>
    <aside class=”sidebar right-sidebar col-sm-3″>
    <div class=”sidebar-widget-wrap sticky-widget”>
    <?php dynamic_sidebar( $right_sidebar ); ?>
    </div>
    </aside>
    <?php } ?>

    </div>

    <?php if ($sidebar_config != “no-sidebars” || $pb_active != “true”) { ?>
    </div>
    <?php } ?>

    <!–// WordPress Hook //–>
    <?php get_footer(); ?>

    #164071
    melanie bund
    Participant

    Hi Robkk – on the test site i have deactivated every plugin (so it looks odd) and i still have the same problem – replies empty, am using twentytwelve theme so should not be a theme problem.
    http://photohunters.org/photohunters-test/topic/sony-alpha-dslr-a100/#post-348
    Tha only thing i have added to fuctions.php is to hide author links and profile and avatar

    add_filter('bbp_before_get_breadcrumb_parse_args', 'mycustom_breadcrumb_options');
    
    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;
     }
     
    
    add_filter ('bbp_before_get_author_link_parse_args' , 'rew_remove_avatar' ) ;
    add_filter ('bbp_before_get_reply_author_link_parse_args' , 'rew_remove_avatar' ) ;
    add_filter ('bbp_before_get_topic_author_link_parse_args' , 'rew_remove_avatar' ) ;
    function rew_remove_avatar ($args) {
    	$args['type'] = 'name' ;
    	return $args ;
    }

    Any ideas? Melanie
    p.s. pop gone on main site, trying to sort out the problem…

    saintjaved
    Participant

    One more question. Can bbpress work on intranets? If they can, is there something in the bbpress plugin code that is conflicting probably with the wordpress code on the firehost server? I’m running wordpress 4.2.2 and bbpress 2.5.8

    stickFinger
    Participant

    Hi all
    After a lot of digging i´ve found that the only way to translate the Topic Status dropdown strings is via the “bbpress/includes/topics/functions.php”, around line 1963, we have:

    function bbp_get_topic_statuses() {
    	return apply_filters( 'bbp_get_topic_statuses', array(
    		bbp_get_public_status_id()  => _x( 'Aberto',    'Open the topic',        'bbpress' ),
    		bbp_get_closed_status_id()  => _x( 'Fechado',  'Close the topic',       'bbpress' ),
    		bbp_get_spam_status_id()    => _x( 'Spam',    'Spam the topic',        'bbpress' ),
    		bbp_get_trash_status_id()   => _x( 'lixeira',   'Trash the topic',       'bbpress' ),
    		bbp_get_pending_status_id() => _x( 'Pendente', 'Mark topic as pending', 'bbpress' ),

    i´ve also downloaded the last development version of pt_BR.po from https://translate.wordpress.org/projects/bbpress/dev but despite of strings being there they don´t get translated.
    Opening the po with a text editor i´ve noticed the absense of the “X-Poedit-KeywordsList: ” which i guess should be something like that:

    "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
    "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"

    For now i´ll try to add the keywordlist by hand at the top of my pt_BR file. Hope that fixes te issues specially with the _x:1,2c keyword

    What could be wrong with the glotpress generator?
    Thanks

    #164063

    In reply to: Help!! Please!!

    Celtic
    Participant

    oh ok, I was putting in the hole code which would have broke the quota … Ya, I will only need to edit Moderator roles … So that plugin will work… Thank you.

    #164060
    SethTurin
    Participant

    Wow thanks for answering so quickly! I doubt my code will be up to any useful coding standard, but I’ll be happy to share what I come up with anyway. It would be a great help to look at other attempts at this, even if it’s for another forum. Can you show me their code?

    Thanks

    #164059
    Robkk
    Moderator

    The Invision converter is in

    wp-content\plugins\bbpress\includes\admin\converters\invision

    if you don’t mind share your conversion code/experience to the community, it would help a lot.

    There have been users doing something similar to this especially for attachments (but probably different forum system). I can also show you their code if that would help you any.

    ghoush
    Participant

    An update:

    Here is the fixed up code, all working now. This version creates a meta value for the post and checks that next time it gets published. No more duplicates if something goes published->draft/pending->published again.

    
    function gh_post_published_create_topic( $ID, $post ) {
        $checkduplicate = get_post_meta( $ID, 'gh_topic_created',true);
        if ( empty( $checkduplicate ) ) {
            $author = $post->post_author;
            $name = get_the_author_meta( 'display_name', $author );
            $title = $post->post_title;
            $permalink = get_permalink( $ID );
            $excerpt = $post->post_excerpt;
            $subject = sprintf( '%s: %s', $name, $title );
            $message = sprintf ('[b]%s[/b]' . "\n" . 'By %s' . "\n\n" . '[i]%s[/i]' . "\n\n" . 'View: %s' . "\n\n", $title, $name, $excerpt, $permalink );
            $tags = wp_get_post_tags( $ID, array( 'fields' => 'names' ) );
    
            $new_post = array(
                'post_title'    => $subject,
                'post_content'  => $message,
                'post_parent' => 691,
                'post_status'   => 'publish',
                'post_type' => 'topic'
            );
            $topic_meta = array(
                'forum_id'       => $new_post['post_parent']
            );
            $topic_id = bbp_insert_topic($new_post, $topic_meta);
            if ( !empty( $topic_id ) ) {
                add_post_meta($ID, 'gh_topic_created', 'true', true);
                $term_taxonomy_ids = wp_set_object_terms( $topic_id, $tags, 'topic-tag' );
                bbp_update_forum(array('forum_id' => 691));
            }
        }
    }
    add_action( 'publish_post', 'post_published_create_topic', 10, 2 );
    
    ghoush
    Participant

    I have searched and put code together and tested. Now whenever a new post is created in WordPress a new topic is created in a specific sub-forum on my bbPress. This is working great. It brings over the tags and everything.

    The one problem I have is that the publish_post action fires every time a post is set to published. So if a post gets set back to draft or pending review, and then published again, another forum topic is created. There are problaby 2097324907629306 ways this can be solved. I am only coming up with some pretty stupid ones I think, so I was hoping someone might have a good idea here.

    Here is the code for your functions.php:

    
    function post_published_create_topic( $ID, $post ) {
        $author = $post->post_author;
        $name = get_the_author_meta( 'display_name', $author );
        $title = $post->post_title;
        $permalink = get_permalink( $ID );
        $excerpt = $post->post_excerpt;
        $subject = sprintf( '%s: %s', $name, $title );
        $message = sprintf ('[b]%s[/b]' . "\n" . 'By %s' . "\n\n" . '[i]%s[/i]' . "\n\n" . 'View: %s' . "\n\n", $title, $name, $excerpt, $permalink );
        $tags = wp_get_post_tags( $ID, array( 'fields' => 'names' ) );
    
        $new_post = array(
            'post_title'    => $subject,
            'post_content'  => $message,
            'post_parent' => 691,
            'post_status'   => 'publish',
            'post_type' => 'topic'
        );
        $topic_meta = array(
        'forum_id'       => $new_post['post_parent']
        );
        $topic_id = bbp_insert_topic($new_post, $topic_meta);
        $term_taxonomy_ids = wp_set_object_terms( $topic_id, $tags, 'topic-tag' );
    }
    add_action( 'publish_post', 'post_published_create_topic', 10, 2 );
    

    Take that code and put it in your themes functions.php (hopefully you are using a child theme.) The 691 is my sub-forums ID, replace that with the right ID for yours. The format of the post and its content is done on the line that starts “$message = sprintf”.

    Now I just need to get it to stop creating a new post every time the same post is published. So far my ideas have been something like matching up the topics title with a string comparison, but that seems a bit heavy. There should be a simpler way and I am just not seeing it right now.

    beherawr
    Participant

    This can happen also in some default themes like Twenty Fifteen (should work in Twenty Twelve though), but can also be easily fixed by placing the bbPress template files into a child theme.

    https://codex.bbpress.org/theme-compatibility/

    I tried copying my ‘css’ and ‘bbpress’ directories from my template files to my theme as outlined in your link, however it changed nothing.

    Do profiles show up without BuddyPress?

    Not quite sure what you mean…. if you mean can I see a user profile with bbpress deactivated then the answer is no.

    Also, the link to the ‘Edit Profile’ button is exactly what I needed, however it currently returns to 404 because of the previous unresolved issue.

    #164036
    Robkk
    Moderator

    There is no shortcode for an edit profile page.

    Shortcodes

    #164035
    Robkk
    Moderator

    @bananadan

    If you do find someone that could do it for you, if you don’t mind share your conversion code/experience to the community.

    #164034
    Robkk
    Moderator

    @melanie-bund

    FIx that annoying dialog saying

    you must be logged in to chat

    It never stays closed no matter how many times I close it, and it really doesn’t encourage new users to want to create an account for the site.

    Try some troubleshooting , see if it is a plugin or theme issue.

    Troubleshooting

    Robkk
    Moderator

    1. Users are set to be able to edit their posts/replies, and the Edit button does show up, however when they click on Edit it simply goes to 404. Admins also cannot edit via the Edit button without 404.

    This can happen also in some default themes like Twenty Fifteen (should work in Twenty Twelve though), but can also be easily fixed by placing the bbPress template files into a child theme.

    https://codex.bbpress.org/theme-compatibility/

    2. User profiles are not showing up. Upon clicking on an avatar or manually typing in the profile url (with my username) it returns 404.

    Do profiles show up without BuddyPress?

    (I also need to figure out how to put an ‘Edit Profile’ button somewhere, but that won’t matter if I can’t fix these other two issues)

    Works for bbPress profiles though, I might update it for BuddyPress later.

    Layout and functionality – Examples you can use

    #164030
    Robkk
    Moderator

    I made the forums page using the permalink method and it works great. The problem is that underneath the list of available forums there is a gray circle with a white head and the word By, as if there should be an author shown. But this is the page of all of the forums by various authors. I can’t seem to get it to go away.


    @caseylifec

    sounds like post meta that is being shown because of your theme and the template that bbPress is using from that theme to show the forums.

    You can hide that data with CSS or remove it completely by creating a template specifically for bbpress and remove the code that is rendering the data. Link to your site so I could help you remove the data with CSS.

    If you want to try removing the code you can also try following this guide too.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #164028
    Robkk
    Moderator

    I just found this plugin and it seems to mention some bbPress support

    https://wordpress.org/plugins/email-encoder-bundle/

    It lists a code example for bbPress here

    https://wordpress.org/plugins/email-encoder-bundle/faq/

    Robkk
    Moderator

    Did this happen with the latest update of bbPress??
    Also do some troubleshooting and try to find a plugin or theme issue.

    Troubleshooting

    Blank Pages

    #164023
    PinkishHue
    Participant

    Sorry for the delayed reply, you could upload your screengrab to http://imgur.com and then give us the link.

    Do you have some topics within your forums? Could it be that the template is saying ‘by’ as it’s trying to show the latest topic but there’s no topic there to show?

    And what theme are you using? It could be that the ‘by’ has been hard coded in to the templates?

    #164019
    PinkishHue
    Participant

    The positioning should be do-able using CSS but it’s hard to advise without access to the page to see what CSS classes etc are on those elements.

    For the login form area you want something like…

    .login-form {
    width: 70%;
    float: left;
    display: inline;
    }

    and for the search area…

    .theclassname {
    width: 27%;
    float: right;
    display: inline;
    }

    But you may also want to look in to using media queries so that this CSS is only used when the browser window is big (on a pc) so that when people access the site on a smaller browser window (on a mobile or tablet etc) those areas aren’t all crammed in together.

    Re: defining different class names – I think we’d need to see your site/code to make sense of that, I just had a quick look at the buddypres template for the registration page and can’t see any classes of .login-form there so it may depend on your theme.

    Hope that’s of some help 🙂

    #164005

    In reply to: Topic & Reply count

    Robin W
    Moderator

    try changing

    $args['count_sep'] = false;
    

    to
    $args['count_sep'] = '';

    #164004
    melanie bund
    Participant

    Hi Am not sure where my other 2 posts went, have posted twice with code, maybe that is the problem the code. My problem is that the replies to topics appear empty.
    Am using wordpress 4.2, bbpress latest version as just updated to see if that might be the problem
    ANY help wold be greatly apreciated
    forum:
    http://photohunters.org/forum/members-blog/
    reply:
    http://photohunters.org/topic/shutter-speed-cheat-sheet/#post-666

    Thank you Melanie

    #163989

    In reply to: Topic & Reply count

    milenushka
    Participant

    Hi @robin-w,

    and how to get rid of the little comas in between the sub forums?

    I added this code to my functions.php, but the comas still appear..

     function remove_counts() {
    $args['show_topic_count'] = false;
    $args['show_reply_count'] = false;
    $args['count_sep'] = false;
     return $args;
    }
    add_filter('bbp_before_list_forums_parse_args', 'remove_counts' );
    

    thank you

    #163988

    In reply to: Importing from WBB4

    Stephen Edgar
    Keymaster

    For any code you can create anonymous (i.e. You do not require a GitHub account) and paste your code here https://gist.github.com it makes the code much easier to read than posting here on bbPress.org.

    The 4 tables would be wbb1_board, wbb1_thread, wbb1_post and wcf1_user

    Open up phpMyAdmin on your install, navigate to the database, click one of the 4 tables I listed above, then click structure, take a screen shot of similar to this example here.

Viewing 25 results - 8,376 through 8,400 (of 32,519 total)
Skip to toolbar