Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,001 through 6,025 (of 32,519 total)
  • Author
    Search Results
  • #177533
    evanevans333
    Participant

    Well I appreciate the fast answer. Thanks for that. And yeah, I tried all those plugins. They no longer can reach in there and modify the Participant role. That role’s caps are apparently hard coded into the bbPress plugin itself, somewhere. I sure would like to transfer the ability that Moderator has to Participator, just on those two issues, Read_Private_Topics, Read_Private_Replies. That just makes sense, is logical, and practical. A lot of people have been posting about this, trying to make this right, for years now. We need at least a solution that works moving forward.

    The concept is, that if you set a forum to Private, it’s because you don’t want anonymous users and search engines having access to those posts. It’s not because you want to restrict registered users from seeing the content, especially if they are Participants. And if to Participate means to just POST, not reply or see topics and replies in private forums, than there needs to be a User Role with those upgraded permissions, between Moderator and Participant. Because beyond Private, there is even the Hidden permission level. And that’s good for Moderator/Admin level access, but it’s too much if you just want users to be able to see and reply (Participate) in content that is not publicly accessible by anonymous website visitors and search engines.

    Well, very well, I hope some fix comes someday. Somebody who coded bbPress needs to come up with an idea here.

    r083r7
    Participant

    I noticed that when you go to the root forum it displays all the forums to the user. Not a desired effect. I am using shortcodes and spreading my forums on different pages and some are only available to certain user roles. BUT if someone goes to the root forum they see it all.

    How would I prevent this from happening? Is there a way to maybe hide the root forum or possibly some other way to go about this.

    #177525
    Arturo
    Participant

    When using a translated bbpress, some titles in the WordPress Admin Dashboard for “Right Now in Forums” are missing. Where can I check this in the code?

    Here is a screeshot http://prnt.sc/ccs85f

    Using bbPress 2.5.10-6063

    #177522
    Bingo Bongo
    Participant

    Hi –

    (For our forums here – http://www.zetaunit.com/forums/ – W.P. V 4.5.3, using Avada 4.02)

    I see in the documentation that it is possible to replace the default bbpress wordpress template for

    the Forum Root Slug ‘Forums’

    by adding a page in WordPress called /forums/

    and then inserting the bbpress shortcode for forum archives.

    I tried this also with ‘forum’ for individual forums, and I see other Slugs available in Settings > Forum

    Single Forum Slugs

    Custom slugs for single forums, topics, replies, tags, views, and search.

    Forum
    Topic
    Topic Tag
    Topic View
    Reply
    Search

    Am I missing something, or is there a simple way to replace each of the pages used by bbpress by default, just by creating pages named e.g. ‘topic’, ‘topic-view’ etc? And then insert the relevant shortcode for that content?

    It seems like ‘it should be there’ but can’t find documentation apart from customising my child theme etc.

    Thanks in advance 🙂

    #177518
    Robin W
    Moderator

    ok – that’s great – I think I now understand

    loop-single-topic is probably not the right/only place

    but within loop single topic, you can get the ID from bbp_topic_id() which will be itself, so no need to call post parent

    Replies – that is posts in response to a topic, which is I think what you are after, are handled by loop-single-reply.php

    There each reply has an id found by using bbp_reply_id, so you would use something like

    $postimage = wp_get_post_parent_id( bbp_reply_id() ); 
    

    in your code above

    #177517
    MalMac
    Participant

    Sorry,
    I have a featured image/thumbnail attached to each forum topic.
    I would like each post, in that topic, to call that featured image as well.
    I am assuming that each topic is the parent of each post?

    so I created this function in my functions.php file

    	add_action('bbp_template_before_post', 'pym_print_featured_image_on_topic()')
    	function pym_print_featured_image_on_topic() {	
    			//get the post id of the parent
    			//$postimage = get_post( 'post_parent' );
    		if (has_post_thumbnail()) {
    			echo '<div class="pym-bbp-topic-thumbnail">';
    			echo get_the_post_thumbnail('<strong>post_parent</strong>', 'thumbnail' );
    			echo '</div>';
    		}
    	}

    Which I am then calling in side of loop-single-topic.php

    <?php do_action( ‘bbp_template_before_post’ );?>

    Thanks for your help!

    Malcolm

    #177516
    Robin W
    Moderator

    still no clearer on where this code is going, and which thumbnail you are after.. sorry I’d love to help but I’m still not understanding what you are trying to achieve.

    #177515
    MalMac
    Participant

    I am trying to grab the $post_id from the parent
    something like this?

    	function pym_print_featured_image_on_topic() {
    		if (has_post_thumbnail()) {
    			echo '<div class="pym-bbp-topic-thumbnail">';
    			echo get_the_post_thumbnail('post_parent', 'thumbnail' );
    			echo '</div>';
    		}
    #177514
    Robin W
    Moderator

    depends exactly where you are putting that code, and which thumbnail you are wanting

    get_the_post_thumbnail( $reply_id, $size, $attr );

    may well be what you want.

    Otherwise come back with where the code is going.

    #177513
    MalMac
    Participant

    I am currently using the

    get_the_post_thumbnail( $post_id, $size, $attr );

    To create a thumbnail for each topic on my forum index page.
    I would like to be able add the same thumbnail to posts within that topic.
    Can I use $post_id to reference the post topic? Is this a parent/child relationship?

    Something like?
    get_the_post_thumbnail( $topic_thumbnail);

    or
    get_the_topic_thumbnail( $post_id, $size, $attr );

    #177508
    stall20080
    Participant

    my problem is I using a page called “forums” for index [bbp-forum-index] with sidebar left.
    it works great until I click the breadcrumbs home/forums/……. to goback to forums.
    then Im getting the url version with no sidebars.

    my page details:
    forums
    siteurl/forums/

    bbpress setting no changed still

    Forum Root = forums
    Forum Prefix =ticked
    Forum root should show =forum link

    #177506
    Robkk
    Moderator

    It should work as long as your using all the CSS code I used. You can try this instead if you want. It does away with the universal selector and the > because it wasn’t really needed, it includes text to know what this code is used for, and it I added !important for the heck of it.

    /*
    This removes the whole list item 
    for every recent topic in the widget,
    this includes the "by"
    */
    .widget_display_topics li {
      visibility: hidden !important;
    }
    
    /* 
    This will make every HTML tags content in the list item 
    for every recent topics in the widget to become visible,
    this does not include the "by",
    so the "by" stays hidden
    */
    .widget_display_topics li div,
    .widget_display_topics li span,
    .widget_display_topics li a {
      visibility: visible !important;
    }
    #177505
    MalMac
    Participant

    Continuing on….

    In my themes function.php file I have the following which creates my thumbnail:

    	// /bbpress/templates/default/content-single-forum
    	add_action('bbp_template_before_single_forum', 'pym_print_featured_image_single_forum', 11);
    	add_action('bbp_template_before_single_forum', 'pym_print_forum_description', 12);
    	
    	function pym_print_featured_image_single_forum() {
    		if (has_post_thumbnail()) {
    			echo '<div class="pym-bbp-topic-thumbnail">';
    			echo get_the_post_thumbnail(null, 'thumbnail' );
    			echo '</div>';
    		}
    	}

    I have been calling this elsewhere in my template using ”

    
     <?php do_action( 'bbp_template_before_single_forum' ); ?>

    I am now trying to edit content-single-forum.php to call this thumbnail using the following:

    <?php bbp_get_template_part( 'loop', 'topics' ); ?>

    How do I go about getting the thumbnail to be called in the loop?

    Thanks, Malcolm

    #177499
    VeeLow
    Participant

    Yes, I did. (Sorry for this long delay.)

    They don’t solve the case where I am notified of my own activity, when I reply to a replier to my initial topic.

    They still fire: a new nunber 1 appears in the bubble.

    But your code does erase the text–I get a blank space where the content would appear, and if I click through the text is also invisible–in my list of notifications they appear as blank entries…

    #177498
    Stephen Edgar
    Keymaster

    Maybe try deleting any bbpress-es_ES.po files, and then get new translations by going to http://example.com/wp-admin/update-core.php and click “Update Translations”

    #177486
    ptrck_r
    Participant

    [Solved]

    If anybody hasthe same problem, I solved it by creating a small plugin out of the code so it’ll load on time.

    <?php
    /*
    Plugin Name: FilterBbRoleMap
    */
    
    if(!class_exists('FilterBbRoleMap')) {
    	class FilterBbRoleMap
    	{
    		public function __construct()
    		{
    			add_filter('bbp_get_user_role_map', 'add_spectator_role');
    			function add_spectator_role($role_map) {
    				$role_map['prefix_spectator'] = bbp_get_spectator_role();
    				return $role_map;
    			}
    		}
    	}
    
    	$FilterBbRoleMap = new FilterBbRoleMap();
    }
    #177475
    Robkk
    Moderator

    The “by” is printed in php, as displayed in this code here.

    https://github.com/ntwb/bbPress/blob/master/src/includes/common/widgets.php#L822

    There is a way to use CSS to hide the “by” though. It will look like the topic title has a little margin away from the topic authors name.

    Here is a custom CSS example.

    .widget_display_topics li {
      visibility: hidden;
    }
    
    .widget_display_topics li > * {
      visibility: visible;
    }

    There might be a way to use a plugin like Loco translate to just translate “by” to nothing also, but I have never tried that plugin before, and I am not 100% if that would even work. But it could be another possibly easy solution.

    #177474
    Robkk
    Moderator

    Robin might be on to something with the url thing. Robins suggestion works fine, but I usually suggest looking into using the Reveal IDs plugin, as it really makes it easier by just adding a column in posts like Forums > All Forums list and users list in the WordPress backend.

    https://codex.bbpress.org/getting-started/faq/#findpostid

    #177473

    In reply to: meta-single-topic

    Robkk
    Moderator

    @rateyourway

    Its a custom bbPress template file in your theme. I suggest you contact your theme developer. Maybe they can make the custom bbPress layout translatable by a few code tweaks.

    #177472
    Robkk
    Moderator

    @aviazz

    You already should have a way to view topics with no replies. By default bbPress has a feature called Views. It allows you to display topics with various different arguments. Topics with no replies should be one of the 2 default views which are Most popular topics and Topics with no replies

    You can link to the existing page using the Topic Views widget in your sidebar, or you can use a shortcode already provided by bbPress to display a view shortcode in a page and add it to a menu. You can also also instead add a custom link to a menu in the menus section in Appearance > Menus if you do not need to use a shortcode in a page.

    The widget is called the Topic Views widget that you will be able to see in Appearance > Widgets or you can manage your sidebars using the Customizer API in Appearance > Customize in the WordPress backend.

    https://codex.bbpress.org/features/widgets/

    The shortcode you would want to use is [bbp-single-view id='no-replies']

    https://codex.bbpress.org/features/shortcodes/#views

    If for some reason you may not already have the default view. See if its related to a theme/plugin function removing the default view by troubleshooting.

    Plugin Troubleshooting

    https://codex.bbpress.org/getting-started/troubleshooting/#plugins

    Theme Troubleshooting

    https://codex.bbpress.org/getting-started/troubleshooting/#themes

    If its not a theme/plugin issue we can check to see if its a possible bug causing an issue.

    #177471
    Stephen Edgar
    Keymaster

    @rateyourway The “freshness” term has been removed from bbPress 2.6 (/dev) so you will not see it in the translation files, it is still there for the current bbPress 2.5.x see:
    https://translate.wordpress.org/projects/wp-plugins/bbpress/stable/es/default?filters%5Bterm%5D=freshness&filters%5Buser_login%5D=&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filter=Filter&sort%5Bby%5D=priority&sort%5Bhow%5D=desc#

    Edit: The string may also be coming from your theme, switch themes to one of the included “Twenty” themes to double check.

    #177469
    Robin W
    Moderator

    I’ve just added that capability to one of my existing shortcodes in my style pack plugin, so if you install

    https://wordpress.org/plugins/bbp-style-pack/

    and then see

    Dashhboard>settings>bbp style pack>shortcodes for a description of how to use it in detail, but

    [bsp-display-topic-index noreply='true']

    used in a page will get you what you want

    #177457
    Robin W
    Moderator

    The correct code would be

    [bbp-single-forum id='3569159-2']

    but I suspect ‘3569159-2’ is the url not the post ID as post ID are a whole number and what you want

    so go to

    Dashboard>forums and select all forums

    If you hover of ‘edit’ of then forum you want, you’ll see at the bottom left of the screen

    url…post.php?post=12345&action=edit

    it is the 12345 that you want to put in the shortcode

    #177455
    smartIt
    Participant

    Hi,
    I created a forum, his id is 3569159-2 and it contains one topic.

    in this page of my website http://radiotounsi.com/?page_id=4862
    I tried to display this forum by using the shortcode [bbp-single-forum id=$3569159-2] but nothing is displayed, but other bbpress shortcodes work just fine like [bbp-forum-index] and [bbp-login]
    I switched the theme to twenty sixteen for testing purpose, same problem

    #177453
    epretorious
    Participant

    This may be easier than I’d thought:

    [root@cp bbpress]# grep -r 'You must be logged in' *
    languages/bbpress.pot:msgid "You must be logged in to create new forums."
    languages/bbpress.pot:msgid "You must be logged in to reply to this topic."
    languages/bbpress.pot:msgid "You must be logged in to create new topics."
    templates/default/bbpress/form-forum.php:			<p><?php is_user_logged_in() ? _e( 'You cannot create new forums.', 'bbpress' ) : _e( 'You must be logged in to create new forums.', 'bbpress' ); ?></p>
    templates/default/bbpress/form-topic.php:			<p><?php is_user_logged_in() ? _e( 'You cannot create new topics.', 'bbpress' ) : _e( 'You must be logged in to create new topics.', 'bbpress' ); ?></p>
    templates/default/bbpress/form-reply.php:			<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>

    What’s the “best practice” for modifying the languages file? Is that something that I can achieve with a child theme?

    TIA,
    Eric Pretorious
    Portland, OR

Viewing 25 results - 6,001 through 6,025 (of 32,519 total)
Skip to toolbar