Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,426 through 1,450 (of 32,467 total)
  • Author
    Search Results
  • #223660

    In reply to: Forum Topics

    fenna4498
    Participant

    No we only have bbPress and the bbp style pack, Gamipress – bbPress integration and a plug-in for paid memberships. I don’t think this will be changing it. But there is a column underneath the sentence “you may use these HTML tags and attributes” with:

         

    #223630
    Robin W
    Moderator

    I need to know what you are using ie

    can you just clarify what this is, a widget or shortcode, and which one

    #223628
    Robin W
    Moderator

    ‘Recently Active Topics’

    can you just clarify what this is, a widget or shortcode, and which one

    #223620
    aygunoz
    Participant

    So how can I edit this code for [bbp-topic-index] shortcut and Implementation to my WordPress plugin? If you please, Can you explain more bc I didn’t understand exactly what to do :/ Sorry.
    Thank you for helping

    #223619
    Robin W
    Moderator

    amended in the original code to add the missing ;

    #223616
    aygunoz
    Participant

    Okay, I found the functions.php but I confuse about this code add_filter( 'bbp_get_view_query_args', 'rew_limit') Bc there are functions but there are not any code like this. So Shall I paste this there too? And after paste what’s gonna be shortcut ?
    Thank You!

    #223613
    Robin W
    Moderator

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #223610
    aygunoz
    Participant

    Where shall I put this code? This is what exactly I was looking for :)?

    #223606
    Robin W
    Moderator

    I’d suggest you check out

    function bbp_new_topic_handler

    on line 96 of

    includes\topics\functions.php

    for how a new topic is created

    #223605
    NeoTechni
    Participant

    Using this code I am able to programmatically create a forum post, but it only shows to users who are logged in (when using the bbp-single-topic shortcode) How can I get that topics to show while logged out?

    
    	function createforumpost($text, $forums_id, $unique_id, $fighter_name = false){
    		if(is_null($forums_id) || !$forums_id){
    			if(!$fighter_name){
    				$fighter_name	= explode("-", $unique_id);
    				foreach($fighter_name as $index => $word){
    					$fighter_name[$index] = ucfirst($word);
    				}
    			}
    			$forum_post = array(
    			  'post_title'    	=> $fighter_name,
    			  'post_content'  	=> $text,
    			  'post_name'	  	=> $unique_id,
    			  'post_status'   	=> 'publish',
    			  'comment_status'	=> 'closed',
    			  'post_type'		=> 'topic',
    			  'post_parent'		=> 75857,
    			  'post_author'   	=> 1,
    			);
    			$forum_post["ID"] = wp_insert_post($forum_post);
    			return $forum_post["ID"];
    		}
    		return $forums_id;
    	}
    
    #223561
    tiaestel
    Participant

    Hello
    I found bbpress registration is used by “form-user-register.php”
    I added extra field code (
    <div class=”bbp-email”>
    <label for=”user_email”><?php esc_html_e( ‘Email’, ‘bbpress’ ); ?>: </label>
    <input type=”text” name=”이메일” value=”<?php bbp_sanitize_val( ‘user_password’ ); ?>” size=”20″ id=”user_password” maxlength=”100″ autocomplete=”off” />
    </div>)
    to edit the registeration form but it didnt work
    what is the problem do you think?

    #223536

    In reply to: Forum Display

    Robin W
    Moderator

    create 2 categories and make your forums subs of these, create 2 pages and use a shortcode in each

    [bbp-topic-form forum_id=$forum_id] where $forum_id is the category

    #223513
    qlqlo
    Participant

    After I Install and activate bbPress nothing shows up in my admin area sidebar (Forum, Topics, Replies do not appear). When I create a new page and paste there a shortcode for displaying the whole forum index, the page shows an error. I don’t know what went wrong, I tested on my localhost and it worked fine.
    I also tried to delete the plugin and install it again.

    #223511
    regnalf
    Participant

    as no one answer this, i tried it by myself. i found a function in bbp-style-pack plugin for that.

    if (function_exists('bsp_is_forum_unread_amount'))
    {
    	
    	add_shortcode( 'bbp_count_new', 'bbpress_count_new' );
    	function bbpress_count_new( $atts )
    	{
    		
    		$output = "";
    		$count_new = 0;
    		
    
    		$query_foren = new WP_Query(array( 'post_type' => 'forum' ));
    		
    		
    		while($query_foren->have_posts())
    		{
    			$query_foren->the_post();
    			
    			$post_id = get_the_id();
    			
    			$bbp_forum_privategroups = get_post_meta( $post_id, '_private_group');			
    			$bbp_user_privategroups = preg_split('/\*/', get_user_meta (get_current_user_id(), 'private_group', true), -1, PREG_SPLIT_NO_EMPTY);
    			
    			if ( count( $bbp_forum_privategroups ) == 0 )
    			{
    				$amount_unr = bsp_is_forum_unread_amount( $post_id );
    				$count_new += $amount_unr->amount;
    			}
    			else
    			{
    				if ( count( array_intersect( $bbp_forum_privategroups, $bbp_user_privategroups )) > 0 )
    				{
    					$amount_unr = bsp_is_forum_unread_amount( $post_id );
    					$count_new += $amount_unr->amount;
    				}
    			}
    		}
    		
    		if ($count_new > 0 )
    		{
    			ob_start();
    			?><span style="margin-left: 0.3rem; font-size: 0.8rem; padding: 0.4rem;"> <?php echo($count_new); ?></span><?php
    			$output = ob_get_contents();
    			ob_end_clean();
    		}
    		
    		return $output;
    	}
    
    	
    }

    i hope i didn’t oversee something, because it is also combined with private forum groups!

    huetherb
    Participant

    I suppose this isn’t WordPress or BBPress specific, but trying to figure out if there is a WordPress way of doing this.

    I am using BBPress, and on some page, such as https://somesite.com/lesson/some-lesson/, I have a block with a link to a discussion topic. That link is of form

    <a href="javascript:void(0);" data-target="#myModal" data-href="somesite.com/forums/topic/required-discussion-1/" data-toggle="modal" class="openPopup"><h3 class="topictype-title">required discussion 1</h3></a>

    The modal popup is handled in bootstrap via

    
    <div class="modal fade" id="myModal" role="dialog">
       <div class="modal-dialog modal-xl">
          <div class="modal-content">
             <div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Class Discussion</h4>
             </div>
             <div class="modal-body"></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>
       </div>
    </div>
    

    And with jQuery

    
        $('body').on('click', '[data-toggle="modal"]', function(){
            $($(this).data("target")+' .modal-body').load($(this).data("href"));
        });
    

    What happens now, is after hitting submit, the modal goes away, and the forum topic page with the submitted reply is loaded: url https://somesite.com/forums/topic/required-discussion-1/#post-25847

    The thing is, after user submits from the modal, I want either

    **1) the refresh (so, going to https://somesite.com/forums/topic/required-discussion-1/#post-25847) to happen in the modal, or**

    **2) for the modal to simply close and user is returned to exactly as they were prior to modal popping up, that is, to https://somesite.com/lesson/some-lesson/**

    Ideas on how to ideally achieve these two behaviors? I have never worked with modals before, so curious what are some best practices here to get the desired behavior.

    Thanks!

    #223501
    Robin W
    Moderator

    ok, that’s development rather than support.

    so you will need to alter templates and put these in your child theme.

    look for

    \templates\default\bbpress\loop-topics.php
    does topic list headers
    
    calls loop-single-topic
    \templates\default\bbpress\loop-single-topic.php
    lists each topic in the forum, last post and freshness
    
    lists topic content

    so for each find the file

    transfer this to your pc and edit

    and save

    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

    Then transfer the file you saved above and put in in the directory called bbpress that you created above

    bbPress will now use this template instead of the original

    #223488
    regnalf
    Participant

    I know there is a widget to show somewhere on the page if there is new activity in the forums. But is there a possibility (maybe a shortcode?) to show only an icon when there is new activity in any forum? Or better yet an info with the number of new posts?

    #223481
    dalton125
    Participant

    I’ve been searching for a way to return the titles and links of every topic on my forum. I’m familiar with HTML and CSS, but a PHP novice, which I think is my downfall here.

    I found a call to

    <?php the_content();?>

    which seems to be generating the big grey box with a list of all the topics (image link: https://imgur.com/a/fKamtGH)

    However, I just want to return the topic titles and links to each topic, not the entire box. I can’t seem to find / write a PHP method that does this, does anyone have any advice?

    #223475
    Robin W
    Moderator
    #223472
    Morphim
    Participant

    Hi there

    It’s the end of Sept 2021 and I’ve been trying to sort out an old PHPBB conversion to BBPress.
    WP: 5.8.1 and BBPress 2.6.6

    I can confirm I’ve done this seemingly successfully. It took a few tries but with this thread I’ve got it working.

    I just wanted to share what worked in 2021.

    1. I exported my old PHPBB database (.sql file) and then set up a new database on my current host and imported the PHPBB to it.
    This just simplified any server timeouts and other connection issues.

    2. I obviously had BBpress installed within WP, but the included PHPBB converter doesn’t work (why??) so copied two files from this thread.

    a. Firstly, I had the ‘annonymous user’ loop mentioned above so copied @davidmanch great code (a couple of comments above) into:
    /wp-content/plugins/bbpress/includes/admin/classes/class-bbp-converter.php
    This fixed the never ending loop but the built in converter didn’t import any users, so …

    b. I copied @a8bit excellent code (3 posts above this one) into:
    /wp-content/plugins/bbpress/includes/admin/converters/phpbb.php
    This added many more steps to the import which completed without errors. I’m thinking this code might also have fixed the annonymous user loop too but didn’t try it on it’s own?? I’d already change the code in a. above. If you do this, maybe just try this code only and see if it works.

    So, if you find this now, it does work (for me at least) so hopefully you don’t have to hunt around for solutions.

    The BBPress guys need to look at these two pieces of code and see why their packaged converter doesn’t work. It’s very frustrating and shouldn’t be left to users much smarter than me to fix … but I’m glad they did.

    Cheers

    #223461

    Topic: Force Login

    in forum Installation
    msAniElle
    Participant

    I have tried looking through this forum to find what I need, and I just can’t seem to do so.

    I am by no means a coder, but I said I would help a friend put together a forum, and I would like everyone who clicks on the “forum” access button at the top of the page to be forced to log in if they are not already logged in. I would then like them to see the main forum page, not the dashboard unless they have higher clearance than participants.

    How does one do that? I saw someone post about the Private groups plugin… but will it do what I want it to do?

    #223381
    severbronny
    Participant

    I’m a newbie with code and web implementation, so forgive me if this is a dumb question. My readers have reported the following: “I’ve been trying to be able to post on your forum. I have a wordpress account, which I use to try to log in. After that it takes me to a jetpack and wordpress site, which Makes me put in my info again. But when I do, it then it takes me back to the original jetpack/wordpress page.”

    Here is the forum:

    Forum *new*

    And yet they can make comments on my site with ease:

    Discussion

    I installed bbPress using this slug: [bbp-forum-index]

    What am I missing? Thanks ahead!

    outkax
    Participant

    Thanks for your answer I have corrected my code with yours 🙂

    Robin W
    Moderator

    your triple === means that is has to match type (eg string or integer) as well as value, hence why

    if(bbp_forum_id() === '513')

    didn’t work, as the forum id is an integer and by havng quotes round the number you are asking it to be a string

    in your solution

    <?php if(bbp_get_forum_id() === $forum_id = 513): ?>

    would be better as

    <?php if(bbp_get_forum_id() === 513): ?>

    or better still

    <?php if(bbp_get_forum_id() == 513): ?>

    as unless you are using the $forum_id variable elsewhere (when it probbaly needs to be declared as a global) then the $forum_id = is redundant

    but glad you fixed it

    outkax
    Participant

    I think I found the solution 🙂 :

    <?php
    
    /**
     * Single Forum Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;
    
    ?>
    
    <div id="bbpress-forums" class="bbpress-wrapper">
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php //bbp_forum_subscription_link(); ?>
    
    	<?php do_action( 'bbp_template_before_single_forum' ); ?>
    
    	<?php if ( post_password_required() ) : ?>
    
    		<?php bbp_get_template_part( 'form', 'protected' ); ?>
    
    	<?php else : ?>
    
    		<?php //bbp_single_forum_description(); ?>
    
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>
    
    		<?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php elseif ( ! bbp_is_forum_category() ) : ?>
    			<?php if(bbp_get_forum_id() === $forum_id = 513): ?>
    
    				<?php bbp_get_template_part( 'rules' ); ?>
    
    			<?php else :  ?>
    				<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    				<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    			<?php ?>
    			<?php endif; ?>
    		<?php endif; ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_single_forum' ); ?>
    
    </div>
    
Viewing 25 results - 1,426 through 1,450 (of 32,467 total)
Skip to toolbar