Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,801 through 9,825 (of 32,505 total)
  • Author
    Search Results
  • #156524
    Robkk
    Moderator

    if you dont want users to subscribe to forums/topics at all disable subscriptions in settings>forum

    if you dont want users to favorite topics disable subscriptions in settings>forum

    the subscription and favorites sections will disappear if disable both

    you can also copy the file content-single-user.php into a folder called bbpress in your child theme. then delete these lines of code below.

    <?php if ( bbp_is_favorites() ) bbp_get_template_part( 'user', 'favorites'       ); ?>
    <?php if ( bbp_is_subscriptions() ) bbp_get_template_part( 'user', 'subscriptions'   ); ?>
    <?php if ( bbp_is_single_user_topics() ) bbp_get_template_part( 'user', 'topics-created'  ); ?>
    <?php if ( bbp_is_single_user_replies() ) bbp_get_template_part( 'user', 'replies-created' ); ?>
    #156523
    Robkk
    Moderator

    hmmm i see you hid the notice with some CSS for a quick solution.

    you can check and see if creating a bbpress.php file would solve the issue.

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

    #156522

    In reply to: WordPress dashboard

    Robkk
    Moderator

    see if this works

    add it to your function.php in your child theme or functionality plugin.

    /**
     * Disable admin bar on the frontend of your website
     * for subscribers.
     */
    function rkk_disable_admin_bar() { 
    	if( ! current_user_can('edit_posts') )
    		add_filter('show_admin_bar', '__return_false');	
    }
    add_action( 'after_setup_theme', 'rkk_disable_admin_bar' );
     
    /**
     * Redirect back to homepage and not allow access to 
     * WP admin for Subscribers.
     */
    function rkk_redirect_admin(){
    	if ( ! current_user_can( 'edit_posts' ) ){
    		wp_redirect( site_url() );
    		exit;		
    	}
    }
    add_action( 'admin_init', 'rkk_redirect_admin' );
    #156521
    Robkk
    Moderator

    It doesn’t show all the forum categories. It’s showing up like a blog post/page instead.

    this is common , all you have to do is create a bbpress.php file your bbpress installation.

    heres more instructions on how to create one.

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

    Why is it showing /forums/forum? I only want it to be for example /forums

    its suppose to be setup that way.

    you can disable the Prefix all forum content with the Forum Root slug in settings>forum, its recommended though.

    Now, if I try to go to http://www.mydomain.com/blog/forums/forum/ to see the whole list of forums like it should be

    you should go to http://www.mydomain.com/blog/forums/

    /forums/ for all forums

    /forums/forum for specific forum.

    #156120
    Divine_Apex
    Participant

    I am currently experiencing a padding issue with mini avatar icon displays. For example, on the last post author among other things:

    [IMG]http://i.imgur.com/YYBQoHX.png[/IMG]

    I am using a custom avatar plugin and it seems users with blank avatars don’t have this padding issue. I have checked CSS and can’t seem to find where to mess with this padding or anything that seems to work.

    I am also using this code in my loop-single-forum file to display the topic title under the last post time

    <?php do_action( 'bbp_theme_before_topic_author' ); ?>
    
    			<div class="bbp-forum-last-topic-name"><a href="<?php bbp_forum_last_topic_permalink(); ?>" title="<?php bbp_forum_last_topic_title(); ?>"><?php bbp_forum_last_topic_title(); ?></a></div>
    <?php do_action( 'bbp_theme_before_topic_author' ); ?>
    <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
    
    			<?php do_action( 'bbp_theme_after_topic_author' ); ?>
    

    My site:
    http://the-divine.net/forum

    #156219
    Chad
    Participant

    Playing around with a test WP install with bunch of plugins I intend to use in production.

    So I installed WP at /blog and installed handful of plugins, notably bbpress and buddypress, yoast seo

    This is the problem:
    http://www.mydomain.com/blog/forums/

    It doesn’t show all the forum categories. It’s showing up like a blog post/page instead.

    This is one of the parent forums:
    http://www.mydomain.com/blog/forums/forum/the-buzz/

    Why is it showing /forums/forum? I only want it to be for example /forums

    Now, if I try to go to http://www.mydomain.com/blog/forums/forum/ to see the whole list of forums like it should be, it redirects me to “forum banners”?

    MY SETTINGS:

    permalinks: post name

    Yoast SEO: %%title%% %%page%%

    .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    Appreciate any help on this. Thanks.

    #156207
    Matt
    Participant

    I tried this and it actually works.

      Place Adsense over single from topic

      That is really simple way to place ads over the single topic of your bbpress forum. You just use ftp to customize the following file

      wp-content/plugins/bbpress/templates/default/bbpress/content-single-topic.php

      Just place your Adsense ads code over or under

      Also you can place that on otherwhere such

      content-single-forum.php
      content-archive-forum.php
      content-archive-topic.php

    gdavide
    Participant

    I’ve successfully installed bbpress2 and migrated every content from the old mingle forum and topics/reply to bbpress, by following these advices:
    https://codex.bbpress.org/import-forums/mingle/

    To rewrite every old mingle topic’s google search to bbpress, i’ve modified the .htaccess file on the root directory as shown below:

    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^forum/forum-group2/discussioni-forum1/(.*)-thread\d+ http://www.mysite.it/forums/topic/$1/ [R,L]
    

    (in my case i’ve only one forum)
    It works!

    #156478
    Robkk
    Moderator

    your registration page is made from BuddyPress.

    unless there is another registration made from the bbPress register form shortcode that is causing the problem.

    you can try deactivating your plugins one at a time and try to find if there is a plugin causing the issue.

    other than that i guess go to https://buddypress.org/support/

    #156474
    TSW
    Participant

    I have multiple forums all secured by a membership-plugin. I would like to create 1 page for all the forums and have the page as such:

    BASIC MEMBERSHIP LEVEL FORUM TITLE
    There are several forums, one each for the different facilitated group. Please note that although all forums are listed, you will only have access to the facilitated group you belong to.
    [forum a shortcode]
    [forum b shortcode]

    ADVANCED MEMBERSHIP LEVEL FORUM TITLE
    There are several forums, one each for the different facilitated group. Please note that although all forums are listed, you will only have access to the facilitated group you belong to.
    [forum c shortcode]
    [forum d shortcode]

    The appearance of the shortcode I would like to be similar to [bbp-forum-index] ….

    List the forum name (link) with (ideally) the # of topics, the # of posts, and the freshness.

    I do not want to see the detail and the box for creating a new topic on this page. The forum link to topic and reply can function as they normally do.

    Is this clear and does anyone know how I can accomplish this?

    #156467
    supremor
    Participant

    The code worked. Now is there a way to remove the text ‘FORUMS’ that was on top of the search bar?

    #156464
    supremor
    Participant

    Thanks for your help. Created the child theme and the code works great. No more dashboard. 🙂

    #156460

    In reply to: Hidden private forum

    Robin W
    Moderator

    from php 5.4 onwards php was stricter when looking at strings and arrays.

    I’ll need to correct the code to work with later php versions

    #156457
    Robin W
    Moderator

    One last thing, do I add the code via the editor or FTP?

    Either is fine, I’d tend to do it via FTP and keep ols and new versions of the function file on your PC

    And is there a tutorial on how to add a child theme?

    This is a wordpress feature

    Just google ‘wordpress creating a child theme’ or ‘wordpress creating a child theme video’ depending on whether you prefer seeing or reading

    How to Create a WordPress Child Theme

    looks a reasonable explanation

    #156455
    supremor
    Participant

    One last thing, do I add the code via the editor or FTP?

    And is there a tutorial on how to add a child theme?

    #156443
    Robin W
    Moderator

    see

    Functions files and child themes – explained !

    but basically at the end.

    #156441
    supremor
    Participant

    Where in the functions file do we add the code?

    #156431

    In reply to: Hidden private forum

    ttmt
    Participant

    Hi Robin

    I have error messages in the plugin as well next to the Activate buttons.

    Dashboard > Settings > bbp Privarte Group > General Settings:

    Under Hide topic and reply counts

    Warning: Illegal string offset 'hide_counts' in /Users/chris.dickinson/Desktop/MAMP-DocRoot/explore_ideas/src/php/wp-content/plugins/bbp-private-groups/includes/settings.php on line 414
    

    Under Show Descriptions

    Warning: Illegal string offset 'activate_descriptions' in /Users/chris.dickinson/Desktop/MAMP-DocRoot/explore_ideas/src/php/wp-content/plugins/bbp-private-groups/includes/settings.php on line 420

    Under Remove ‘Private’ prefix

    Warning: Illegal string offset 'activate_remove_private_prefix' in /Users/chris.dickinson/Desktop/MAMP-DocRoot/explore_ideas/src/php/wp-content/plugins/bbp-private-groups/includes/settings.php on line 426

    #156430
    Robin W
    Moderator

    Wish I was a team !!

    I suspect that this is how it works.

    For participant roles I can use my plugin to tightly control access.

    For moderators, originally moderators could see and moderate all forums.

    I then amended this to allow them to moderate only forums with no group set or with their group set. However this related to moderation, I have sort of presumed that moderators could see other groups and have participant rights in them, just not moderate, as it was moderation that I was controlling.

    I suspect that some users would like it as above, and others with no rights for other private forums, as you desire.

    I’ll take another look at the code to see how easy it is to change, but moderation hits into many places in the core bbpress code, and I’m not sure how easy it would be to be that flexible.

    #156427
    t3_rrY
    Participant

    Ok thanks very much for your reply and sharing your code; any idea on the use of HTML template for BBp notification?

    #156426
    Nicolas Korobochkin
    Participant

    bbPress have two types of notifications: new message in topic or new topic in forum. Functions that sends messages in bbpress/includes/common/functions.php. You can’t redeclare they. You need to remove default functions and add your custom one. Here is my working code for armyofselenagomez.com wich sends emails via external SMTP server (like Mandrill. but I use Yandex, like Gmail but in Russia). Be careful with priorities and numbers of arguments to pass.

    Logis of process:

    1. User leave a message or create a topic.
    2. Create single wp-crone task which create messages and send it.

    Positive sides of this solution: Emails sends per user (not 1 email per 100000 users like in bbPress by default). Site work faster because emails send via cron, not immediately. I dont store emails or messages to send in DB, just topic ID. Emails sends via SMTP server (not just PHP Mailer or wp_mail()).

    <?php
    function selena_network_bbp_init () {
    	/*
    	 * Оповещание о новых ответах в темах на форуме
    	 * 1. Удаляем дефолтную оповещалку.
    	 * 2. Добавляем свою оповещалку, которая создает крон-задачу.
    	 * 3. Экшн фильтр задачи, который создает письма и отправляет их.
    	 *
    	 * Функции находятся в файле
    	 * bbpress/includes/common/functions.php
    	 */
    	remove_action ('bbp_new_reply', 'bbp_notify_subscribers', 11);
    	add_action ('bbp_new_reply', 'selena_network_bbp_notify_subscribers', 11, 5);
    	add_action ('selena_network_bbp_notify_subscribers_cron', 'selena_network_bbp_notify_subscribers_callback', 10, 5);
    
    	/*
    	 * Оповещения о создании новых тем на форуме
    	 * 1. Удаляем дефолтную оповещалку.
    	 * 2. Добавляем свою оповещалку, которая создает крон-задачу.
    	 * 3. Экшн для задачи, который будет запускать крон (создает письма и отправляет их).
    	 *
    	 * Функции находятся в файле
    	 * bbpress/includes/common/functions.php
    	 */
    	remove_action ('bbp_new_topic', 'bbp_notify_forum_subscribers', 11);
    	add_action ('bbp_new_topic', 'selena_network_bbp_notify_forum_subscribers', 11, 4);
    	add_action ('selena_network_bbp_notify_forum_subscribers_cron', 'selena_network_bbp_notify_forum_subscribers_callback', 10, 4);
    }
    add_action ('bbp_init', 'selena_network_bbp_init', 99);
    <?php
    function selena_network_bbp_notify_subscribers (
    	$reply_id = 0,
    	$topic_id = 0,
    	$forum_id = 0,
    	$anonymous_data = false,
    	$reply_author = 0
    ) {
    	wp_schedule_single_event (
    		time (),
    		'selena_network_bbp_notify_subscribers_cron',
    		array (
    			$reply_id,
    			$topic_id,
    			$forum_id,
    			$anonymous_data,
    			$reply_author
    		)
    	);
    
    	return true;
    }
    
    function selena_network_bbp_notify_subscribers_callback (
    	$reply_id,
    	$topic_id,
    	$forum_id,
    	$anonymous_data,
    	$reply_author
    ) {
    	// Bail if subscriptions are turned off
    	if ( !bbp_is_subscriptions_active() ) {
    		return false;
    	}
    
    	$reply_id = bbp_get_reply_id( $reply_id );
    	$topic_id = bbp_get_topic_id( $topic_id );
    	$forum_id = bbp_get_forum_id( $forum_id );
    
    	// Bail if topic is not published
    	if ( !bbp_is_topic_published( $topic_id ) ) {
    		return false;
    	}
    
    	// Bail if reply is not published
    	if ( !bbp_is_reply_published( $reply_id ) ) {
    		return false;
    	}
    
    	// User Subscribers
    	$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 );
    
    	// 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 and setup mail data
    	$topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
    	$reply_url     = bbp_get_reply_url( $reply_id );
    
    	$subject = sprintf(
    		_x (
    			'%1$s wrote new comment in “%2$s”',
    			'%1$s = Name of user who create comment
    %2$s = Topic title in which user leave a comment',
    			'selena_network'),
    		$reply_author_name,
    		$topic_title
    	);
    	if (empty ($subject)) {
    		return;
    	}
    
    	// 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 (
    			_x (
    '%1$s wrote new comment in conversation “%2$s” %3$s.
    
    +
    Notification settings → %4$s.
    Send email at %5$s or respond on that letter if you have a questions.',
    			'%1$s = Reply author name
    %2$s = Topic title
    %3$s = Reply URL to this topic
    %4$s = Manage subscribe settings link
    %5$s = Admin email',
    			'selena_network'
    			),
    
    			$reply_author_name,
    			$topic_title,
    			$reply_url,
    			bbp_get_subscriptions_permalink ($user_id),
    			get_option ('admin_email')
    		);
    
    		if ( empty( $message ) ) {
    			continue;
    		}
    
    		wp_mail (
    			get_userdata( $user_id )->user_email,
    			$subject,
    			$message
    		);
    	}
    
    	return true;
    }
    
    /* Новая тема на форуме */
    function selena_network_bbp_notify_forum_subscribers (
    	$topic_id = 0,
    	$forum_id = 0,
    	$anonymous_data = false,
    	$topic_author = 0
    ) {
    	wp_schedule_single_event (
    		time (),
    		'selena_network_bbp_notify_forum_subscribers_cron',
    		array (
    			$topic_id,
    			$forum_id,
    			$anonymous_data,
    			$topic_author
    		)
    	);
    
    	return true;
    }
    function selena_network_bbp_notify_forum_subscribers_callback (
    	$topic_id,
    	$forum_id,
    	$anonymous_data,
    	$topic_author
    ) {
    	// Bail if subscriptions are turned off
    	if ( !bbp_is_subscriptions_active() ) {
    		return false;
    	}
    
    	$topic_id = bbp_get_topic_id( $topic_id );
    	$forum_id = bbp_get_forum_id( $forum_id );
    
    	// Get topic subscribers and bail if empty
    	$user_ids = bbp_get_forum_subscribers( $forum_id, true );
    	if ( empty( $user_ids ) ) {
    		return false;
    	}
    
    	// Bail if topic is not published
    	if ( ! bbp_is_topic_published( $topic_id ) ) {
    		return false;
    	}
    
    	// Poster name
    	$topic_author_name = bbp_get_topic_author_display_name( $topic_id );
    
    	// 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_topic_content' );
    	remove_all_filters( 'bbp_get_topic_title'   );
    
    	// Strip tags from text and setup mail data
    	$topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
    	$forum_title   = strip_tags( bbp_get_forum_title( $forum_id ) );
    	$topic_url     = get_permalink( $topic_id );
    
    	// For plugins to filter titles per reply/topic/user
    	//$subject = apply_filters( 'bbp_forum_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $topic_id, $forum_id, $user_id );
    	$subject = sprintf (
    		_x (
    			'%1$s created new conversation “%2$s”',
    			'%1$s = Topic author name who create new new topic
    %2$s = Topic title',
    			'selena_network'
    		),
    		$topic_author_name,
    		$topic_title
    	);
    	if ( empty( $subject ) ) {
    		return;
    	}
    
    	// Loop through users
    	foreach ( (array) $user_ids as $user_id ) {
    
    		// Don't send notifications to the person who made the post
    		if ( !empty( $topic_author ) && (int) $user_id === (int) $topic_author ) {
    			continue;
    		}
    
    		// For plugins to filter messages per reply/topic/user
    		$message = sprintf( _x( '%1$s created new conversation “%2$s” in the forum “%3$s” %4$s.
    
    +
    Notification settings → %5$s.
    Send email at %6$s or respond on that letter if you have a questions.',
    			'%1$s = Topic author name
    %2$s = Created topic title
    %3$s = Forum title in wich topic created
    %4$s = Link to brand new topic
    %5$s = URL to manage user subscribtions
    %6$s = Admin email',
    			'selena_network' ),
    
    			$topic_author_name, // 1
    			$topic_title, // 2
    			$forum_title, // 3
    			$topic_url, // 4
    			bbp_get_subscriptions_permalink ($user_id), // 5
    			get_option ('admin_email') // 6
    		);
    
    		if ( empty( $message ) ) {
    			continue;
    		}
    
    		// Send notification email
    		wp_mail (
    			get_userdata( $user_id )->user_email,
    			$subject,
    			$message
    		);
    	}
    
    	return true;
    }
    ?>
    #156412

    In reply to: Template

    Robkk
    Moderator

    1. heres a pretty good tutorial in the docs to style your bbPress forums with some CSS

    bbPress Styling Crib

    2. if your talking about maybe downloading some already styled templates there is none, i think bbPress standalone had this but theme compatibility makes giving away already styled templates pretty tough.

    if you actually want to see what users could create with bbPress check out some of the sites listed here

    bbpress.org/about/examples/

    3. as long as you follow this link

    codex.bbpress.org/theme-compatibility/

    you can use the templates to customize bbPress forums to your liking.

    also checking the rest of the docs wouldnt be bad too.

    codex.bbpress.org/

    #156398
    Robkk
    Moderator

    the way bbPress outputs the login page bugs me, a lot. What I am trying to do is add a login box to my layout, when I did – I found it added a list and a horrible fieldset around the whole thing. This doesn’t work with my design at all.

    are you using the shortcode [bbp-login] ??

    you should use that shortcode if not.

    more shortcodes supplied with bbPress that you can use.

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

    I found there is no template readily available to just change. Really?

    yes there is its called form-user-login.php

    So, it seems all I can do is hack away at the core code, which will all be reverted once a new version comes around.

    dont do that

    #156388
    Robin W
    Moderator

    It bugs me as well.

    Two solutions I have documented

    Layout and functionality – Examples you can use

    Layout and functionality – Examples you can use

    You can also copy the core file into your functions file, hack it and rename it. There are several places it needs renaming, and if you would like to post your working solution, I’ll happily make a functions file version, as long as I can use it publicly

    #156383
    Jake Hall
    Participant

    Hi guys,

    the way bbPress outputs the login page bugs me, a lot. What I am trying to do is add a login box to my layout, when I did – I found it added a list and a horrible fieldset around the whole thing. This doesn’t work with my design at all.

    So, on with my quest to change this, I found there is no template readily available to just change. Really? So, it seems all I can do is hack away at the core code, which will all be reverted once a new version comes around.

    Does anyone have any suggestions for this?

Viewing 25 results - 9,801 through 9,825 (of 32,505 total)
Skip to toolbar