Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,826 through 6,850 (of 32,519 total)
  • Author
    Search Results
  • oelen000
    Participant

    Hi, I am using bbpress on a website together with the plugin from LCweb called private content. The problem i have is that registered users cannot see the actual post. They only have the possibility to comment on the post. The text of the post itself is not shown. When i disable private content plugin it’s working great. I had support from LCweb and they told me that they double checked their code and from their side everything was ok and I should look for support at the BBpress forum. Anybody any idea?

    #172380

    In reply to: add a specific class

    Robin W
    Moderator

    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/loop-single-forum.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/loop-single-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    amend line 12 to

    <ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class('', $classes[] = 'hello' ); ?>>

    #172372

    In reply to: vbulletin 3.x import

    Stephen Edgar
    Keymaster

    The ———————- is typically due to WordPress losing its database connection 🙁

    If you open up a second tab to your /wp-admin page and occasionally refresh that page (30-60mins) that should prevent that from happening again.

    #172361
    junglejim620
    Participant

    Hi bbPress,

    I added a new page with this shortcode [bbp-forum-index] for the forums but freaky the default site “footer level 1 and level 2 widget” disappeared; however when I click the Topic link go to the Topic page is fine showing both footers?

    Can anyone help me how to fix the forum index page to populate the footer?

    Please help, Thanks

    #172357

    In reply to: bbp_new_forum hook

    fterra
    Participant

    Besides that I just noticed that both "save_post_{$post->post_type}" and wp_insert_post are fired automaticaly during editing, to keep the forum saved as a draft.
    So maybe you will benefit more from bbp_forum_attributes_metabox_save really.
    Otherwise you will need some checks to see if it’s not a draft auto-save like in bbPress following code – also note the aforementioned hook being fired at the end:
    (/includes/admin/forums.php)

      /** 
       * Pass the forum attributes for processing 
       * 
       * @since bbPress (r2746) 
       * 
       * @param int $forum_id Forum id 
       * @uses current_user_can() To check if the current user is capable of 
       *                           editing the forum 
       * @uses bbp_get_forum() To get the forum 
       * @uses bbp_is_forum_closed() To check if the forum is closed 
       * @uses bbp_is_forum_category() To check if the forum is a category 
       * @uses bbp_is_forum_private() To check if the forum is private 
       * @uses bbp_close_forum() To close the forum 
       * @uses bbp_open_forum() To open the forum 
       * @uses bbp_categorize_forum() To make the forum a category 
       * @uses bbp_normalize_forum() To make the forum normal (not category) 
       * @uses bbp_privatize_forum() To mark the forum as private 
       * @uses bbp_publicize_forum() To mark the forum as public 
       * @uses do_action() Calls 'bbp_forum_attributes_metabox_save' with the 
       *                    forum id 
       * @return int Forum id 
       */ 
      public function attributes_metabox_save( $forum_id ) { 
     
          if ( $this->bail() ) return $forum_id; 
     
          // Bail if doing an autosave 
          if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) 
              return $forum_id; 
     
          // Bail if not a post request 
          if ( ! bbp_is_post_request() ) 
              return $forum_id; 
     
          // Nonce check 
          if ( empty( $_POST['bbp_forum_metabox'] ) || !wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) ) 
              return $forum_id; 
     
          // Only save for forum post-types 
          if ( ! bbp_is_forum( $forum_id ) ) 
              return $forum_id; 
     
          // Bail if current user cannot edit this forum 
          if ( !current_user_can( 'edit_forum', $forum_id ) ) 
              return $forum_id; 
     
          // Parent ID 
          $parent_id = ( !empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0; 
     
          // Update the forum meta bidness 
          bbp_update_forum( array( 
              'forum_id' => $forum_id,  
              'post_parent' => (int) $parent_id 
     ) ); 
     
          do_action( 'bbp_forum_attributes_metabox_save', $forum_id ); 
     
          return $forum_id; 
      } 
    #172355

    In reply to: bbp_new_forum hook

    fterra
    Participant

    If you use wp_insert_post, remember to check if the post being saved is a forum.
    Default forum type value is 'forum'.
    But you should use bbp_get_forum_post_type() to use its current value in case it has been altered by some filter.
    You may also take advantage of the following wordpress dynamic hook:
    "save_post_{$post->post_type}"
    which you would hook to with something like:
    add_action("save_post_" . bbp_get_forum_post_type(), "my_hook");

    #172350
    Pascal Casier
    Moderator
    #172349

    In reply to: bbp_new_forum hook

    fterra
    Participant

    Yes, @antipole,
    after I wrote to you I tried the bbp_forum_attributes_metabox_save hook and it has worked for me.
    But I guess it’s also possible to use wp_insert_post hook as suggested by John James Jacoby.
    bbp_forum_attributes_metabox_save will most likely fire only in admin page.
    On the other hand wp_insert_post will most likely fire both in admin page and front-end. Seems like front-end forum creation requires the use of [bbp-forum-form] shortcode, which I have never tried.

    Robin W
    Moderator

    the issue is not in creating the functionality, but in styling

    for instance you get the posts column using bbp_get_forum_topic_count($forum_id)

    but need styling to add that to the list of forums, which depends on how your theme does it.

    #172338

    In reply to: Spectate capability

    Pascal Casier
    Moderator

    Hi,
    You could create a new role based on the spectate. Follow our codex on https://codex.bbpress.org/custom-capabilities/

    If you want to limit topic creation for a specific forum, you can also have a look if my ‘bbP Toolkit’ plugin can help. It has a ‘protected forum’ possibility to allow only specific roles to create topics on some forums.

    Pascal.

    siparker
    Participant

    Ok, so if i can find someone to do the work and get the urls fixed then submit the code into trac it might get integrated into the core by someone in the future?

    I understand about the money thing also. I am just trying to think of a way to kickstart the development on the platform again as its on its way to being a really good forum software. it has almost all of the basics covered and some great plugins too. its just those few bits that mean it cant be used by some people. I would love to see bbpress be the defacto choice over phpbb or vbulletin and thought if i could sponsor the development then perhaps it might encourage a valuable dev to get more involved?

    #172319
    Robin W
    Moderator

    ok, sorry been tied up elsewhere, and only just got back to looking at this.

    I think I can get it working and would suggest you do the following

    1. take a copy of page.php and save it into your theme as bbpress.php

    so you end up with

    wp-content/themes/%mytheme%/bbpress.php where %mytheme% is your currently active theme’s name.

    Now edit that file as follows

    The theme seems to be looking for a value of the sidebar for the post meta of the page ID. Since I suspect that bbpress is not having that at that point, it can’t look it up.

    Now the page.php (which is now bbpress.php!) tries to set this in line 4 using

    $sidebar = get_post_meta($id, "qode_show-sidebar", true);

    and then the page.php (which is now bbpress.php!) later on looks for what value between 1 and 4 that is set to, which would determine what if any sidebars are shown.

    therefore in bbpress.php try changing line 4 from

    $sidebar = 1

    save the file and see what happens

    then try
    $sidebar = 2
    $sidebar = 3
    $sidebar = 4

    each should change what sidebar appears and where, so you should be able to get one working !

    Do come back if anything isn’t clear, or if you need further help, or just to tell us that we’re wonderful (or rubbish!)

    #172316

    Topic: add a specific class

    in forum Themes
    neecride
    Participant

    Hello,

    I look for how to add a class css on loop-single-forum.php line 12

    <ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>

    on default bbp_forum_class();

    sorry I’m french ! I do not understand English too

    Pascal Casier
    Moderator

    Hi siparker,

    I won’t start about your first line about the ‘money’, but for adding new functionalities of finding code for existing tickets, https://bbpress.trac.wordpress.org is one of the places that can be used for that. If a ticket is there and there is code attached, it makes a fair chance to be added into future versions.

    Pascal.

    #172314
    Pascal Casier
    Moderator

    Hi,
    If this is the standard wordpress function (never used this function before), then you cannot have a ‘post_author_id’, should be ‘user_ID’ and the ‘post_author’ should be ‘comment_author’ …
    See https://codex.wordpress.org/Plugin_API/Filter_Reference/preprocess_comment

    But this is for comments, not for replies …

    Pascal.

    Robkk
    Moderator

    Well you cannot modify the functions in the template.php by copying over the file like the file in the bbPress default theme, which is in wp-content\plugins\bbpress\templates\default

    To customize the code in template.php you would have to filter the code. Paste any new functions you create with the filters from the template.php file into a functions.php file in your child theme or in a custom functionality plugin.

    https://codex.wordpress.org/Function_Reference/add_filter

    https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-5/

    #172311
    abiliocaetano
    Participant

    I used cms2cms to migrate one of my forums.

    in addition to what everyone wrote, I would like to add something very important: keep the SEO juice.

    if you want to keep all your SERP positions in google you must 301 redirect every topic from your old phpbb forum to the new bbpress topics.

    to do this you just have to:

    Open/edit:

    /styles/prosilver/template/overall_header.html
    (or the template you are using)

    search for:

    // Send vars to template
    $template->assign_vars(array(
    ‘FORUM_ID’ => $forum_id,

    and just above this lines add this piece of code:

    ##################################
    $titleac = trim($topic_data[‘topic_title’]);
    $relativeurl = str_replace(‘ ‘,’-‘,$titleac);
    $relativeurl = strtolower($relativeurl);
    header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: http://www.YOURDOMAIN.com/forums/topic/”.$relativeurl.”/”);
    #####################################

    I have little more detail of the bbpress permalink, etc configurations in this article: http://abiliocaetano.com/seo-migrate-phpbb-to-bbpress/

    regards,

    #172307
    abiliocaetano
    Participant

    Hi all,

    in addition to what everyone wrote, I would like to add something very important: keep the SEO juice.

    if you want to keep all your SERP positions in google you must 301 redirect every topic from your old phpbb forum to the new bbpress topics.

    to do this you just have to:

    Open/edit:
    /styles/prosilver/template/overall_header.html
    (or the template you are using)

    search for:

    // Send vars to template
    $template->assign_vars(array(
    ‘FORUM_ID’ => $forum_id,

    and just above this lines add this piece of code:

    ##################################
    $titleac = trim($topic_data[‘topic_title’]);
    $relativeurl = str_replace(‘ ‘,’-‘,$titulo);
    $relativeurl = strtolower($relativeurl);
    header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: http://www.YOURDOMAIN.com/forums/topic/”.$relativeurl.”/”);
    #####################################

    I have little more detail of the bbpress permalink, etc configurations in this article: http://abiliocaetano.com/seo-migrate-phpbb-to-bbpress/

    regards,

    #172285
    Stephen Edgar
    Keymaster

    You can also use the built in export WordPress WXR (which is just an XML file), and WordPress Importer plugin.

    #172276
    Robkk
    Moderator

    Your theme looks to be using post meta to display the sidebars, so there might be custom fields to configure which sidebar to display which will most likely be on the default WordPress post types (page and post) when you create/edit them. These options may not be on the bbPress post type creation/editing screens in the WordPress backend.

    I see there is a ton of code that might not even be usable because bbPress post types may not have these custom field options to configure things like the slider, background color, and other options I can see in the code.

    I do see from the classes that this uses a responsive grid layout so maybe focus and keep this class as it is a two column layout, one for the content and one for the sidebar.

    two_columns_66_33 grid2 clearfix

    You may need to contact your theme author for further help on this.

    #172274
    dgalfano
    Participant

    Sure! Thanks for looking!

    https://gist.github.com/anonymous/34d96600379e037b60ae

    (mod note: when people search the forums, they hate scrolling through giant pieces of code. Small snippets use code tags, large files use external services to host the code.)

    #172272
    Robin W
    Moderator

    As far as I can see the solution is with that code snippet – it fits the problem description very well

    can you amend line

    if ($forumPage->post_type == 'forum'){
    
    

    to

    if ($forumPage->post_type == bbp_get_forum_post_type() ){
    

    and try it again

    #172265
    Robkk
    Moderator

    You can install a plugin like WP Ulike and use that for rating posts.

    Then you can create a custom bbPress view using this function. Add this php code snippet into your child themes functions.php file or in a plugin that can hold custom code snippets like the functionality plugin.

    function rkk_register_custom_view() {
     	bbp_register_view( 'top-rated-topics', __( 'Top Rated Topics' ),  array( 'meta_key' => '_topicliked', 'orderby' => 'meta_value_num' , 'post_status' => 'publish' ), false );
     }
     add_action( 'bbp_register_views', 'rkk_register_custom_view' );

    Then paste this shortcode in a page called Top Rated Topics.

    [bbp-single-view id='top-rated-topics']

    #172263
    Robin W
    Moderator

    ok, can you paste the page.php file here please AND make sure you enclose it all as code !

    #172260
    Robin W
    Moderator

    ok, just eliminating as sometimes local (pc) installations can have url issues.

    Can you tell us in

    Dashboard>settings>forums

    what the forums root is set to and also do yiu bave a wordpress page with [bbp-forum-index] on it? and if what is the url of that page?

Viewing 25 results - 6,826 through 6,850 (of 32,519 total)
Skip to toolbar