Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,826 through 11,850 (of 32,521 total)
  • Author
    Search Results
  • #146767
    helmutforren
    Participant

    This is regarding http://saveourgrace.com/forums/

    I believe I followed all the instructions properly. However, initially, my WordPress “Page” with link above was blank. I found advice at http://bbpress.org/forums/topic/bbpress-forum-blank-pages/ that it may be a theme issue, so I simply added the short code [bbp-forum-index].

    This got the page working as you can see it now. It properly shows the “Fundraising” forum. However, the number of topics is listed as 0, and when I click on the forum name, I get the otherwise blank page at http://saveourgrace.com/forums/forum/fundraising/ .

    I did add a topic per the instructions, and confirmed on the topics list page that my topic belongs to the fundraising forum.

    I am using the theme “Academica” version 1.2.2. I changed to “Twenty Thirteen” temporarily, and things seemed much better. I could see and get into the topic. If I figure out how to make the topic show with “Academica”, am I nevertheless going to find myself fighting an endless battle with this theme? Or should one more fix take care of it? (Of course, if it is just one more fix, what might that fix be?)

    Note I’m using WordPress 3.9.1.

    Thanks very much,
    Helmut

    demonboy
    Participant

    I’m using an Avada child theme and have inserted the search shortcode. Unfortunately it is showing two forms. I’m sure I could get rid of one by doing a display:none on the relevant div but I’d like to know why this is happening. You can see the page here, whilst the code is here:

    [one_half last="no"]Welcome to the Itinerant Writers Club. This is a closed group but anyone interested in discussing travel writing is invited to join. It is a dedicated group where, each month, every essay written by the members is critiqued by the others. Here's why you should join:
    
    [checklist icon="pencil" iconcolor="#6dd622" circle="yes"]
    <ul>
    	<li>High rate of published members</li>
    	<li>Dedicated, monthly critique of your work</li>
    </ul>
    [/checklist]
    
    [bbp-search]
    
    [/one_half]
    [one_half last="yes"]<tt>[bbp-forum-index]</tt>[/one_half]
    Robin W
    Moderator

    ok, so put this in your functions file

    //This function adds the author to the reply
    function bbp_author_display () {
    	if (bbp_get_reply_author_id() == bbp_get_topic_author_id() ) {
    	echo '<span class="topic-author">' ;
    	echo '<ul><li>' ;
    	echo 'Topic Author' ; 
    	echo '</li></ul></span>' ;
    	}
    	else return ;
    	}
    	
    	add_action ('bbp_theme_after_reply_author_details', 'bbp_author_display') ;

    and this in your style.css

    #bbpress-forums .topic-author{
      background: none repeat scroll 0 0 #5BB75B;
      color: #FFFFFF;
      display: block;
      padding: 5px;
    }
    

    Job done !

    #146747
    Richard B
    Participant

    bbpress bypasses the standard profile update of WordPress with its own form. So, none of the standard plug-ins are likely to do this. The function that needs to be modified is: bbp_edit_user_handler in wp-content\plugins\bbpress\includes\common\functions.php.

    I added my own edit check (just before the caps check):

    $symbol = preg_quote('~!@#$%^&*()_+-=[]{}"|?<>.,|£’);
    if (strlen($_POST[‘pass1’])<12)
    {
    if(!preg_match(‘/^(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[‘ . $symbol . ‘])[0-9A-Za-z’ . $symbol . ‘]{6,16}$/’, $_POST[‘pass1’])) {

    bbp_add_error( ‘bbp_update_user_capability’, __( ‘ERROR: The password must be 6 or more characters with at least one uppercase, one lowercase, one digit and one symbol.’, ‘bbpress’ ) );
    return;
    }
    }`

    It’s not really a check for “strong passwords” based on the WordPress meter, but it is better than nothing. I don’t really know enough about PHP/JavaScript etc. to do that. I also had the password generated modified to fit these rules, but the reality is that the generated password is already a “strong password”.

    #146737
    dryan1144
    Participant

    Thanks Robin I will have a look at your code.

    #146714

    In reply to: Requirement Questions

    Robin W
    Moderator

    Multiple user levels https://wordpress.org/support/plugin/bbp-private-groups plugin should do this
    Capacity to see at a glance live updated list of who has commented – could be coded but is not in the current version.
    Is there a way to integrate Dropbox – not that I know
    He would like a tag cloud also. – yes that’s there

    #146712
    peter-hamilton
    Participant

    Hello

    I am quite a newbie in regards to web design/development, especially wordpress and bbpress are quite tricky to learn when not knowing anything about php etc.

    For about 5 months i have been hacking away and pasting existing code to create what I hope to be a nice allround bbpress/buddypress theme.

    It is still being worked on but I would love some feedback on my progress.

    BBFacelook theme development

    Thanks in advance
    Peter Hamilton

    #146706

    In reply to: Tamriel Foundry Forums

    peter-hamilton
    Participant

    One of my main motivators of continuing with BBPress is Tamriels foundry, one of the few examples that show that it is possible to create a forum similar to that of premium forums, with the added bonus of having wordpress/bbpress and budypress with their helpful communities.

    You guys rock and thanks to looking at your code I am able to create my own community site.
    http://www.cultivators-forum.com

    +1

    P.H.

    #146701

    In reply to: Help with forum layout

    Robin W
    Moderator

    bbpress will use your standard page template.

    see

    Step by step guide to setting up a bbPress forum – Part 1

    for the order and which one to look for.

    But it is styling that will determine the width.

    look in your theme’s style.css for code something like

    #sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 545px;
    width: 190px;
    }

    and you may need to play with the content

    #content {
    float: left;
    width:500px;
    }

    If you just want it changed for bbpress pages, then try

    #bbpress-forums.sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 545px;
    width: 190px;
    }

    may or may not work, css not my strong point !

    #146699
    Robin W
    Moderator

    ‘You can pass wp_query args into bb_has_topics(), but I can only only come up with code that shows topics from one forum – not multiple forums.’

    I’m afraid I don’t have time at the moment to do lots of coding for others, but take a look at this plugin

    bbp Private Groups

    Look at includes/topics.php for how I did this for private groups – called pg_has_topics, it may give you some help – I used ‘post__in’ to create a list of topics to display

    So you could do a coupe of loops to create this list and the pass that to the bbp_has_topics function.

    ‘post__in’ is realy, useful sometimes

    see

    https://codex.wordpress.org/Class_Reference/WP_Query

    #146694
    Robin W
    Moderator

    Great stuff !

    It always amazes me how long I spend to produce so little code 🙂

    Bet you learned a lot along the way though!

    #146683
    Stephen Edgar
    Keymaster

    99% sure it is a compatibility issue with that Headway theme you are using.

    I can’t find a reference to bbPress on their site, only a dead link to a BuddyPress article on their FAQ page http://headwaythemes.com/frequently-asked-questions/ that I think eventually lands you at this page https://headwaythemes.com/downloads/community-builder/ which mentions ‘Discussion Forums’ in the image, no specific bbPress reference.

    If you don’t have a bbpress.php file in your theme folder try creating one based on your preferred page template, e.g. page.php or page-sidebar.php etc, just make a copy of the file and rename it to bbpress.php.

    Short of that working I think you will need to contact the Headway support to find out if they support bbPress or not.

    Stephen Edgar
    Keymaster

    A couple of thoughts, not explicitly what you asked for but are related 😉

    Use bbp_show_lead_topic, here on bbpress.org if you go to a topic with many pages (actually more than 1 page) you always see the original topic at the top of the page.

    And

    Use CSS, take a look at the source of this topic, you’ll notice that any reply by the original topic author has a CSS class topic-author

    #146680
    Stephen Edgar
    Keymaster

    You can also use https://codex.bbpress.org/bbp_show_lead_topic/ it is what is used here on bbpress.org to seperate the topic from the replies using different template parts.

    Take a look at content-single-topic-lead.php, you will also see bbp_show_lead_topic() in various other template parts such as the ones you originally mentioned.

    #146678

    In reply to: Forum Error

    Stephen Edgar
    Keymaster

    I have no idea what that could be, bbPress v2.x does NOT include a file named forum.php

    Are you sure you are using bbPress?

    #146665
    Nathan
    Participant

    So, after DAYS of working on this I finally have a solution. I have not done a lot of testing, but this has worked so far.

    Basically what is happening is that for forums (not replies) the logic is inverted. This means that users are subscribed to a forum unless they unsubscribe (ie. are added to the DB).

    Just add this to your theme’s function.php and it should work.

    I hope this helps someone, because it has taken a LOT of work!

    add_filter( 'bbp_get_user_subscribe_link', 'invert_get_user_subscribe_link', 10, 4 ); //invert forum subscription
    add_filter( 'bbp_is_user_subscribed_to_forum', 'invert_is_user_subscribed_to_forum', 10, 4 ); //invert forum subscription
    add_filter( 'bbp_get_forum_subscribers', 'invert_get_forum_subscribers' ); //invert forum subscription
    add_filter( 'bbp_is_user_subscribed', 'invert_is_user_subscribed', 10, 4 ); //invert forum subscription
    
    function invert_is_user_subscribed($retval, $user_id, $object_id, $subscribed_ids) {
    	if (get_post_type( $object_id ) == bbp_get_forum_post_type())
    		return !$retval;
    	else	
    		return $retval;
    }
    
    function strContains($needle, $haystack) {
    	if (strpos($haystack, $needle) !== false) {
    		return true;
    	} else {
    		return false;
    	}
    }
    
    function invert_get_user_subscribe_link ($html, $r, $user_id, $topic_id) {
    	if (strContains( "bbp_unsubscribe", $html )) {
    		$html = str_replace("bbp_unsubscribe", "bbp_subscribe", $html);
    	} else {
    		$html = str_replace("bbp_subscribe", "bbp_unsubscribe", $html);
    	}
    	return $html;
    }
    
    function invert_get_forum_subscribers( $users ) {
    	$args = array('fields' => 'id');
    	$all_users = get_users($args);
    	$send_to_users    = array_diff($all_users, $users);
    	return $send_to_users;
    }
    
    function invert_is_user_subscribed_to_forum( $retval, $user_id, $forum_id, $subscribed_ids ) {
    	return !$retval;
    }
    

    I also include make users “subscribed” to anything they write by default. All they have to do is uncheck the box. The following code is also added to function.php.

    add_action('bbp_theme_after_topic_form_subscriptions', 'subscribed_by_default'); //default subscribe
    add_action('bbp_theme_after_reply_form_subscription', 'subscribed_by_default'); //default subscribe
    
    function subscribed_by_default() 
    	echo '<script type="text/javascript">jQuery("#bbp_topic_subscription").prop("checked","checked");</script>';
    }
    Robkk
    Moderator

    @robin-w hey thanks for helping me out

    and i was using 5 pages as an example

    i would like the topic starter label throughout a topic , for whatever number pages it may have

    so should i basically use this

    //This function adds the author to the reply
    function reply_display_author () {
    	if( get_post_type() == 'reply' ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;

    with this function instead??

    <?php if ( bbp_thread_replies() ) : ?>
    
    			<?php bbp_list_replies(); ?>
    			
    			
    		<?php else : ?>
    			<?php global $countr ;
    			$countr=-1 ; ?>
    		
    			<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    			
    			<?php 
    			$countr ++ ;?>
    			
    			<?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    			<?php endwhile; ?>
    			
    			
    		<?php endif; ?>
    #146662
    dryan1144
    Participant

    Out of the box, bbpress shows topics from a particular forum when you are on that forum’s archive page. Makes sense. If that forum has a sub-forum, it will link to those sub-forums, but it won’t show the actual topics from that sub-forum.

    I’m trying to modify the default bbpress loop on a forum page (loop-topics.php) to include the sub-forum topics.

    Here’s an explanation:

    Forum A
    Sub-forum A1
    Sub-forum A2
    Forum B
    Sub-forum B1
    Sub-forum B2
    So when viewing Forum A’s archive page, I’d like to show topics from Forum A, sub-forum A1 and sub-forum A2.

    The code needs to be dynamic in order to work with whatever parent forum archive a user is on.

    You can pass wp_query args into bb_has_topics(), but I can only only come up with code that shows topics from one forum – not multiple forums.

    To better explain what I’m working with, here’s an example of a loop that grabs topics from the parent forum:

    
    <?php
    
    $parents = get_post_ancestors( $post->ID );
    
    $id = ($parents) ? $parents[count($parents)-1]: $post->ID;
    
    $parent = get_page( $id );
    
    ?>
    
    <?php $bbp_loop_args = array('post_parent' => $parent->ID, 'post_type' => 'topic'); ?>
    
    <?php if ( bbp_has_topics($bbp_loop_args) ) : ?>
    
        <?php while ( bbp_topics() ) : bbp_the_topic(); ?>
    
            <?php bbp_get_template_part( 'loop', 'single-topic' ); ?>
    
        <?php endwhile; ?>
    
    <?php endif;?>
    

    Any ideas on how this can be achieved?

    robgranholm
    Participant

    Nevermind, fixed the second code, it’s missing a );

    robgranholm
    Participant

    Thanks for this info!

    So, the bbpress.php page worked, its loading the correct forums looking page now, no sidebar, but I can add that into this page. I see how it works.

    The breadcrumbs code unfortunately does not work, causes a parse error if I try to add the second part, this one http://take.ms/JKeuq

    The first part works, but if I add the second part, it breaks. If I just have the second part, it breaks….has this code become outdated?

    Robin W
    Moderator

    ok, may be a little rough, but seems to work

    put this in your functions file

    //This function adds the author to the reply
    function reply_display_author () {
    	global $countr ;
    	if ($countr == 5 ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    	
    	add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;
    	

    and then create a file called bbpress in the root of your theme and copy across loop-replies.php

    then amend from line 42 so that it reads

    <?php if ( bbp_thread_replies() ) : ?>
    
    			<?php bbp_list_replies(); ?>
    			
    			
    		<?php else : ?>
    			<?php global $countr ;
    			$countr=-1 ; ?>
    		
    			<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    			
    			<?php 
    			$countr ++ ; 
    			
    			<?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    			<?php endwhile; ?>
    			
    			
    		<?php endif; ?>

    seems to do the trick !

    Robin W
    Moderator

    This dropped into your functions file puts it in every reply – just thinking about how you’re get every 5th !

    //This function adds the author to the reply
    function reply_display_author () {
    	if( get_post_type() == 'reply' ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;
    #146625

    In reply to: SimplePress Import

    Stephen Edgar
    Keymaster

    @tonytomov I highly doubt it, a quick look at the SimplePress notes to upgrade to v5.x requires at least v4.5, have a look around and see if you can find a v4.3.1 to v4.5 upgrade, then follow the instructions to upgrade to v5.x

    http://codex.simple-press.com/codex/installation/upgrading/upgrading-version-4-5/

    Robin W
    Moderator

    So your test site works, but you live site doesn’t?

    If there on the same servers, then it has to be a difference in either settings (database) or code.

    I’d try to work out which by backing up my test site, and then restoring my live site database to it

    see https://codex.bbpress.org/creating-a-test-site/

    for details if you’re not familiar.

    That should let you see which is it, and you can progress from there

    come back and let us know how you get on

    #146618
    ebarcena
    Participant

    I’m grad this issue is getting worked on.

    Hey Evan Herman can you please share your temporal solution code exactly as I should paste it in my functions.php

    I pasted it like this but nothing happened:

    $body_class = get_body_class();
    if ( in_array('bbpress',$body_class) ) {
    		?>
    		<script>
    		  jQuery(document).ready(function() {
    		    jQuery('.menu-item-347').removeClass('current_page_parent');
    		    jQuery('.menu-item-2592').addClass('current_page_parent');
    		  });
    		</script>
    <?php
    	}

    Thanks!

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