Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,151 through 1,175 (of 32,480 total)
  • Author
    Search Results
  • #229022
    Robin W
    Moderator

    do you mean access to the forums on the front end ?

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

    item 3

    You really don’t want to give access at the backend – bbpress is simply not designed to work that way !

    Steveorevo
    Participant

    Very nice work with the style pack Robin! I do have one issue with Mega Max menu compatibility. For whatever reason, it doesn’t look like shortcodes are being processed when style pack is activated (which is how MegaMax allows menus to be embedded).

    Otherwise I’d recommend your style pack for bbPress users as this “simply works” to deliver the forum styling to Twenty Twenty Two without having to painfully apply one’s own CSS rules to make it marginally pretty.

    For those willing to go that far, I found that simply adding a basic, default template page as described on WordPress.org will do the trick. Supposedly block editor doesn’t care for/use PHP template pages anymore so it’s otherwise ignored.

    For simplicity, I just replace Twenty Twenty Two’s otherwise empty index.php with the “skinny” template index.php I created here:

    https://gist.github.com/Steveorevo/96d8015bcf353221e1cf0cd6b89bb766

    #229003
    Robin W
    Moderator

    thanks, just had a look on my test site.

    The first hat image I uploaded displays as

    <img src="https://i0.wp.com/santarosaphotographicsociety.org/wp-content/uploads/hm_bbpui/2765/dccxo3aalx9pf5qhw9w5scfhksqpwcb1.jpg" alt="picture">

    so will load at the size of the web page.

    On your site it displays as

    <img src="https://i0.wp.com/santarosaphotographicsociety.org/wp-content/uploads/hm_bbpui/2765/dccxo3aalx9pf5qhw9w5scfhksqpwcb1.jpg?w=474&ssl=1" alt="Hats" width="473" height="316">

    It is uploading as full size, so something, maybe your theme or a wordpress setting is limiting it’s display.

    I’m not sure if those width details are being saved as part of the post saved in the database, or are added in displaying.

    you might also look at

    dashboard>settings>media

    #228970
    rcotwunite
    Participant

    Hello all,

    I’m working in PHP in WordPress. I’m comfortable modifying and editing code.

    I have a collection of Musical Artists and their releases. I’ve created a topic for each artist (post type) and release (post type) using bbPress Topics For Posts.

    The user then replies to the topic. I want them to be forced to choose a tag when they reply: “Buy”, “Sell”, or “Info”.

    Then I want them to be able to click a button that only shows replies tagged “Buy”, “Sell”, or “Info”.

    How do I create a button to filter replies in PHP? Thanks!

    Here’s an example of an artist page with a discussion forum below

    #228937
    Robin W
    Moderator

    also try

    .bbp-search-form input[type="submit"] {
      float: none !important;
    #228936
    Robin W
    Moderator

    maybe this is closer, not quite right order

    li.bbp-forum-info, li.bbp-topic-title {
    	float: right !important;
    	text-align: right !important ;
    
    }
    #228930
    Robin W
    Moderator

    ok, I think you have fixed the title

    For the breadcrumbs add this to your css

    .site-breadcrumbs, #top-bar-social.top-bar-right, #searchform-dropdown, .current-shop-items-dropdown {
      right: 0 !important;
      left: 0; !important
    #228927
    Robin W
    Moderator

    I doubt this can be solved as posted without custom code.

    You can import files using

    GD bbPress Attachments

    It would be possible to add some fields to the topic and or reply fields – this article explains the principals.

    https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/

    Whilst it talks about the functions file, you can also use code snipetts

    Code Snippets

    so for instance if you wanted to try their code you would put all this into a single code snippet

    add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields');
    function bbp_extra_fields() {
       $value = get_post_meta( bbp_get_topic_id(), 'bbp_extra_field1', true);
       echo '<label for="bbp_extra_field1">Extra Field 1</label><br>';
       echo "<input type='text' name='bbp_extra_field1' value='".$value."'>";
    
       $value = get_post_meta( bbp_get_topic_id(), 'bbp_extra_field2', true);
       echo '<label for="bbp_extra_field1">Extra Field 2</label><br>';
       echo "<input type='text' name='bbp_extra_field2' value='".$value."'>";
    }
    add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );
    
    function bbp_save_extra_fields($topic_id=0) {
      if (isset($_POST) && $_POST['bbp_extra_field1']!='')
        update_post_meta( $topic_id, 'bbp_extra_field1', $_POST['bbp_extra_field1'] );
      if (isset($_POST) && $_POST['bbp_extra_field1']!='')
        update_post_meta( $topic_id, 'bbp_extra_field1', $_POST['bbp_extra_field2'] );
    }
    add_action('bbp_template_before_replies_loop', 'bbp_show_extra_fields');
    function bbp_show_extra_fields() {
      $topic_id = bbp_get_topic_id();
      $value1 = get_post_meta( $topic_id, 'bbp_extra_field1', true);
      $value2 = get_post_meta( $topic_id, 'bbp_extra_field2', true);
      echo "Field 1: ".$value1."<br>";
      echo "Field 2: ".$value2."<br>";
    }

    There are reply equivalents, but would need you to specify what should go into topic and what reply

    #228926
    Robin W
    Moderator

    This might be the same as you are saying you don’t want – the user can press the submit, but it returns an error. As close as you’ll get without some js.

    function rew_min_length ($reply_content) {
    	if (strlen($reply_content)<500) {
    		bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be at least 500 characters.', 'bbpress' ) );
    	}
    return $reply_content ;
    }
    
    add_filter( 'bbp_new_reply_pre_content', 'rew_min_length' );
    #228896
    Robin W
    Moderator
    #228891
    Robin W
    Moderator

    creating a link within the forum can be done with a hook to the code quite easily.

    The problem would be knowing what course sent the user to the forum, it may well be a parameter in the learndash course database (eg this course has this forum), but beyond free help to work out.

    Contact me via http://www.rewweb.co.uk/contact-me/ if you want me to look.

    #228846
    Satish
    Participant

    Thank you ..

    The issue was with SEO plugins Yoast SEO.

    If anyone else facing similar issue, you can disable breadcrumbs from Yoast SEO:
    /wp-admin/admin.php?page=wpseo_titles#top#breadcrumbs

    Thanks a lot for all the help @robin-w

    #228781
    uisneach
    Participant

    Hi,
    I’m using WordPress 5.9.3 and bbPress 2.6.9.
    I have checked the option for “Allow users to subscribe to forums and topics” in the bbPress settings. However, I don’t see the Subscribe/Unsubscribe button/link above a Forum. I do see the option to subscribe to a Topic when replying to a topic. I’ve tried viewing the forum while logged in with different user roles including Administrator but still no joy.

    I have even tried creating my own shortcodes to try and output the subscribe link but it doesn’t output anything. e.g. while in the loop, bbp_forum_subscription_link( array( ‘before’ => ”, ‘subscribe’ => ‘+’, ‘unsubscribe’ => ‘×’ ) )

    Is there something I’m missing?

    #228749
    maestromike1977
    Participant

    Hi, I’m using Buddyboss theme, and when a user creates a group with a forum, I need the forum to have by default certain topics set up, eg. ‘Rules’, ‘General Chat’ etc (so me/user doesn’t need to set these topics up every time a group is created). Not sure how to code this, any help appreciated, thanks!

    #228747
    Viswa RJ
    Participant

    Hi,

    As said earlier, I have tried installing the bbpress in a demo wordpress domain. With bbPress, I installed and activated only

    1. Advanced Editor Tools (previously TinyMCE Advanced),
    2. Classic Editor,
    3. Highlighting Code Block

    plugins. Created sample forums with few topics. Later, I have created a username and logged in as a participant and tried to post the same topic and reply (Nothing changed). Topic got posted, it never shown any error such as Duplicate topic detected or Duplicate reply detected. At the end of the slug, it has added -2 and got posted as topic-name-2.

    Please help me resolve this issue AEAP.

    #228725
    Robin W
    Moderator

    This code should do it

    add_filter ('bbp_current_user_can_access_create_topic_form' , 'rew_only_one_topic', 10 , 1) ;
    add_filter( 'gettext', 'rew_change_text', 20, 3 );
    
    function rew_only_one_topic ($retval) {
    	//first check if they have access, only amend if they have
    	if ($retval==true) {
    		$user_id = wp_get_current_user()->ID;
    		$role = bbp_get_user_role( $user_id );
    		if ($role == 'bbp_participant') {
    		$last_posted = bbp_get_user_last_posted( $user_id );
    		if (time() <($last_posted + (60*60*24*31))) $retval = false ;
    		}
    	}
    	return $retval ;
    }
    
    function rew_change_text($translated_text, $text, $domain ) {
    	if ( $text == 'You cannot create new topics.') {
    		$user_id = wp_get_current_user()->ID;
    		$role = bbp_get_user_role( $user_id );
    		if ($role == 'bbp_participant') {
    			$last_posted = bbp_get_user_last_posted( $user_id );
    			if (time() <($last_posted + (60*60*24*31))) {
    				$translated_text = 'You cannot post a new topic - you have already posted a topic in the last month';
    			}
    		}
    	}
    	return $translated_text;
    }

    The 60*60*24*31 is 60 seconds, 60 minutes, 24 hours, 31 days, so you can change this to whatever you want in both places.

    and you can change $translated_text = ‘You cannot post a new topic – you have already posted a topic in the last month’ to whatever phrase in whatever language you want.

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #228714
    Robin W
    Moderator

    untested, but this should do it

    add_filter( 'bbp_new_topic_redirect_to', 'rew_forum_redirect_topic' , 10 ,3 ) ;
    add_filter( 'bbp_new_reply_redirect_to', 'rew_forum_redirect_reply' , 10 ,3 ) ;
    
    function rew_forum_redirect_topic ($redirect_url, $redirect_to, $topic_id ){
    	$redirect_url = 'http://mysite.fr/newsfeed' ;
    return $redirect_url ;
    
    }
    
    function rew_forum_redirect_reply ($redirect_url, $redirect_to, $reply_id ){
    	$redirect_url = 'http://mysite.fr/newsfeed';
    return $redirect_url ;
    
    }
    #228667
    sruddy
    Participant

    for now the forums are on a page that’s not full width, and they share the space with a sidebar. Until I redevelop the site with new theme, and format, I would like the images to open their full size when clicked. Is this possible with a setting or some code?

    #228639
    Robin W
    Moderator

    when I setup custom Profile Fields

    ok, sorry to keep asking questions, but it will hopefully get me to the stage when I can give an answer 🙂

    so this is bbpress profile – yes?

    and how are you setting up custom profile fields? – code, plugin, template change etc.?

    #228571
    sruddy
    Participant

    So I guess I’m not understanding how this all works. The website is a photography club and is wordpress.org. I just added this bbPress forum plugin and have all the forums set up. I’m ready to test with two other people. I now need to have a place were the two others can register, I then want an email so I can review and approve them. How do i accomplish this? After that I think the login page with the shortcode provided by Robin W should work.

    #228560
    sruddy
    Participant

    I tried the shortcode on a new page named login. Looks the same as the login page I use to administer the site. So I guess I need a forum registration page first, then during registration I think I can make it so forum members can only see the website and forums??

    #228549

    In reply to: identify user with @

    Robin W
    Moderator

    I wish I could claim some credit – it was some code I found somewhere !

    From looking at the code, I’m presuming that bp has that functionality somewhere else – this just seems to add it for topics/replies.

    ankskv1
    Participant

    I am getting blank pages while opening topics and I am using TwentyTwentyTwo theme.
    I have used forum index short-code to show the forum on the page.

    And the forum index page is showing index at very small size can I increase that without changing theme? (Any suggestions on this)

    Website: https://coolguy.x10.mx/tcin/forum/

    #228539
    Robin W
    Moderator

    site login is fine.

    I tend to create a page – say aclled ‘login’ with this as the shortcode

    [bbp-login]

    and then have that page’s url as the one I send to users

    #228528

    In reply to: identify user with @

    carasse64
    Participant

    Thank you @mike80222. I have read an old topic on this forum where someone had created with feature with lines of code. I have to find it again 🙂

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