Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,801 through 2,825 (of 32,453 total)
  • Author
    Search Results
  • Chuckie
    Participant

    I was told that :

    https%3A%2F%2Fwww.publictalksoftware.co.uk%2Fxxx%2F%3Ftopic%3Dthis-is-a-test%26paged%3D3%23post-5572

    is not a very “pretty” link. I don’t rightly know. But how is this url created? Does bbPress format it like this?

    I tried deactivating everything except bbpress and the links were still like that.

    In short, is this by design?

    #210706
    Robin W
    Moderator

    no I can’t – you would need code to create the ability to upload a csv file into bbpress – and that is beyond free help

    #210690
    Robin W
    Moderator

    newer versions of php no longer like that code – use this

    add_filter( 'bbp_get_user_edit_profile_url', 'rew_redirect');
    
    function rew_redirect () {
    $url = 'https://www.facebook.com/' ;
    return $url ;
    }
    #210688
    David13_13
    Participant

    Hey!

    I’ve used this code in my child theme functions.php:

    add_filter( 'bbp_get_user_edit_profile_url', 'http://example.com');
    

    But it doesnt work, if I now click “Edit” it does nothing instead of go to example.com

    Thanks

    #210680
    Ellis Benus
    Participant

    I did something very similar to what you suggested. I hadn’t found the ‘bbp_new_reply_post_extras’ action so I tied it into wp_insert_post.

    I added a drop-menu/select field inside form-reply.php which I’m able to then access the data through the $_POST['d20_char'] variable in the wp_insert_post action.

    I’m populating that select box by simply running a wp_query and selecting all the CPT Characters and populating them. I will eventually limit that list of Characters based on a User’s role, and who the author of the Character is. DMs can post as Player’s Characters, and players can post as more than 1 character. (I’m not sure yet how I’m going to allow other people to use the website with their players and character lists, but I’ll cross that bridge some day in the future)

    Below is the really rudimentary version of my code. I will be adding a $post->post-type check to make sure I will then only the run code if a reply is being created, and also a check to make sure the POST data I’m looking for is present.

    function rpg_bbp_new_topic_handler( $post_id , $post , $update ) {
    	
    	update_post_meta( $post_id , 'd20_char' , $_POST['d20_char'] );
    	
    } add_action( 'wp_insert_post', 'rpg_bbp_new_topic_handler', 10, 3 );
    #210673
    Robin W
    Moderator

    I did some thinking around this last night.

    Basically bbpress looks for an author ID in the posts table.

    Now there’s a hook in the topic/reply handlers (topic for topics, reply for replies, so they mirror) after a topic/reply is created.

    do_action( ‘bbp_new_reply_post_extras’, $reply_id );

    so if each of your characters has a WordPress user ID, then you could just hook to this, and change the post author to the worpress user ID.

    so say

    add_action ('bbp_new_reply_post_extras' , 'your function') ;
    
    function your_function ($reply_id) {
    $id = [either use the $_POST if still available and maybe have the value as the WordPress user ID , or get_post_meta for d20_character in the reply_id and do a look up to translate value to WordPress user ID]
    $my_post = array(
          'ID'           =>$reply_id,
          'post_author'   => $id,
          );
     
    // Update the post into the database
      wp_update_post( $my_post );
    
    }

    that way each topic/reply has a real author that happens to be your character chosen in the topic/reply form.
    that would save a ton of coding in the output, and risk of missing one and exposing the real user.

    #210639
    Robin W
    Moderator

    nothing exists as far as I know. Like everything it could be coded, but beyond free help.

    Robin W
    Moderator

    ok, this may or may nogt work

    can you download this file

    RSS Test

    and then open it and paste the contents into code snippets ion the php/code section

    then let me know if it does anything (at all!!)

    Robin W
    Moderator

    ok, let me play with some code and come back

    Lars Henriksen
    Participant

    Hi Robin

    Thanks for answering.
    If ‘technical’ means able to fiddle with readymade code snippets, then yes.
    If it means actual coding skills, the no 🙂

    Lars

    #210592

    In reply to: removing the sidebar

    Robin W
    Moderator

    one of the most annoying things in bbpress and a regular topic !

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

    item 8 is your starting point

    come back if you need further help

    #210586

    In reply to: Rename heading?

    Robin W
    Moderator

    create a page called ‘whatever’ and put the code
    [bbp-forum-index]

    in it

    foren will become ‘whatever’

    #210557
    wilc097
    Participant

    I’m sorry , it does not indeed.

    Edit: I’m sorry, I now understand the 3 and the 10 are add_filter inputs to set priority and number of arguments…

    Your code works, thanks a lot. I have been to fast in my replies without proper testing.

    #210554
    wilc097
    Participant

    I have been looking at the function more closely, and think the correct code is as follows:

    add_filter ('bbp_get_reply_position' , 'rew_redo_reply_position') ;
    
    function rew_redo_reply_position ($reply_id=0, $topic_id=0) {
    	// Get required data
    	$reply_id       = bbp_get_reply_id( $reply_id );
    
    			// Get topic ID
    			$topic_id = ! empty( $topic_id )
    					? bbp_get_topic_id( $topic_id )
    					: bbp_get_reply_topic_id( $reply_id );
    
    			// Post is not the topic
    			if ( $reply_id !== $topic_id ) {
    					$reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id );
    
    					// Update the reply position in the posts table so we'll never have
    					// to hit the DB again.
    					if ( ! empty( $reply_position ) ) {
    							bbp_update_reply_position( $reply_id, $reply_position );
    					}
    
    			// Topic's position is always 0
    			} else {
    					$reply_position = 0;
    			}
    
    	// Bump the position by one if the topic is included in the reply loop
    	if ( ! bbp_show_lead_topic() ) {
    			$reply_position++;
    	}
    
    	// Filter & return
    	return (int) apply_filters( 'rew_redo_reply_position', $reply_id, $topic_id );
    }
    #210549
    Robin W
    Moderator

    yes, the function seems to look up the reply position and if it exists, does not change it

    Put this in your child theme’s function file – or use

    Code Snippets

    add_filter ('bbp_get_reply_position' , 'rew_redo_reply_position', 10 , 3 ) ;
    
    function rew_redo_reply_position ($reply_position, $reply_id, $topic_id) {
    		// Get required data
    		$reply_id       = bbp_get_reply_id( $reply_id );
    		
    			// Get topic ID
    			$topic_id = ! empty( $topic_id )
    				? bbp_get_topic_id( $topic_id )
    				: bbp_get_reply_topic_id( $reply_id );
    
    			// Post is not the topic
    			if ( $reply_id !== $topic_id ) {
    				$reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id );
    
    				// Update the reply position in the posts table so we'll never have
    				// to hit the DB again.
    				if ( ! empty( $reply_position ) ) {
    					bbp_update_reply_position( $reply_id, $reply_position );
    				}
    
    			// Topic's position is always 0
    			} else {
    				$reply_position = 0;
    			}
    		
    
    		// Bump the position by one if the topic is included in the reply loop
    		if ( ! bbp_show_lead_topic() ) {
    			$reply_position++;
    		}
    
    		// Filter & return
    		return (int) apply_filters( 'rew_redo_reply_position', $reply_position, $reply_id, $topic_id );
    	}

    and come back with whether that fixes, it may not retro fix, so you may need to delete another reply to get it to work.

    #210539

    In reply to: Tag html

    Robin W
    Moderator

    no not that file, the functions file in your child theme. If you don’t have a child theme, or don’t know what that means, use the code snippets plugin.

    #210537

    In reply to: Tag html

    Scordisian
    Participant

    Thnx for the quick reply. Just to make sure, you mean the bbpress-functions.php file right?

    Also, I noticed some other pieces of code that are not directly found in the template files like these. So a seperate bbpress file might be very handy.

    #210536

    In reply to: Tag html

    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    and change “bbp-topic-tags” to whatever you want

    add_filter ('bbp_before_get_topic_tag_list_parse_args' , 'rew_change_class' ) ;
    
    function rew_change_class ($args) {
    	$args['before'] = '<div class="bbp-topic-tags"><p>' . esc_html__( 'Tagged:', 'bbpress' ) . '&nbsp;' ;
    return $args ;
    }
    #210535

    Topic: Tag html

    in forum Themes
    Scordisian
    Participant

    Hello,

    I was wondering. The following <?php bbp_topic_tag_list(); ?>
    call the tags from what I can see. But where can I change the preceding class="bbp-topic-tags".

    I want to change the class name.

    Thnx.

    #210526
    Robin W
    Moderator
    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo '<div="kiki-greet">'.$user->display_name.'</div>' ;
    }

    try again

    #210525
    Kikis
    Participant

    I got an error why using the code

    #210521
    Robin W
    Moderator

    wrap it in some <div>‘s

    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;
    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo '<div="kiki-greet">.$user->display_name.'</div> ;
    }

    then style the div name (which can be anything unique – I just called it kiki-greet)

    #210518
    Kikis
    Participant

    I’m trying to add css tag to this code but could not

    add_shortcode (‘kiki-greet’ , ‘kiki_greet’ ) ;

    function kiki_greet() {
    $user = wp_get_current_user() ;
    echo $user->display_name ;
    }

    I want to style the name

    #210515
    adamgby
    Participant

    Yes exactly. Unfortunately, I did a lot of things on the site. I updated plugins, theme, installed new plugins (WooCommerce). I remembered now that I was adding code to functions.php. Code that disables the address fields when a customer buys a virtual product. I’ll check it when I’m at the computer.
    I also changed the database password.

    I have a backup from April 14. I restored plugins files from this copy yesterday. After that, two subforums appeared in each parent forum.

    I will continue working today.

    #210511
    Robin W
    Moderator

    install

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Forum Display and add item 6

    then

    dashboard>settings>bbp style pack>custom css and add

    .bbp-forum-info .bbp-forum-content {
    	display: none !important;
    }
Viewing 25 results - 2,801 through 2,825 (of 32,453 total)
Skip to toolbar