Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 401 through 425 (of 32,294 total)
  • Author
    Search Results
  • #236955

    In reply to: Prevent topic replies

    newtech1
    Participant

    Are you saying to replace the existing code in form-reply.php just with this code? If so my forum page is ‘page not found’.

    <?php
    
    /**
     * New/Edit reply
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;

    I believe this shoudk end with
    <?
    but it still does not work.

    #236954
    newtech1
    Participant

    Are you saying that I am to replace all of the code in form-topic.php with just this code:
    `<?php

    /**
    * New/Edit Topic
    *
    * @package bbPress
    * @subpackage Theme
    */

    // Exit if accessed directly
    defined( ‘ABSPATH’ ) || exit;

    if ( ! bbp_is_single_forum() ) : ?>

    <div id=”bbpress-forums” class=”bbpress-wrapper”>

    </div>

    <?php endif;’

    If so the when I go to my forum page it says ‘page not found’.

    #236953

    In reply to: Prevent topic replies

    Robin W
    Moderator

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php

    transfer this to your pc and edit

    make the file read

    <?php
    
    /**
     * New/Edit reply
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

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

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-reply.php

    bbPress will now use this template instead of the original

    #236951
    Robin W
    Moderator

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php

    transfer this to your pc and edit

    make the file read

    <?php
    
    /**
     * New/Edit Topic
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;
    
    if ( ! bbp_is_single_forum() ) : ?>
    
    <div id="bbpress-forums" class="bbpress-wrapper">
    
    	
    
    </div>
    
    <?php endif;

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

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

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-topic.php

    bbPress will now use this template instead of the original

    #236949

    In reply to: Prevent topic replies

    newtech1
    Participant

    I need to clarify. I do not want the reply option to appear anywhere in the forum. I do not want the option for replies-just turn off the reply feature.

    If I cannot turn off the reply form what file do I go into to remove the code for the reply form so it does not show up?

    The problem with making topic closed is it greys out the topic title. I do not want the title to grey out. So if I cannot remove the reply form someway how can I prevent the title from turning grey when closed?

    closed topic

    #236948
    newtech1
    Participant

    I do not want anyone, including members, to be able to post topics on the frontend of the forum, just through backdoor. How do I remove that option? It appears the code is form-forum.php file but cannot determine what code I need to remove. What I have tried keeps giving me ‘page not found’.remove front end posting

    #236946

    In reply to: a user login problem

    Passepoil
    Participant

    Hello Robin,
    Yes, the site is under development.
    I’m thinking of creating a specific button for logging into the account and redirecting the Internet user to the home page afterwards.
    I realized that the connection was done well by changing the page afterwards but not on the page where the widget is installed.
    Maybe there is a trick (php code in functions.php) to work around this problem?
    Thanks for your help.

    #236932
    Robin W
    Moderator

    you’re close !!

    Untested, but try

    add_filter('bbp_topic_admin_links', 'rew_no_trash_topic_except_own', 10, 2);
    add_filter('bbp_reply_admin_links', 'rew_no_trash_reply_except_own', 10, 2);
    
    function rew_no_trash_topic_except_own ($links, $topic_id) {
        if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_topic_author_id( $topic_id )) {
    			unset($links['trash']);
    		} 
    	
        return $links;
    }
    
    function rew_no_trash_reply_except_own ($links, $reply_id) {
        if (!bbp_is_user_keymaster() && get_current_user_id() != bbp_get_reply_author_id( $reply_id )) {
    			unset($links['trash']);
    		} 
    	
        return $links;
    }
    #236931
    enkoes
    Participant

    Today tried testing this very ‘rough’ piece of code, failed hopelessly with my very limited knowledge of coding:

    add_filter('bbp_topic_admin_links', 'rew_no_trash_except_own', 10, 2);
    add_filter('bbp_reply_admin_links', 'rew_no_trash_except_own', 10, 2);
    
    function rew_no_trash_except_own ($links, $topic_id) {
        if (!bbp_is_user_keymaster() && !bbp_is_topic_author(get_current_user_id(), $topic_id)) {
            unset($links['trash']);
        }
        return $links;
    }

    I think the direction is somewhat correct. Hope to get expert guide on this issue.

    Regards.

    #236868
    enkoes
    Participant

    Hi, good day!

    How can we come up with a code so that moderators can only trash his OWN topic/reply but not those posted by others? i.e. to hide admin link “bin” for topic/reply posted by others but display “bin” for his own (as moderator) post.

    Regards.

    #236865
    Robin W
    Moderator
    add_filter ('bbp_get_title_max_length' , 'rew_change_length') ;
    
    function rew_change_length () {
    	$length = 160 ;
    return $length ;
    }

    so change length to whatever number 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

    #236860
    Robin W
    Moderator

    If you know enough to FTP a file, then

    find
    wp-content/plugins/bbpress/templates/default/bbpress/user-details.php

    transfer this to your pc and edit

    remove lines 72-76 ie these :

    <li class="<?php if ( bbp_is_single_user_edit() ) :?>current<?php endif; ?>">
    					<span class="bbp-user-edit-link">
    						<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 esc_html_e( 'Edit', 'bbpress' ); ?></a>
    					</span>
    				</li>

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

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

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/user-details.php

    bbPress will now use this template instead of the original

    #236859
    Robin W
    Moderator

    The way subscriptions works has changed

    use this code now :

    add_filter ('bbp_before_get_user_subscribe_link_parse_args' , 'change_subscribe') ;
    
    function change_subscribe ($args) {
    	$post_id = $args['object_id']  ;
    	if (bbp_is_topic( $post_id )) $text = 'topic' ;
    	if (bbp_is_forum( $post_id )) $text = 'forum' ;
    	$args['subscribe'] = 'Subscribe to this '.$text ;
    	$args['unsubscribe'] = 'Unsubscribe' ;
    return $args ;
    }
    #236858
    Robin W
    Moderator

    The way subscriptions works has changed

    use this code now :

    add_filter ('bbp_before_get_user_subscribe_link_parse_args' , 'change_subscribe') ;
    
    function change_subscribe ($args) {
    	$post_id = $args['object_id']  ;
    	if (bbp_is_topic( $post_id )) $text = 'topic' ;
    	if (bbp_is_forum( $post_id )) $text = 'forum' ;
    	$args['subscribe'] = 'Subscribe to this '.$text ;
    	$args['unsubscribe'] = 'Unsubscribe' ;
    return $args ;
    }
    #236855
    enkoes
    Participant

    Hi, I’m using the code below to change text of topic subscription link (referring to this topic)

    add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_topic_subscribe') ;
    
    function change_topic_subscribe ($args) {
    	$args['subscribe'] = 'Subscribe to this topic' ;
    	$args['unsubscribe'] = 'Unsubscribe' ;
    return $args ;
    }

    But it does not work in forum subscription text:

    add_filter ('bbp_before_get_forum_subscribe_link_parse_args' , 'change_forum_subscribe') ;
    
    function change_forum_subscribe ($args) {
    	$args['subscribe'] = 'Subscribe to this forum' ;
    	$args['unsubscribe'] = 'Unsubscribe' ;
    return $args ;
    }

    Anyone can guide me on this?

    Regards.

    #236806
    newtech1
    Participant

    I found a code that works when inserted into …/wp-content/plugins/bbpress/templates/default/bbpress

    <h6>Date: <?php the_field( ‘date’ ) ; ?></h6>
    <h6>Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?></h6>
    <h6>Speed: <?php the_field( ‘speed’ ) ; ?></h6>

    But it only displays if put in certain areas. Here is the closet area it displays to the topic content.

    <?php bbp_single_topic_description(); ?>
    <h6>Date: <?php the_field( ‘date’ ) ; ?></h6>
    <h6>Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?></h6>
    <h6>Speed: <?php the_field( ‘speed’ ) ; ?></h6>
    <h6>Water Features: <?php the_field( ‘water_features’ ) ; ?></h6>
    <h6>Lure & Color: <?php the_field( ‘lure_color’ ) ; ?></h6>

    <?php if ( bbp_show_lead_topic() ) : ?>

    <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>

    I have tried putting it below either of these items and it will not dislay in the frontend.

    <?php if ( bbp_show_lead_topic() ) : ?>

    <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?

    From what I can tell the code actually needs to be inserted in the single-topic-lead. I have tired inserting it everywhere within the single-topic-lead.php page but no matter where I put it, it does not show up. Here is where I think it needs to go:

    <?php bbp_topic_author_link( array( ‘show_role’ => true ) ); ?>

    <?php if ( current_user_can( ‘moderate’, bbp_get_reply_id() ) ) : ?>

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

    <div class=”bbp-topic-ip”><?php bbp_author_ip( bbp_get_topic_id() ); ?></div>

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

    <?php endif; ?>

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

    </div><!– .bbp-topic-author –>

    <div class=”bbp-topic-content”>

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

    <?php bbp_topic_content(); ?>
    <h6>Date: <?php the_field( ‘date’ ) ; ?></h6>
    <h6>Fish Caught: <?php the_field( ‘fish_caught’ ) ; ?></h6>
    <h6>Speed: <?php the_field( ‘speed’ ) ; ?></h6>
    <h6>Water Features: <?php the_field( ‘water_features’ ) ; ?></h6>
    <h6>Lure & Color: <?php the_field( ‘lure_color’ ) ; ?></h6>
    <?php do_action( ‘bbp_theme_after_topic_content’ ); ?>
    </div><!– .bbp-topic-content –>
    </div><!– #post-<?php bbp_topic_id(); ?> –>

    NOTE: What is strange is that if I delete the content-single-topic-lead.php file to make sure the page is not cached, it does not break the topic post which makes no sense to me.

    Here is the actual topics page:https://thedoverfamily.com/gfwc/forums/topic/last-try/

    #236805
    newtech1
    Participant

    The code you gave me to insert into functions.php causes a fatal crash.

    #236799
    newtech1
    Participant

    A. I am getting to a fix to custom fields showing up in frontend on forum topics.
    Here is a code that is working to an extent.

    <h2>Anglers: <?php the_field(‘anglers’) ; ?></h2>

    If I go to content-single-topic.php and I insert in either of these thre places it shows up in the frontend:

    <?php else : ?>
    <h2><?php the_field(‘anglers’) ; ?></h2>

    <?php bbp_topic_tag_list(); ?>
    <h2><?php the_field(‘anglers’) ; ?></h2>
    <?php bbp_single_topic_description(); ?>
    <h2><?php the_field(‘anglers’) ; ?></h2>
    <?php if ( bbp_show_lead_topic() ) : ?>
    <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>
    <?php endif; ?>

    If I put the code after <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> it does not show up.

    B. After reviewing this code in content-single-topic.php, It appears I need to enter my custom field code in the single-topic-lead’ file. The reason I know this is if I delete

    <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?>

    in content-single-topic.php I ‘break’ the topic post page. However, to verify that I need to enter my custom field code into content-single-topic-lead.php I deleted the file from the server. Much to my surprise the topic content still shows up on the topic page. How can that be. I have cleared cache on my browser, tried different browsers, different computers and get same results. Any ideas?

    #236796
    newtech1
    Participant

    I have added the following code into content-single-topic.php and the custom field does not show up in the topic contents on the front end.

    <div class=”acf-view acf-view–id–151 acf-view–object-id–{object-id}”>

    <!–$anglers$–>
    <div class=”acf-view__row acf-view__anglers”>
    <div class=”acf-view__label”>Anglers</div>
    <div class=”acf-view__field”>$anglers$</div>
    </div>
    <!–$anglers$–>
    </div>

    [acf_views view-id=”151″ name=”Anglers”]

    [acf_views view-id=”151″ object-id=”ANOTHER_POST_ID” name=”Anglers”]

    #236795
    newtech1
    Participant

    From what I can tell it looks like this is the file I need to edit:
    content-single-topic.php
    But when I put the following code, nothing show ups on the frontend.

    echo ‘Anglers: ‘ .get_field( ‘anglers’ );
    echo ‘<br>Catch Date: ‘ .get_field( ‘date’ );
    echo ‘<br>Time of Day: ‘ .get_field( ‘time’ );

    Is this for sure the file that needs to be edited to show custom fields on the frontend?
    If so, anybody have any idea of what code I should use? Again ACH says they do support other plugins so they will not help me out.

    #236794
    newtech1
    Participant

    I am wanting custom fields to show up when a user posts a topic in the forum. I am using ACF because it is suppose to be compatible with bbpress. The support team tells me I must contact bbpress for my current issue.

    I have uses ACF plugin to create custom fields. On the backend the custom fields show up if a user posts a new topic in the backend. The custom fields do not show up if the user posts a new topic in the frontend. Even though the custom fields show up in the backend, when the user posts the topic, the custom fields do not show up in the frontend. (I know the following code is correct because the custom fields will show up on the page in the frontend.

    Here is the code for the custom fields to display on front end:

    echo ‘Anglers: ‘ .get_field( ‘anglers’ );
    echo ‘<br>Catch Date: ‘ .get_field( ‘date’ );
    echo ‘<br>Time of Day: ‘ .get_field( ‘time’ );

    Questions:
    A. What bbpress file do I enter this into so it will show up on the frontend of a topic?
    B. What bbpress file do I enter this into so it will show when a user posts a new topic on the frontend, not the backend?

    #236792
    newtech1
    Participant

    Did you figure out how to put custom fields within each topic post? I am trying to do so using the ACF plugin. Thus far I have been able to use ACF to put custom fields when a user logins and goes to dashboard post a topic. BUT I cannot get their answers to display within the frontend.

    Here is the code but (I know it is correct because it will show up if I enter it in the page.php. Just do not know what forum page to insert code.

    echo ‘Anglers: ‘ .get_field( ‘anglers’ );
    echo ‘<br>Catch Date: ‘ .get_field( ‘date’ );
    echo ‘<br>Time of Day: ‘ .get_field( ‘time’ );
    echo ‘<br>Fish Caught: ‘ .get_field( ‘fish_caught’ );
    echo ‘<br>Lake Point MarkerMarker: ‘ .get_field( ‘lake_point_marker’ );
    echo ‘<br>Water Features: ‘ .get_field( ‘water_features’ );
    echo ‘<br>Speed: ‘ .get_field( ‘speed’ );
    echo ‘<br>Fish Depth: ‘ .get_field( ‘fish_depth’ );
    echo ‘<br>Lake Depth: ‘ .get_field( ‘lake_depth’ );
    echo ‘<br>Method Used: ‘ .get_field( ‘method_used’ );
    echo ‘<br>Lures & colors: ‘ .get_field( ‘lure_color’ );

    #236791
    Robin W
    Moderator

    so what is the code that does this?

    #236783
    StudentFilmmakers
    Participant

    I am trying to move my site off Buddyboss back to buddypress and bbpress. I can’t get all my forums to show from my groups on my forums page. Also, it’s a bit strange that it will only post 8 forums on the page. I can get forums to show if I change the order of the forums in the forum list, but it will remove the last forum on the list so that there are only 8. Does anyone have any tips and resetting the code, core or getting it to work? It’s on a staging site so I can try different things. Any help is appreciated.

    #236780
    Robin W
    Moderator

    I just rescued the ‘unread’ part of someone else’s plugin into style pack when it became too old in the main plugins. I only looked at the code in enough detail to get it working in style pack.

    If pencil unread does what you want, then use it.

    Also, the plugin bbpress pencil unread had a very useful option that marked all post shared before the date of register as read. Which makes sense by the way.

    And, why there isn’t an option where we can choose where to have the unread icon?

    Like many plugin authors, I’m just a guy who writes free code for the challenge and enjoyment. It would take a day of my life to code those changes, so whilst I agree that they might be useful, I have to find enough fun to do this. At the moment it’s not a change I am planning, sorry 🙁

Viewing 25 results - 401 through 425 (of 32,294 total)
Skip to toolbar