Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,101 through 8,125 (of 32,505 total)
  • Author
    Search Results
  • #165514

    In reply to: bbPress Shortcode

    Acs-Yt
    Participant

    I’m sorry to ask, but as I’m very new to css & php, I really don’t know, where to paste this code.

    But nevertheless, thanks for the code.

    #165509

    In reply to: SMF Import Help Needed

    sharingsunshine_wp
    Participant

    Thanks for the code. I ran through the converter and this time it shows the correct topics and reply count until you actually look into each topic. All the topics I have checked are missing replies.

    The user count is still double even though I checked purge and it said no cleanup necessary.

    Looks like we are much closer so thanks for getting us there.

    Do I need to do anything to the forum to make it ready? I do have some mods on it do they need to be removed? I didn’t see anywhere saying to remove them so thought I would ask.

    #165504
    Robkk
    Moderator

    The information for adding new fields for topics could be helpful for adding fields to the reply form too. You may need to just change the word topic in any hooks used to reply, or just any word with topic with reply in the code.

    If you are just adding a simple text box for the reply form you can look over this example.

    add_action ( 'bbp_theme_before_reply_form_content', 'bbp_extra_reply_fields');
    function bbp_extra_reply_fields() {
       $waffle = get_post_meta( bbp_get_reply_id(), 'bbp_waffles', true);
       $pancake = get_post_meta( bbp_get_reply_id(), 'bbp_pancakes', true);
       echo '<fieldset class="bbp-form">';
       echo '<p><label for="bbp_waffles">Waffles</label><br>';
       echo "<input type='text' name='bbp_waffles' value='".$waffle."'></p>";
       echo '<p><label for="bbp_pancakes">Pancakes</label><br>';
       echo "<input type='text' name='bbp_pancakes' value='".$pancake."'></p>";
       echo '</fieldset>';
    }
    
    add_action ( 'bbp_new_reply', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_reply', 'bbp_save_extra_fields', 10, 1 );
    
    function bbp_save_extra_fields($reply_id) {
      if (isset($_POST) && $_POST['bbp_waffles']!='')
        update_post_meta( $reply_id, 'bbp_waffles', $_POST['bbp_waffles'] );
      if (isset($_POST) && $_POST['bbp_pancakes']!='')
        update_post_meta( $reply_id, 'bbp_pancakes', $_POST['bbp_pancakes'] );
    }
    
    add_action('bbp_theme_after_reply_content', 'bbp_show_extra_fields');
    function bbp_show_extra_fields() {
      $reply_id = bbp_get_reply_id();
      $value1 = get_post_meta( $reply_id, 'bbp_waffles', true);
      $value2 = get_post_meta( $reply_id, 'bbp_pancakes', true);
      echo "Opinion on Waffles: ".$value1."<br>";
      echo "Opinion on Pancakes: ".$value2."<br>";
    }
    project_subdomain
    Participant

    Hi!
    I’m trying to display different divs for all topics of specific forums.
    Wrong:

    <?php if ( is_post(xyz) ) : ?>
    <div>..</div>

    or

    <?php if ($forum_id=xyz) : ?> 
    <div>..</div>

    Suggest to need to use get_topic_id to get current topic ids?
    Would be very happy for any help with this!

    #165494

    In reply to: SMF Import Help Needed

    Robkk
    Moderator

    You get the error from upgrading to 2.0.10??

    Also I can see SMF’s changelog and it mentions this. This might have caused an issue, but it could possibly be a simple fix.

    Fix for unsupported UTF8mb4 characters

    Here is the current SMF.php importer in

    /wp-content/plugins/bbpress/includes/admin/converters/SMF.php

    You can take a look at my gist file/download it and open in an IDE editor.

    https://gist.github.com/robkk/f3a83e6da6bd6bd38f00

    #165493

    In reply to: SMF Import Help Needed

    sharingsunshine_wp
    Participant

    I tried to find the code to actually see what is wrong with the sql statement. I followed these directions thinking the smf importer would be close by.

    ************
    You can also make your own custom importer using the included Example.php located in /bbpress/includes/admin/converters/Example.php to setup an import from any SQL database.

    However, I don’t have a /bbpress folder at the root is it in another subfolder? Or, has it been changed since this page was created?

    Thanks,

    Randal

    Robkk
    Moderator

    This custom CSS would help with your line-height issue.

    #bbpress-forums div.bbp-forum-author, 
    #bbpress-forums div.bbp-topic-author, 
    #bbpress-forums div.bbp-reply-author {
        line-height: 2em;
    }
    #165490
    Robkk
    Moderator

    You cannot see the topic form when logged in??

    Do you see any notices that show in the topic forms place??

    You can try to see if there is a theme/plugin issue first.

    Troubleshooting

    #165489

    In reply to: bbPress Shortcode

    Robkk
    Moderator

    @acs-yt

    Try this custom CSS to see if it would help make your forums full width.

    @media and (min-width: 992px) {
     .bbpress .col-md-8 {
        width: 100%;
     }
    }

    Use this to completely remove the sidebar with CSS.

    @media and (min-width: 992px) {
    .bbpress .col-md-4 {
         width: 0;
         display: none;
     }
    }
    #165485
    Robkk
    Moderator

    @goldlux does this work?? you of course need a way to set the featured image of a topic though.

    add_post_type_support('topic', array('thumbnail'));
    
    function ks_topic_icons() {
    	if ( 'topic' == get_post_type() ) {
    		global $post;
    	    if ( has_post_thumbnail($post->ID) )
    	    	echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft topic-icon'));
    	 }
    }
    add_action('bbp_theme_before_topic_title','ks_topic_icons');
    #165478

    In reply to: SMF Import Help Needed

    sharingsunshine_wp
    Participant

    Thanks for approving the post and I certainly will heed the links minimum from now on. I upgraded the later version and now I am getting this error.

    Repair any missing information: Continue
    
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'users_profile_table.the_user_id = users_table.the_user_id WHERE users_table.the_' at line 1]
    SELECT convert(users_table.the_users_id USING "utf8mb4") AS the_users_id,convert(users_table.the_users_password USING "utf8mb4") AS the_users_password,convert(users_table.the_users_password_salt USING "utf8mb4") AS the_users_password_salt,convert(users_table.the_users_username USING "utf8mb4") AS the_users_username,convert(users_table.the_users_nicename USING "utf8mb4") AS the_users_nicename,convert(users_table.the_users_email_address USING "utf8mb4") AS the_users_email_address,convert(users_table.the_users_homepage_url USING "utf8mb4") AS the_users_homepage_url,convert(users_table.the_users_registration_date USING "utf8mb4") AS the_users_registration_date,convert(users_table.the_users_status USING "utf8mb4") AS the_users_status,convert(users_table.the_users_display_name USING "utf8mb4") AS the_users_display_name,convert(users_table.the_users_aim USING "utf8mb4") AS the_users_aim,convert(users_table.the_users_yahoo USING "utf8mb4") AS the_users_yahoo,convert(users_table.the_users_jabber USING "utf8mb4") AS the_users_jabber,convert(users_profile_table.the_users_id USING "utf8mb4") AS the_users_id FROM smf_users_table AS users_table INNER JOIN smf_users_profile_table AS users_profile_table USING users_profile_table.the_user_id = users_table.the_user_id WHERE users_table.the_user_id != -1 LIMIT 0, 100
    
    #165465
    kachan64
    Participant

    You will have to use
    <?php echo do_shortcode(‘[bbp-topic-index]‘); ?>

    With this code, you can insert it anywhere you want just like a regular HTML

    #165459
    Robin W
    Moderator

    Try adding !important – your theme may be overriding the settings viz

    Layout and functionality – Examples you can use

    project_subdomain
    Participant

    As wordpress strips the break and text tags I’m looking for a solution to add line breaks to my bbp_user_decription div.
    Here is what did not work:
    1.) What I find everywhere is some sort of this added to functions.php:

    remove_filter('pre_user_description', 'wp_filter_kses');

    This does not work, also looking at wordpress’ recent incl/registration.php just saying this file is deprecated makes me think that this code should not get to work at all.

    2.) Alternatively I looked through my themes’files and used

    <?php echo nl2br(get_the_author_meta( 'user_description' )); ?>
    in content.php. Or <?php echo nl2br(get_the_author_meta( 'description' )); ?> in my author.php

    3.) Tried 1) and 2) with bbp_ at the beginning of each decription’s part.

    Nothing worked, break-or p-tags are just ignored.
    Also, is there a secure way to add break-tags only?
    Thanks for any help!

    #165410

    In reply to: bbPress Shortcode

    Robkk
    Moderator

    You would need to follow this and create a bbpress.php file and then come back and I will help you with some CSS that you might need.

    Getting Started in Modifying the Main bbPress Template

    #165409
    Robkk
    Moderator

    It looks like it is inheriting different templates for the forum archive and the single forums. From the looks of it the second image looks correct to me. It is displaying the title, but you have leftover post data from your theme like the extra breadcrumbs.

    If you did create a bbpress.php rename it to something like bbpressa.php so that it won’t load anymore.

    Now if you have what the file still installed, go to the forum archive or /?post_type=forum and see if the page template is different from what the General Forum page has.

    The reason why I am saying do this, is to see if bbPress could be inheriting two different templates. It would make sense if the Forum archive would use page.php or even archive.php, and in some cases the single forum pages could be inheriting single.php.

    #165405
    Robkk
    Moderator

    whoops sorry I messed up the CSS a little. I edited the code above try that now.

    #165397
    Robkk
    Moderator

    You can try that, but it usually only affects one specific page. Doing it this way means you have to put a shortcode for every bbPress page. It is easier in the end to just create a bbpress.php file in your theme from your page.php file. You can also just tell me your theme (hopefully it is not paid) then I could just do it for you.

    #165395
    Robkk
    Moderator

    Not entirely sure really but I have tested themes that add next and prev post nav links to bbPress on accident and it seems to work. You may need to add the php tag to the bbPress forum templates, maybe just output it in a bbpress.php file with a condtional to only show on single forums.

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

    Getting Started in Modifying the Main bbPress Template

    bbPress Conditional Tags

    #165390
    Robkk
    Moderator

    @peterdadams

    There should be a vBull importer in bbPress.

    The W3 Total Cache would help optimize bbPress. Of course it is more important to have high performance hardware on your site, use an opcode cache, possibly an object cache (the plugin helps add a backend file), and keeping your database tidy. Page cache can become a little tricky in some situations but it should be fine using w3 total cache with bbPres.

    bbPress is translatable and there are translations for specific langauges.

    bbPress could work in multilingual sites. It might be better to just allow your users to contribute their content in their language though. There is an issue using WPML though.

    #165388
    Robkk
    Moderator

    @lightbay

    Is there anyway you could embed a forum into another page?

    Not the whole bbPress forums like some Iframe embed like some other forums, you can use this shortcode to embed a single forum though.

    [bbp-single-forum id=$forum_id]

    Display a single forums topics. eg. [bbp-single-forum id=32]

    To find the ID, add a plugin like Reveal IDs to help you out find the IDs of all your forums. After installing it go to Forums > All Forums and you should see each forums ID next to it.

    There are of course other ways of finding a posts ID and you may not need to install the plugin, it is just better and easier for users.

    #165387
    Robkk
    Moderator

    This should help.

    /*styling to move 'Subscribe' to right hand side */
    .single-forum .subscription-toggle  {
        padding-left: 10px;
    }
    Robkk
    Moderator

    1. Not entirely sure what the topic frame is, but I like how the title looks good on your site already.

    2.

    div.bbp-reply-header {
        clear: none;
    }

    If you need help styling your forums you may need to use the bbp style pack plugin. There are a lot of CSS styles on your site that I can see causing some minor issues with other areas on bbPress, like the Forum Header labels that say Topic and Freshness. You may also need to use a darker image/background for your single forum pages.

    #165385
    Stephen Edgar
    Keymaster

    If you select a different forum from the dropdown, e.g. SMF what error do you get?

    Can you also try using an incorrect password, you should be seeing some kind of errors here rather than nothing each time.

    #165381

    In reply to: several forum

    Robkk
    Moderator

    You might need to look into using LearnPress and this plugin. I think it should do what you want, but you may need to leave a support topic on the plugin’s below support forum just to make sure.

    https://wordpress.org/plugins/learnpress-bbpress/

    Or this might be custom development for a plugin.

    But what you can do is at the bottom of each post just insert one of the single forum shortcodes.

    Like this.

    [bbp-single-forum id=$forum_id]

    You can find the forum id by using a plugin like Reveal IDs to make life easier, and all you have to do is go to Forums > All Forums in the WordPress backend to see all of your forums ids.

    Shortcodes

    Same thing with topics if you to assign topics for each post.

Viewing 25 results - 8,101 through 8,125 (of 32,505 total)
Skip to toolbar