Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,926 through 3,950 (of 32,481 total)
  • Author
    Search Results
  • #197472
    Foliferous
    Participant

    Hello again! That space is bugging me, is there no way to remove it?

    When you look at the code on the site itself it looks like it is this sign here which is causing spaces:

    "

    It also does that in other places. Can someone tell me why? And there’s no way to hide it through CSS either, because it has no class or id, so you can’t add display: none: to it.

    #197414
    Robin W
    Moderator

    try this

    function rew_count_threaded_replies ($reply_id = 0) {
    	$meta_key = '_bbp_reply_to' ;
    	global $wpdb;
    	$user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->postmeta where meta_key='$meta_key' AND meta_value = '$reply_id'" );
    	echo $user_count ;
    }
    #197413
    eigodeasobo
    Participant

    Yes, I’d like to specify a reply to a topic and get the number of replies to it.

    I am glad if there is a function like xxx below.

    <?php
    $topic_id = 1 ;
    echo bbp_topic_reply_count( $topic_id ) ;
    // 3
    ?>
    
    <?php xxx(100) ;
    // 2
    ?>
    
    <?php xxx(101) ;
    // 0
    ?>
    
    <?php xxx(102) ;
    // 0
    ?>

    Do you have any sugesstions?

    #197411
    eigodeasobo
    Participant

    It is a code that specifies the topic ID and obtains the number of replies.

    What I want to know is a code that specifies the reply ID and obtains the reply number.

    #197403
    mrwassen
    Participant

    Hi Robin,

    Thanks for the suggested code. I tried it but it keeps returning nothing when specifying an existing forum ID. I checked that $attr contains the specified forum_id, but am unsure on how to troubleshoot bbp_forum_subscription_link().

    Any help would be appreciated.

    Thanks

    Dennis

    #197398
    Robin W
    Moderator

    for

    [bbp-subscribe-link forum_id=’557′]

    this code (untested) should be close

    function bp_subscribe_shortcode($attr) {	
    //must have a forum_id or we just return !
      if (empty( $attr['forum_id'])) return	;
      else $args['forum_id'] = $attr['forum_id'];
      echo bbp_forum_subscription_link($args) ;
    } 
    
    add_shortcode( 'bbp-subscribe-link', 'bp_subscribe_shortcode' );
    #197396
    Robin W
    Moderator
    $topic_id = 100 ;
    $ count = bbp_get_topic_reply_count( $topic_id) ;
    echo $count ;

    or shorter

    $topic_id = 100 ;
    echo bbp_topic_reply_count( $topic_id ) ;
    eigodeasobo
    Participant

    Is there a function to specify replyID and get the number of replies to it?

    For example, if you have the following HTML, I would like to know about functions that can write “<?php xxx(100) ?>” and get “2”.

    <div id="bbpress-forums">
      <ul id="topic-1-replies" class="forums bbp-replies">
        <li>
          <div id="post-100">
            <p>Hello!</p>
          </div>
        <li>
        <ul class="bbp-threaded-replies">
          <li>
            <div id="post-101">
              <p>Hi!</p>
            </div>
          <li>
          <li>
            <div id="post-102">
              <p>Cheers!</p>
            </div>
          <li>
        </ul>
      </ul>
    </div>
    #197382
    simjohna
    Participant

    Yes, I study via your code previous to posting this and used it for instance of a way to add alternatives to the page.

    It became because of reading your code that I become asking approximately using tabs. My purpose for this is that it might deliver the customers a clear distinction between ‘middle’ and ‘custom’ options whilst nevertheless maintaining all options on the same web page.

    Just thought it might be precise, cool, and offer but another degree of the company to bbPress.

    #197366
    mrwassen
    Participant

    Hi simjonna,

    Thanks for your reply. I think you have misunderstood my question. What I am looking for is the code to create a shortcode which returns the subscribe/unsubscribe link. It would be added to my theme’s functions.php and look something like this:

    function bp_subscribe_shortcode() {	
      ... logic to create a URL to subscribe, unsubscribe...
    } 
    add_shortcode( 'bbp-subscribe-link', 'bp_subscribe_shortcode' );

    It would accept one input: the ID of the forum, e.g.:

    [bbp-subscribe-link forum_id=’557′]

    It can then be placed in a page or a post etc.

    Any help appreciated.

    Thanks

    Dennis

    #197226
    Robin W
    Moderator

    yes, this should work – add this to the functions file in your child theme

    add_filter( 'bbp_new_topic_redirect_to', 'rew_forum_redirect_topic' , 10 ,3 ) ;
    add_filter( 'bbp_new_reply_redirect_to', 'rew_forum_redirect_reply' , 10 ,3 ) ;
    
    function rew_forum_redirect_topic ($redirect_url, $redirect_to, $topic_id ){
    	$forum_id = bbp_get_topic_forum_id($topic_id);
    	$redirect_url = bbp_get_forum_permalink( $forum_id ) ;
    return $redirect_url ;
    
    }
    
    function rew_forum_redirect_reply ($redirect_url, $redirect_to, $reply_id ){
    	$forum_id = bbp_get_reply_forum_id($reply_id);
    	$redirect_url = bbp_get_forum_permalink( $forum_id ) ;
    return $redirect_url ;
    
    }
    #197223
    mrwassen
    Participant

    Hi,

    Would it be possible to create a shortcode which returns the subscribe/unsubscribe link for a given forum ? The end result would be something along the lines of:

    [bbp-subscribe-link forum_id=’557′]

    The returned link would display “Subscribe” or “Unsubscribe” depending on the current state of subscription.

    This would allow a little more flexibility in placement of the link in the top part of a page with the forum embedded.

    Any help would be appreciated.

    Thanks

    Dennis

    #197174
    Robin W
    Moderator

    yes if you know how to code

    the nearest action hook is

    ‘bbp_template_before_forums_index’

    #197172
    Robin W
    Moderator

    bbpress does not have that, and I’m not sure how to code it, so as a user I can’t help – sorry

    #197171

    In reply to: topic reply

    Robin W
    Moderator

    nothing I know of does this.

    Like everything, this can be coded, but beyond free help from me I’m afraid.

    #197145
    tapiohuuhaa
    Participant

    Enable Visual Editor

    “In some cases, text pasted into the visual editor will bring along unwanted styles and HTML markup. You can use another function to force pasted text to be cleaned up. ”

    I added the function, but it does not work. See

    Suomen Kuvalehti 50/2018

    Do I need some plugin for TinyMCE

    #197144
    phil1ooo
    Participant

    Hello
    New to bbpress “to be honest I have always used wpForo” and I am finding it to be far far easier than this bbpress option and a much cleaner appearance, where I would of had wpForo up and running in less than 30 minutes, I have been working on this bbPress for 2 days now and still now where near making it usable to frontend members”

    But here I am giving you guys the benefit of the dout as my current needs require something a little different.
    My issue not displaying the profile page as that is childs play to do but to get the /user page edited so that it all properly aligns https://support.ozy.net.au/support-forums/users/dummy/

    Now click on this link https://support.ozy.net.au/support-forum/ to login.
    I have created a dummy account that I will leave active for a few days giving you change to have a look
    UN – dummy@yours.com
    PW – 1dummytest1

    I understand/know these are widgets but my issue is not being able to access this USERS page to make any changes and i can’t seem to find it anywhere in the system or cPanel file system.

    I also have the same issue with another plugin but just can’t find it right now.
    This “bbp Topic Count” plugin also doesn’t work as no shortcodes displayed here actually work
    Thi scan be seen here https://support.ozy.net.au/top-users/ at it should appear above the profile you see there “considering you do see that profile from your end that is”

    Having said this I have spent the last 2 days looking online at options and ways around all these things but most of what you find is so outdated and the rest in most part doesn’t work.

    I am creating this for a network which means just setting it up is a big job without the hassles this plugin is giving me and the last thing I need is constant maybe’s and what if’s so either this plugin works or it doesn’t. Not trying to be rube just very direct in my needs.

    Hope you can help.
    Cheers

    #197125
    jaykaybee
    Participant

    I’m new to wordpress and bbPress. I found a post that described the problem I am having, but a “keymaster” closed the thread… I don’t see how to solve this problem.

    The original thread was:
    https://bbpress.org/forums/topic/breadcrumb-and-forum-index-issues/

    Here is my restatement of the issue:

    I am new to WordPress and BBpress, using Astra theme. I have read some forum topics on the problem I am having, but some are now closed and did not provide answers in remedial enough fashion! (I’m not a coder.)
    Here is how I am experiencing the problem, you can follow along on the links below (I used BBP stylepack to remove the “home” link)
    1. I navigate to https://devgo.jeffbelkora.com/forums/. This presents a blank page.
    2. As suggested in a prior forum here, I set up a WordPress page called forums with a bbpress shortcode [bbp-forum-index]. Still, the URL /forums/ presents a blank page.
    3. Bizarrely (to me), I can see this forum index only if I change the URL to Forums/ with a capital F. Huh? Now this page displays a list of forums, namely one I created called “Resource Messages”. Very confused as to how the uppercase F came to display the right index. I stumbled on that accidentally.
    4. I click on “Resource Messages” This takes me to /forums/forum/resource-messages/. The URL now has a lowercase f in forums. This will be a problem in a minute!
    5. Now I click on “Resource Message 2” link and I’m taken to /forums/topic/20181219-resource-message-2/. Incidentally, I am working on an entire project to strip down the forum into a one-way bulletin board… but this post is just about the forum breadcrumbs.
    6. Now the problem arises where I click on the breadcrumb for forums, whose link is /forums/. As seen in item 1, this presents a blank page.
    Now, other posters pointed to BBP StylePack “breadcrumbs” setting. And I have tried to insert my forum page (with the shortcode [bbp-forum-index]) URL (/forums/) into their “override” box. But instead of showing the forum index, it shows a blank page.
    Help! I am so confused. I would really appreciate any tips or links to further resources, in very remedial terms.

    #197113

    In reply to: Trackbacks

    Robin W
    Moderator

    ah – thanks – try this

    // Force ping_status on bbPress post types
    add_filter( ‘pings_open’, ‘rew_force_ping_status’ ); 
    function rew_force_ping_status( $open, $post_id = 0 ) { 
    // Get the post type of the post ID
    $post_type = get_post_type( $post_id );
    // Default return value is what is passed in $open
    $retval = $open;
    // Only force for bbPress post types
    	switch ( $post_type ) {
    	case bbp_get_forum_post_type() :
    	case bbp_get_topic_post_type() :
    	case bbp_get_reply_post_type() :
    	$retval = false;
    	break;
    	// Allow override of the override
    	return apply_filters( ‘rew_force_ping_status’, $retval, $open, $post_id, $post_type );
    	}
    } 
    #197112

    In reply to: Trackbacks

    cdwed
    Participant

    OK…here is what I get for an error message:

    The code snippet you are trying to save produced a fatal error on line 19:

    syntax error, unexpected end of file

    #197111

    In reply to: multiple forums

    Robin W
    Moderator

    create a page and put this shortcode in for each forum you want to display where xx is the foirum number

    [bbp-single-forum id=xx]

    eg

    [bbp-single-forum id=56] 
    [bbp-single-forum id=68] 
    [bbp-single-forum id=27] 
    
    #197110

    In reply to: Trackbacks

    Robin W
    Moderator

    sorry, should have put ‘code’ round the sentence

    so should have read

    ‘you seem to have <strong> and </strong> in your code, that is not in the version I posted’

    but if that is not the issue, can you post the exact error you are getting

    #197106

    In reply to: Trackbacks

    cdwed
    Participant

    I dont get it. I copied your code exactly as below. Is there an AND symbol getting in there in the copy function?

    // Force ping_status on bbPress post types
    add_filter( ‘pings_open’, ‘rew_force_ping_status’ );

    function rew_force_ping_status( $open, $post_id = 0 ) {

    // Get the post type of the post ID
    $post_type = get_post_type( $post_id );
    // Default return value is what is passed in $open
    $retval = $open;
    // Only force for bbPress post types
    switch ( $post_type ) {
    case bbp_get_forum_post_type() :
    case bbp_get_topic_post_type() :
    case bbp_get_reply_post_type() :
    $retval = false;
    break;
    // Allow override of the override
    return apply_filters( ‘rew_force_ping_status’, $retval, $open, $post_id, $post_type );
    }

    #197105
    Robin W
    Moderator

    ok, that is quite ambitious, so well done for getting so far.

    As I think you are doing, you should only change files in the templates and then only by copying them to a bbpress folder in your child theme. The originals can (and should) stay in the bbpress plugin file. bbpress will see your files in the child theme and use them instead.

    to move the topic content – the word ‘test’ in your example

    #bbpress-forums div.bbp-forum-content, #bbpress-forums div.bbp-reply-content, #bbpress-forums div.bbp-topic-content {
    	margin-left: 0px !important;
    }
    #197104

    In reply to: Trackbacks

    Robin W
    Moderator

    you seem to have and in your code, that is not in the version I posted

Viewing 25 results - 3,926 through 3,950 (of 32,481 total)
Skip to toolbar