Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,151 through 10,175 (of 32,519 total)
  • Author
    Search Results
  • #154518
    Julia_B
    Participant

    I’d like to add this function to my Forum index page. Where do I need to paste this code? Thanks 🙂

    #154515
    tharsheblows
    Participant

    The reason for this is that sending out subscription emails one by one was appreciably slowing down some large sites, so in the last update they switched to bcc’ing in subscribers.

    It’s fairly straightforward to change how the subscription emails are handled once you know how. If you unhook ‘bbp_notify_topic_subscribers’ you can then hook in your own subscription function.

    Below is similar to what I did – I have it in a plugin but you could put it in your bbpress-functions.php file too, I think – this should be in a child theme. If you do this, please test it first as this is simply an example and not necessarily working code. I’ve gone ahead and simply pasted in the function that was used in the previous version of bbPress so you don’t have to find it.

    //custom topic subscription emails, unhook old function, hook in new one
    remove_action( 'bbp_new_reply',    'bbp_notify_topic_subscribers', 11, 5 );
    add_action( 'bbp_new_reply',    'mjj_bbp_notify_topic_subscribers', 11, 5 );
    
    /** 
    * from bbpress / includes / common / functions.php
    * this is taken from 2.5.3 - I've left in all comments to make it easier to understand
    **/
    
    /** Subscriptions *************************************************************/
    
    /**
     * Sends notification emails for new replies to subscribed topics
     *
     * Gets new post's ID and check if there are subscribed users to that topic, and
     * if there are, send notifications
     *
     * @since bbPress (r2668)
     *
     * @param int $reply_id ID of the newly made reply
     * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
     * @uses bbp_get_reply_id() To validate the reply ID
     * @uses bbp_get_topic_id() To validate the topic ID
     * @uses bbp_get_forum_id() To validate the forum ID
     * @uses bbp_get_reply() To get the reply
     * @uses bbp_is_reply_published() To make sure the reply is published
     * @uses bbp_get_topic_id() To validate the topic ID
     * @uses bbp_get_topic() To get the reply's topic
     * @uses bbp_is_topic_published() To make sure the topic is published
     * @uses bbp_get_reply_author_display_name() To get the reply author's display name
     * @uses do_action() Calls 'bbp_pre_notify_subscribers' with the reply id,
     *                    topic id and user id
     * @uses bbp_get_topic_subscribers() To get the topic subscribers
     * @uses apply_filters() Calls 'bbp_subscription_mail_message' with the
     *                    message, reply id, topic id and user id
     * @uses apply_filters() Calls 'bbp_subscription_mail_title' with the
     *                    topic title, reply id, topic id and user id
     * @uses apply_filters() Calls 'bbp_subscription_mail_headers'
     * @uses get_userdata() To get the user data
     * @uses wp_mail() To send the mail
     * @uses do_action() Calls 'bbp_post_notify_subscribers' with the reply id,
     *                    topic id and user id
     * @return bool True on success, false on failure
     */
    function mjj_bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $reply_author = 0 ) {
    
    	// Bail if subscriptions are turned off
    	if ( !bbp_is_subscriptions_active() )
    		return false;
    
    	/** Validation ************************************************************/
    
    	$reply_id = bbp_get_reply_id( $reply_id );
    	$topic_id = bbp_get_topic_id( $topic_id );
    	$forum_id = bbp_get_forum_id( $forum_id );
    
    	/** Reply *****************************************************************/
    
    	// Bail if reply is not published
    	if ( !bbp_is_reply_published( $reply_id ) )
    		return false;
    
    	/** Topic *****************************************************************/
    
    	// Bail if topic is not published
    	if ( !bbp_is_topic_published( $topic_id ) )
    		return false;
    
    	/** User ******************************************************************/
    
    	// Get topic subscribers and bail if empty
    	$user_ids = bbp_get_topic_subscribers( $topic_id, true );
    	if ( empty( $user_ids ) )
    		return false;
    
    	// Poster name
    	$reply_author_name = bbp_get_reply_author_display_name( $reply_id );
    
    	/** Mail ******************************************************************/
    
    	do_action( 'bbp_pre_notify_subscribers', $reply_id, $topic_id, $user_ids );
    
    	// Remove filters from reply content and topic title to prevent content
    	// from being encoded with HTML entities, wrapped in paragraph tags, etc...
    	remove_all_filters( 'bbp_get_reply_content' );
    	remove_all_filters( 'bbp_get_topic_title'   );
    
    	// Strip tags from text
    	$topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
    	$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
    	$reply_url     = bbp_get_reply_url( $reply_id );
    	$blog_name     = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    
    	// Loop through users
    	foreach ( (array) $user_ids as $user_id ) {
    
    		// Don't send notifications to the person who made the post
    		if ( !empty( $reply_author ) && (int) $user_id === (int) $reply_author )
    			continue;
    
    		// For plugins to filter messages per reply/topic/user
    		$message = sprintf( __( '%1$s wrote:
    
    %2$s
    
    Post Link: %3$s
    
    -----------
    
    You are receiving this email because you subscribed to a forum topic.
    
    Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
    
    			$reply_author_name,
    			$reply_content,
    			$reply_url
    		);
    
    		$message = apply_filters( 'bbp_subscription_mail_message', $message, $reply_id, $topic_id, $user_id );
    		if ( empty( $message ) )
    			continue;
    
    		// For plugins to filter titles per reply/topic/user
    		$subject = apply_filters( 'bbp_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $reply_id, $topic_id, $user_id );
    		if ( empty( $subject ) )
    			continue;
    
    		// Custom headers
    		$headers = apply_filters( 'bbp_subscription_mail_headers', array() );
    
    		// Get user data of this user
    		$user = get_userdata( $user_id );
    
    		// Send notification email
    		wp_mail( $user->user_email, $subject, $message, $headers );
    	}
    
    	do_action( 'bbp_post_notify_subscribers', $reply_id, $topic_id, $user_ids );
    
    	return true;
    }
    #154491
    chrischros34
    Participant

    Hi everyone, I need help, so I am appealing to the community.
    I spent many hours trying to fix this display, but I can not.
    Version of WordPress: 4.0
    Version of bbpress: 2.5.4
    Template: WP-Critique

    I can not be specific to the forum sidebar to the racine, but I have elsewhere (subjects, answers …).
    Here is my forum http://www.googland.fr/forums/
    I carefully followed the help provided on https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ (part 8), I have certainly misunderstood.

    I created my bbpress.php based on page.php, here is the code.

    <?php get_header(); ?>
    
    	<?php global $wp_query; $postid = $wp_query->post->ID; ?>
    
    	<div id="page" class="clearfix">
    
    		<div id="contentleft">
    
    			<?php if ( get_post_meta( $postid, 'post_featcontent', true ) == "Narrow Width Featured Content Slider" ) { ?>
    				<?php include (TEMPLATEPATH . '/featured-narrow.php'); ?>
    			<?php } ?>
    
    			<?php if ( get_post_meta( $postid, 'post_featgalleries', true ) == "Yes" ) { ?>
    				<?php include (TEMPLATEPATH . '/featured-galleries.php'); ?>
    			<?php } ?>
    
    			<div id="content" class="maincontent">
    
    				<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
    
    				<?php include (TEMPLATEPATH . '/banner468.php'); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    				<div class="post clearfix" id="post-main-<?php the_ID(); ?>">
    
    					<div class="entry">
    
    						<h1 class="page-title"><?php the_title(); ?></h1>
    
    						<?php if ( get_post_meta( $post->ID, 'video_embed', true ) ) { ?>
    							<div class="single-video">
    								<?php echo get_post_meta( $post->ID, 'video_embed', true ); ?>
    							</div>
    						<?php } ?>
    
    						<?php the_content(); ?>
    
    						<div style="clear:both;"></div>
    
    						<?php wp_link_pages(); ?>
    
    					</div>
    
    				</div>
    
    <?php endwhile; endif; ?>
    				
    			</div>
    
    			<?php include (TEMPLATEPATH . '/sidebar-narrow.php'); ?>
    
    		</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Can anyone tell me how to edit the file and what I have to put into it.
    I would be very grateful for help.
    Thank you

    #154508
    Robkk
    Moderator

    try this

    this removes some black padding when you reach a device width of 480px
    15px or a little bit less should be good.
    if you want more just change 15px to whatever you want.

    @media only screen and (max-width: 480px) {
    .site {
        box-shadow: 0px 2px 6px rgba(100, 100, 100, 0.3);
        margin: 48px auto;
        max-width: 960px;
        overflow: hidden;
        padding: 0px 15px;
    }
    }

    this makes your bbpress forums full width

    @media only screen and (max-width: 480px) {
    .site-content {
        background: none repeat scroll 0% 0% transparent;
        float: left;
        min-height: 150px;
        width: 100%;
    }
    }

    if you made a bbpress.php file put .bbpress in the begginning so it would be

    .bbpress .site-content

    more on creating a bbpress.php file.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #154506
    rock17
    Participant

    What’s the best way to go about adding a custom page under the bbPress directory (/forums)?

    I’ve created a new page in WordPress that uses bbPress shortcodes. I’d like the URL to remain under ‘/forums’ like ‘/forums/new-page’. WordPress automatically converts the directory to /forumsnew-page (due to a conflict with bbPress using /forums)

    Any help would be greatly appreciated!

    #154502
    manheim
    Participant

    We’re getting an email to noreply@ourwebsite.com every single time someone posts a reply. Looking into bbpress/includes/common/function.php starting on line 1023 it looks like this is the intended behavior. It sends an email to:

    $do_not_reply = '<noreply@' . ltrim( get_home_url(), '^(http|https)://' ) . '>';

    …and it BCC’s any users who are subscribed:
    wp_mail( $do_not_reply, $subject, $message, $headers );

    This seems silly. Am I really reading this right? Why can we not disable emails coming to noreply@ ? Big forums will get hundreds of emails a day….

    #154499
    Robin W
    Moderator
    #154498
    webUI1
    Participant

    Thanks Robin for your reply.

    I am giving 2 short codes on main page:

    [bbp-forum-index]

    [bbp-topic-index]

    By doing so, there are two search box display just above of Forum block, and Topic Block. Which is not correct, on same page two search boxes.
    How can we fix it?

    Cheers 🙂

    #154497
    Robin W
    Moderator

    either :

    shortcode [bbp-topic-index]

    or

    bbp additional shortcodes

    biscuitier0
    Participant

    Now I just need to hide the toolbar for non-admins (code for this is above – thanks, Robin) and put and edit profile link where I need it to be in the menu to display only when users are logged in.

    ***Apologies for all the posts I have made but there is a bug with this forum that was stopping me posting (and worse, deleting my posts so I needed to type them again). The only way I could get it to work was to split the post into smaller parts***

    biscuitier0
    Participant

    Okay I managed to do roughly what I wanted without changing the functions.php. Here’s how:

    1) I installed bbP Members Only plugin https://wordpress.org/plugins/bbpress-members-only/, I then created a test forum and topic

    2) I created a page called ‘member login’ and put the [bbp-login] shortcode in this page (no menu link for this page)….

    #154474
    nM_WP
    Participant

    Hi,

    WP-4.0 & BB-2.5.4 on localhost.

    Everything working fine except, I am not able to show the “Topic title” at the top of each topic, as the topic title “Show topic title top of Each topic” appearing above.

    I have tried bbp_get_topic_title() with no luck.

    #154472
    Robkk
    Moderator

    you add this to your themes functions.php or a functionality plugin.

    you then use css to style the roles from there.

    add_filter('bbp_before_get_reply_author_role_parse_args', 'ntwb_bbpress_reply_css_role' );
    function ntwb_bbpress_reply_css_role() {
    
    	$role = strtolower( bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ) );
    	$args['class']  = 'bbp-author-role bbp-author-role-' . $role;
    	$args['before'] = '';
    	$args['after']  = '';
    
    	return $args;
    }
    
    add_filter('bbp_before_get_topic_author_role_parse_args', 'ntwb_bbpress_topic_css_role' );
    function ntwb_bbpress_topic_css_role() {
    
    	$role = strtolower( bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ) );
    	$args['class']  = 'bbp-author-role bbp-author-role-' . $role;
    	$args['before'] = '';
    	$args['after']  = '';
    
    	return $args;
    }

    It grabs the topic or reply author role and adds another CSS class with prefix bbp-role- so you now have a new set of CSS classes e.g. bbp-role-keymaster, bbp-role-moderator, bbp-role-participant etc that you can then add your custom CSS styles to.

    link this was from

    Topic background color depending on role

    #154469
    Robkk
    Moderator

    i dont think this would be great idea to allow participants to create new forums.

    i can see a reason why maybe you would want moderators though, but i mean it still isnt a great idea.

    there is also a limit on the number of forums i think like 50 or so, so take that into consideration.

    think you should have a site suggestion forum on upcoming improvements , and if your users want a specific forum to be added to your site you should post what they want and then you can choose from there.

    you can create a page and add this shortcode to display the forum form in the front-end.

    [bbp-forum-form]

    you can also download @netwebs plugin from this link which will add a forum form for users who can moderate on their profile home

    https://gist.github.com/ntwb/10701087

    #154466
    kendorama
    Participant

    I noticed for Keymasters you are able to “Trash” posts and of course “Spam”. For Moderators there is no “Trash” post.

    I had though I could just edit this in the capabilities.php but looking at the code it seems they have the exact same permissions when it comes to Topics. Does the moderator need the “delete” for Forums to be able to Trash topics?

    Thanks

    #154465
    akyboy
    Participant

    AH,…

    user-details.php is file im looking for

    So if i can add that custom link below:

    <a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( esc_attr__( "Edit %s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php _e( 'Edit', 'bbpress' ); ?></a>

    So need link to http://wotlabs.net/na/player/%s i guess? 🙂

    #154464
    akyboy
    Participant

    Love you more and more! :PPP

    Thanks sooooo much sir!!

    Also noticed padding fix i had it top, bottom, right, left 🙂

    #154463
    Robkk
    Moderator

    change the width from 400px to auto

    like this

    blockquote {
        font-family: Open Sans,sans-serif;
        font-size: 14px;
        font-style: italic !important;
        background-color: #212123;
        border: 0.5px solid #CCC;
        border-radius: 6px;
        box-shadow: 0.5px 0.5px 0.5px #CCC;
        padding: 15px;
        width: auto;
    }
    biscuitier0
    Participant

    Hi Robin

    Sorry for disappearing on this. I was so busy with the rest of the site, I had to leave the forum to one side.

    Anyway, thanks for your suggestions above. I tried them out and have unfortunately hit a couple of snags

    1) I’m finding that once I login using the BBP login form, I’m left with a blue box that says ‘You are already logged in’. Is it possible to make this disappear, once logged in. Or if not, have you redirected to a different page once successfully logged in?

    2) Is it possible to say exactly where in the menu the ‘Edit Profile’ goes? I would prefer it not to be a top level menu item and to go into the dropdown menu instead

    3) Is the intention that I put the [bbp-forum-index] shortcode underneath the [BBP-login] shortcode? I want people to be taken straight to the forum once they have succesfully logged in. At the moment when I put those two shortcodes on a page together, I am getting a php error along the lines of

    Warning: Cannot modify header information - headers already sent by...

    I think this might be to do with me using the Genesis framework?

    I have alreday installed the Genesis Extend BBpress plugin

    #154452
    Themes de France
    Participant

    Hey guys,
    As a theme developper I wanted to bring bbPress support and I was facing the same issue.

    The plugin that @robin-w brought was working but I know something was wrong with my theme.

    I managed to make it work without the plugin by deleting this snippet from functions.php :
    https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts#Exclude_Pages_from_Search_Results

    The intent of this snippet is to exclude pages from search results and I guess this was conflicting with WP4.

    If you have this problem with your theme, look for “pre_get_posts” actions and if the search query is updated.

    Hope that can helps 🙂

    Preston
    Participant

    Thanks, that did the trick. Looking back, I probably should have noticed that was the problem! It was obvious in the error message.

    Setting up the role worked, but if I set “spectate” to false, the role can’t see the forum at all to even post.

    After searching some more, I found there was a bbPress setting to allow “anonymous” posting without an account. With that enabled, and the forum set to public, I used the following code to hide the list of topics from users who aren’t logged in (I believe they always come back with an ID of 0).

    This is in the “loop-single-topic.php” file. I’ll probably also need to add this code to template files that display single topics, in case any sneaky people figure out the URL structure. The concept remains the same, however.

    <?php 
        $currentUserID = bbp_get_current_user_id(); 
        if($currentUserID == '0'){
            //Display stuff if user's ID is 0 (they aren't logged in)
        } else {
            //Put all the topic loop code here, it will display if the user is logged in (has an ID other than 0
        }
    ?>

    This seems like a pretty secure way to do it, none of the topic information is displaying in the source code or anything like that. I’ll add any other relevant information I find tomorrow. For now, it’s time to sleep.

    **EDIT**
    I’ll definitely need to set something up with regards to the single topic templates. Creating a new topic as an anonymous user still redirects you to that topic. I’ll have something tomorrow.

    #154433
    atfpodcast
    Participant

    I deactivated these plugins that added bbcode. They worked at first. I did this on a fresh install of wordpress for a new site. It works for ie, chrome etc I have debugging on. What would be the cause? The plugin author says its plugin i dont know… So I thought I would use the bbpress defaults and those dont work.

    #154432
    atfpodcast
    Participant

    I deactivated the bbcode and white ilst and the default took bar is not showing in firefox. I will open another thread. Why this so hard? blah

    #154431
    Nicolas Korobochkin
    Participant

    At https://translate.wordpress.org/projects/bbpress/2.5.x I see 99% translated 🙂 You can translate some missing phrases. After that at the bottom of the page choose all current and Machine Object Message Catalog (.mo). Click the Export link. You download the file with translations.
    After that rename downloaded file to bbpress-pt_BR.mo and put it in /wp-content/plugins/bbpress/languages/ and you done.

    #154427
    Robkk
    Moderator

    @atfpodcast
    i just checked on my side with the latest raindrops theme ,

    i checked to see if all of the quicktag buttons worked
    they did.

    i checked if some of the bbcodes from gdbbpress and bbpress2 bbcode didnt just process the bbcode out well
    they did.

    i didnt run bbpress2 bbcode with bbpress direct quotes while gdbbpress tools activated at the same time, because i mean they do the same thing.

    if you feel like the quicktags toolbar is really causing the problem and you have some error logs to post or images of error logs or any other info you can get while debugging is on, make a new topic with all the information in it.

Viewing 25 results - 10,151 through 10,175 (of 32,519 total)
Skip to toolbar