Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,201 through 4,225 (of 32,518 total)
  • Author
    Search Results
  • #194668
    siparker
    Participant

    Hi,

    The function bbp_get_time_since in includes/common/formatting.php always returns “right now”.

    bbPress Version: 2.6 release candidate 6

    #194667
    eigodeasobo
    Participant

    sorry, I re-wrote that.

    ▼For example:

    topic ID = 100
    -first reply to topic ID 100 = post ID 105
    --first reply to post ID 105 = post ID 106
    -second reply to topic ID 100 = post ID 107
    -third reply to topic ID 100 = post ID 108
    --first reply to post ID 108 = post ID 109
    ---first reply to post ID 109 = post ID 110
    ---second reply to post ID 109 = post ID 111

    ▼I expect the following get:

    Get 0 using 105, 107, 108.
    <?php echo bbp_get_form_reply_to(105); //Get 0 ?>
    <?php echo bbp_get_form_reply_to(107); //Get 0 ?>
    <?php echo bbp_get_form_reply_to(108); //Get 0 ?>

    Get 105 using 106.
    <?php echo bbp_get_form_reply_to(106); //Get 105 ?>

    Get 108 using 109.
    <?php echo bbp_get_form_reply_to(109); //Get 108 ?>

    Get 109 using 110, 111.
    <?php echo bbp_get_form_reply_to(110); //Get 109 ?>
    <?php echo bbp_get_form_reply_to(111); //Get 109 ?>

    I want to obtain the reply ID based on the post ID.

    Thanks.

    eigodeasobo
    Participant

    Hi all,

    How can I get a reply post ID using a specific post ID?

    For example, I want to get 1 using 3.

    0
    |–1
    |–|–2
    |–|–3

    I can not do with the following code:
    <?php echo bbp_get_form_reply_to(3);?>

    How write it?

    Thanks.

    #194648

    In reply to: cPanel Dangers?

    Robin W
    Moderator

    would depend on what he is trying to fix, and how much you trust, and what ‘data’ you site holds that could be embarrassing. If you hold no client info other than say usernames, then you could take a more relaxed attitude.

    I tend to work on test/dev sites rather than live sites, and I like to have both cpanel and ftp access to sites I am working on, but most of what I do is code, and the ability to back out stuff is key.

    suggest you look to build a test/dev site and give him access to that.

    Creating a Test Site

    #194632
    scmsteve
    Participant

    One other issue is how the forum list is generated, it seems it is invalid HTML having text in the

      that is outside the

    • elements.
      <ul class="bbp-forums-list">
      <li class="bbp-forum"><a href="forum-url" class="bbp-forum-link">forum-name (counts)</a>,</li>
      </ul>

      In 2.6 I am getting this:

      <ul class="bbp-forums-list">
      <li class="bbp-forum"><a href="form-url" class="bbp-forum-link">forum-name (counts)</a></li>,
      </ul>

      The seperator of a comma is being put after each li tag instead of inside of it.

    #194630
    scmsteve
    Participant

    Noticed when migrating from 2.5.12 to 2.6 beta 2 (and also in RC1 and RC3), that my custom CSS file in mytheme/css/bbpress.css is no longer being detected.

    I am seeing that here as well… Since your post was never commented on, I don’t know if it was ignored or simply thought irrelevant. Or maybe missed. 🙂

    Looking at the HTML between the old site and a test site running the SVN pull of 2.6, it seems that previously as part of the enqueue_styles() call, it generated:

    <link data-asynced="1" as="style" onload="this.rel=&quot;stylesheet&quot;" rel="stylesheet" id="bbp-default-css" href="https://siteurl/wp-content/themes/mythemename/css/bbpress.css" type="text/css" media="screen">

    Now it is generating:

    <link data-asynced="1" as="style" onload="this.rel=&quot;stylesheet&quot;" rel="stylesheet" id="bbp-default-css" href="https://siteurl/wp-content/plugins/bbpress/templates/default/css/bbpress.min.css" type="text/css" media="all">

    So, it is not looking in the site css folder, but instead pulling from the plugin folder.

    Is this intentional? If not, is there a fix/workaround?

    #194611
    Robin W
    Moderator

    try

    width: 100% !important;

    #194610
    Prashant Chaudhari
    Participant

    Hi!

    I want to hide all the columns (Posts, Topics, Voices, Freshness) except the Forum and Topic.
    Everything is working fine except the column size of Forum column is not changing. Here is the css:

    /* To hide VOICE, REPLY, POSTS and FRESHNESS columns in bbPress */
    
    li.bbp-forum-reply-count, li.bbp-forum-topic-count, li.bbp-forum-freshness {
        display: none !important;
    }
    
    li.bbp-topic-voice-count, li.bbp-topic-reply-count, li.bbp-topic-freshness {
        display: none !important;
    }
    
    li.bbp-forum-info,
    li.bbp-topic-title {
    	float: left;
    	text-align: left;
    	width: 100%;
    }
    
    /* End */
    

    Please help.

    #194609

    In reply to: Forum Topic Loop

    Babblebey
    Participant

    Well just incase other people finds this thread.. My Template Part had bugs too.. Here is the one that worked:

    <?php
    
    /**
     * Single Thread
     *
     * @package bbPress
     * @subpackage Theme
     */
    
      // $threadURL = bbp_topic_permalink(); // Deprecated ////
      // $threadTitle = bbp_topic_title(); // Deprecated ////
      // $threadTIme = bbp_topic_post_date(); // Deprecated ////
      ///////////////// Thread Author Avatar URL ////////////////////////
      $user_id = bbp_get_user_id( $user_id );
      $authorAvatarURL = get_avatar_url( $user_id, 300 );
      ///////////////////////////////////////////////////////////////////
      // $threadVoiceCount = bbp_topic_voice_count(); // Deprecated ////
    
    ?>
    
    <div class="swiper-slide-item">
        <div class="icon-author" style="background-image: url('<?php echo $authorAvatarURL; ?>'); background-image: -webkit-image-set(url('<?php echo $authorAvatarURL; ?>') 1x, url('<?php echo $authorAvatarURL; ?>') 2x);"></div>
        <a href="<?php bbp_topic_permalink(); ?>"><?php bbp_topic_title(); ?></a></h2>
        <time class="data" datetime="<?php bbp_topic_post_date(); ?>"><?php bbp_topic_post_date(); ?></time>
        <span class="views"><i class="fa fa-comment-alt"></i><?php bbp_topic_reply_count(); ?></span>
    </div>

    The bbPress Functions does not want to be assigned to variable as Unlike the GET_ they do not return values, they echo.

    Thanks.

    #194606

    In reply to: Forum Topic Loop

    Robin W
    Moderator

    bbp_get_template_part( 'bbpress/omna', 'forumthreads' )
    should read
    bbp_get_template_part( 'bbpress/omna', 'forumthreads' ) ;

    you missed a ‘;’ !

    #194605

    Topic: Forum Topic Loop

    in forum Installation
    Babblebey
    Participant

    Hello there,

    Firstly thank you for viewing this thread, really appreciate.

    I am trying to create a topic loop to display in my in development theme. I have created a template part in my theme-directory/bbpress/omna-forumthreads see below:

    <?php
    
    /**
     * Single Thread
     *
     * @package bbPress
     * @subpackage Theme
     */
    
      $threadURL = bbp_topic_permalink();
      $threadTitle = bbp_topic_title();
      $threadTIme = bbp_topic_post_date();
      ///////////////// Thread Author Avatar URL ////////////////////////
      $user_id = bbp_get_user_id( $user_id );
      $authorAvatarURL = get_avatar_url( $user_id, 300 );
      ///////////////////////////////////////////////////////////////////
      $threadVoiceCount = bbp_topic_voice_count();
    
    ?>
    
    <div class="swiper-slide-item">
        <div class="icon-author" style="background-image: url('<?php echo $authorAvatarURL; ?>'); background-image: -webkit-image-set(url('<?php echo $authorAvatarURL; ?>') 1x, url('<?php echo $authorAvatarURL; ?>') 2x);">
        </div><<?php echo $threadURL; ?>"><?php echo $threadTitle; ?></a></h2>
            <time class="data" datetime="<?php echo $threadTIme; ?>"><?php echo $threadTIme; ?></time>
            <span class="views"><i class="fa fa-comment-alt"></i><?php echo $threadVoiceCount; ?></span>
        </div>
    </div>
    

    And i believe this should work, But currently i have issues with the loop that should display it by driving the content from the template part. Here is my loops:

    <div class="swiper-wrapper">
        <div class="swiper-slide">
           <div class="swiper-slide-container">
              <?php
                 if ( bbp_has_topics() ):
                    while ( bbp_topics() ) : bbp_the_topic();
                       bbp_get_template_part( 'bbpress/omna', 'forumthreads' )
                    endwhile;
                 endif;
              ?>
           </div>
        </div>
     </div>

    Now i get a pass error:

    Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in C:\wamp\www\omna\wp-content\themes\omna\page-home.php on line 143

    I have also tried the curly brace {} type of IF & WHILE expressions, still a parse error..

    Please Help.

    #194600
    alriknijdam
    Participant

    I seem to have an error with the page previews as you can see over here. As you can see in the first reply in this link, page preview for WP pages works fine, the problem only occurs with BBpress related urls (second post). In the image below I marked it with red:

    page preview error

    When I disable the GP Premium plugin the preview dissapears and it only shows the title as an url inside a blockquote. BUT looking at the source code the wrong preview is still there. Changing class wp-embedded-content position: absolute; to position: relative; makes it visable again.

    Disabling all plugins, switching to another theme or deleting all custom css is of no influence. WordPress and all plugins are up to date.

    #194599
    alriknijdam
    Participant

    As this is still not resolved I wrote a simple script to solve this issue. For those stumbeling up on this here it is.

    $topic_id		= bbp_get_topic_id();
    $reply_id		= bbp_get_reply_id();
    $position_raw	= bbp_get_reply_position($reply_id, $topic_id);
    // Remove the comma
    $position		= str_replace(',', '', $position_raw);
    // Devide by the number of posts per page, in my case 15
    // I didn't test it but I believe you can also use: get_option( 'posts_per_page' );
    $page_raw		= ceil($position / 15 );
    if ($page_raw > 1) $page = '/page/' . $page_raw;
    else $page 		= '';
    $slug			= get_post_field('post_name', get_post($topic_id));
    // Replace YOUR_WEBSITE_URL with your own or use: bloginfo('wpurl')
    // to retrieve it, but don't forget to concenate
    $correct_link	= 'YOUR_WEBSITE_URL/forums/topic/' . $slug . $page . '/#post-' . $reply_id;

    You can probably place this inside some function but I placed it inside loop-single-reply.php and placed that inside my child-theme. In that case you also have to replace this:

    <a href="<?php echo bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php echo bbp_reply_id(); ?></a>

    with:

    <a href="<?php echo $correct_link; ?>" class="bbp-reply-permalink">#<?php echo $reply_id; ?></a>

    #194574
    eigodeasobo
    Participant

    Hi,

    I added Customfields to BBpress reply form by this code:

    //Input on BBP reply form
    function bbp_extra_reply_fields() {
    $custom = get_post_meta( bbp_get_reply_id(), 'bbp_custom', true);
    echo '<fieldset class="bbp-form bbp-form-add">';
    echo "<p><input id='bbp_reply_custom' type='text' name='bbp_custom' value='".$custom."'></p>";
    echo '</fieldset>';
    }
    add_action ( 'bbp_theme_before_reply_form_content', 'bbp_extra_reply_fields');
    
    //Register to Detabase
    add_action( 'bbp_new_reply', 'bbp_save_reply_extra_fields', 10, 1 );
    add_action( 'bbp_edit_reply', 'bbp_save_reply_extra_fields', 10, 1 );
    function bbp_save_reply_extra_fields( $reply_id ) {
    if (isset($_POST) && $_POST['bbp_custom']!='') {
    update_post_meta( $reply_id, 'bbp_custom', $_POST['bbp_custom'] );
    }
    }
    
    //Output to BBP reply
    function inputBBPreply_outputBBPreply() {
    $reply_id = bbp_get_reply_id();
    $reply_custom = get_post_meta( $reply_id, 'reply_custom', true);
    return '<div>'.$reply_custom.'</div>';
    }
    
    //Output to Buddypress activity
    function inputBBPreply_outputBPactivity() {
    //What should I write?
    }

    But this code dose not show at BuddyPress activity.

    What should I write?

    Thanks

    #194566
    wallacelin
    Participant

    Hi,

    This topic is quite old but it seems to be the only one about displaying tagged topics count. How would you implement the query to count topic tags? Is it possible to create a custom shortcode to show the tag count? Any help with this would be greatly appreciated, thanks!

    #194535
    timmoser
    Participant

    Ahoy,
    I am using

    bbPress 2.5.14-6684
    BuddyPress 3.1.0
    bbp style pack 3.9.6
    WordPress 4.9.8
    running Bento (Child) theme
    on this page bomb.bio/forum

    I am having a problem with the insert/edit image button (in the text version the img button) not working. Image links added this way do not display.
    Posting the same link without the tag automaticaly added when using this button works fine as long as they are in a new line.

    Does anyone have any idea how I can get this to work? Even removing the misleading button or changing the button functionality so it wont add the tag which seems to make the link not work would be better than the current situation.

    I can’t code. I am only able to copy paste and to some degree alter code that i am given. I do have a working child theme if that helps.

    Thank you very much!!!
    Tim

    #194520
    #194514
    Helmuts
    Participant

    another sample of the latest forums page where the above mentioned bbcodes have been used: https://www.ibf.lv/svaigakas-foruma-zinas/ (Latvian business forum)

    #194513
    Helmuts
    Participant

    A quick update – ..this topic ranks in the top positions of Google on these keywords and needs updating.

    My suggestion: set up plugin “bbPress Advanced Statistics” https://wordpress.org/plugins/bbpress-improved-statistics-users-online/

    and use the shortcode: [bbpas-activity] (you have to enable it first in settings under “extra” tab”

    Sample (latest forum posts): https://www.lustjobs.com/latest-posts-custom-forum-view/

    There are 2 bbcodes on this page:
    [bbp-topic-index]
    [bbpas-activity]

    as for the default bb code: you have to use use [bbp-stats] not [bbp-statistics]

    #194512
    eigodeasobo
    Participant

    What should I do if I do not want to allow div?

    // Div
    'div' => array(
    	'class'     => false,
    	'style'     => false,
    ),

    This is not it, right?

    #194511
    eigodeasobo
    Participant

    Hi bbpress

    I want to escape html in topic and reply output, but I want to Embede media.

    REPLACED this code which you can find inside[bbpress/templates/default/bbpress/content-single-topic-lead.php] file, opening via the editor.
    <?php bbp_topic_content(); ?>
    WITH THIS CODE

    <?php
    global $wp_embed;
    $inputTxt = bbp_get_topic_content();
    $escTxt = esc_html( $inputTxt );
    echo '<div class="test">'.$wp_embed->run_shortcode( '[embed]' . $escTxt . '[/embed]' ).'</div>';
    ?>

    But I can not it.

    How do I write it?

    #194506
    Robin W
    Moderator
    #194487
    Milan Petrovic
    Participant

    bbPress has a login and registration widget include to use in the sidebar. It also has shortcodes to embed these forms into pages, so you can use that to make your login/register page and style it using CSS.

    #194479
    Robin W
    Moderator

    you could move the plugins into the functions file if you really wanted to

    it would all look very confusing and be very difficult to maintain
    you might have to alter some code to stop conflicts
    it would have no effect on speed, a function is a function wherever it runs
    you would lose any updates for the plugins

    generally not a good idea 🙁

    #194475
    dedotombo
    Participant

    Can’t find it, maybe it’s pulled from wordpress text domain directly? Maybe code tweaks are needed to translate it separately, could be.

Viewing 25 results - 4,201 through 4,225 (of 32,518 total)
Skip to toolbar