Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,126 through 10,150 (of 32,504 total)
  • Author
    Search Results
  • #154566
    Robkk
    Moderator

    try combining the two into this and try it.

    i tested in twenty-fourteen and it worked.

    #bbpress-forums ul.bbp-lead-topic li.bbp-body div.topic {
        background-color: #0099FF;
        border: 1px solid #dd6;
    }
    #154565
    Robkk
    Moderator

    @pilxy the uppercase thing is in your themes css

    like i said if your theme author just changes every instance of .reply in his theme to .comment-reply-link everything should be fine.

    #154562
    Robkk
    Moderator

    @melanie-bund

    if you are a web designer from the website thats mentioned at the bottom of the website

    you can do alot of things to make it where a forum doesnt look awkward

    changing posts, voices, freshess, topics lalbes at the top to just icons

    and more depending on where your imagination takes you.

    i suggest maybe only showing the topic count in the forum archive

    and move the freshness stats below the title of each forum

    and showing only the posts stats for any forum you have just entered

    and move the freshness stats below the title of each topic.

    more info on designing can be found at the docs

    Codex

    #154560
    Robkk
    Moderator

    @priom

    it worked when i tryed it

    remember to make sure you add the right css

    like for example for the keymaster role use this

    .bbp-author-role-keymaster {
    background:blue;
    color:white;
    padding:0 5px;
    }
    Preston
    Participant

    I’m finally getting back around to working on this and realized I’ll need to hide the topics from a specific user role as well. I can’t just remove spectate/participate capabilities because I need them to be able to post topics, just like users who aren’t logged in.

    I’m having trouble finding a way to get the current user’s role for bbPress so I can use it in the same manner I used the user’s ID above.

    I found this function, but it returns the WordPress role (administrator, editor, etc):

    function get_user_role() {
        global $current_user;
    
        $user_roles = $current_user->roles;
        $user_role = array_shift($user_roles);
    
        return $user_role;
    }

    Can I somehow adapt it to return the bbPress role instead? (keymaster, moderator, etc.)

    #154558

    In reply to: Truncated usernames

    Robkk
    Moderator

    long characters are going to show up like this anyway

    splitboard.co
    m

    you could lower the font-size a little bit more with css to allow maybe 2-3 more characters
    but its still going to break the word apart if there is a certain amount of characters anyway

    you could add more width to div.reply-author
    maybe to about 150px

    add this anywhere where you can put custom css

    #bbpress-forums div.bbp-topic-author, 
    #bbpress-forums div.bbp-reply-author {
    width: 150px;
    }

    you also might have to add some @media query css too if i missed it.

    #154555

    In reply to: Activate page

    Robin W
    Moderator

    there is no [bbp-activate] shortcode

    https://codex.bbpress.org/shortcodes/

    what are you trying to do?

    #154541
    AnneMarie
    Participant

    Do you know how to count the number of unique people who comment per day/week/month?

    Is there a plug-in that will do that?

    Or code I can use?

    #154496
    Nicolas Korobochkin
    Participant

    I have solution for this issue!

    First of all — in web published a lot of strange and bad solutions for this issue. Add some rules to .htaccess, change wp-signup.php directly, blah blah blah…

    I dig into the source code and found something interesting. WordPress have wp_signup_location filter which set up the signup page URL (location).

    require_once (TEMPLATEPATH . '/wp-signup.php');
    function selena_signup_page () {
    	return home_url () . '/signup/';
    }
    add_filter ('wp_signup_location', 'selena_signup_page');

    After this create page-signup.php template in your theme folder with your custom forms (buttons, inputs, etc). Forms and other stuff can be grabbed from wp-signup.php. So I took wp-signup.php from root WP folder and put them to my theme folder. But it needs to edit. I remove some requires, functions and function calls (checkout the wp-signup.php). Be careful!

    Right now I dont know how this technique works with caching (but I use Memcached and Batcache on my sites and all works great).

    Next problem is – activate account page. Similar solution. Create page-activate.php template with require_once ( TEMPLATEPATH . '/wp-activate.php'); call inside. And copy wp-activate.php to your theme folder and then edit them (remove requires, filters and actions). Don’t delete this:

    if ( is_object( $wp_object_cache ) )
    $wp_object_cache->cache_enabled = false;

    This line for caching (I write about this above). Maybe someone tell us about object caching in WP? 🙂

    Now you need disable activation letters (WP sends its twice after this manipulations :). Use wpmu_signup_user_notification filter and your function needs to send emails and return FALSE (or WP send second activation email).

    And that’s all!

    Working example is my sites:

    1. http://armyofselenagomez.com/signup/
    2. http://selenaselena.ru/signup/

    Activation:

    1. http://armyofselenagomez.com/activate/
    2. http://selenaselena.ru/activate/

    It’s a multisite! And both sites also have:

    1. http://armyofselenagomez.com/wp-signup.php
    2. http://armyofselenagomez.com/wp-activate.php
    1. http://selenaselena.ru/wp-signup.php
    2. http://selenaselena.ru/wp-activate.php
    #154470
    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

    more info about a functionality plugin

    How to create your own WordPress functionality plugin

    #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

Viewing 25 results - 10,126 through 10,150 (of 32,504 total)
Skip to toolbar