Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,501 through 3,525 (of 32,522 total)
  • Author
    Search Results
  • #205103
    Robin W
    Moderator

    then you need to amend form-topic and form-reply

    to amend

    <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>

    to something like (untested)

    <?php if ( bbp_allow_revisions() && bbp_is_topic_edit() ) : ?>
    <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
    <?php endif ; ?>
    <?php else : ?>
    <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit"><?php _e( 'Update', 'bbpress' ); ?></button>
    <?php endelse : ?>
    
    #205102
    Chuckie
    Participant

    Thank you. I think the problem I am going to have though is that for new topics, the right words are still Submit / Submitting. It is only editing topics that need the words replaced.

    Wouldn’t the above code replace in code contexts, based on your comment preceding the code?

    #205101
    Robin W
    Moderator
    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'old text' ) {
    	$translated_text = 'new text';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );
    #205099
    Chuckie
    Participant

    After using the code tweak ($args['teeny'] = false;) I was then able to use this snippet:

    add_filter("mce_buttons", "tinymce_editor_buttons", 99); //targets the first line
    ​
    function tinymce_editor_buttons($buttons) {
    return array(
      "formatselect", 
      "bold",
      "italic",
      "underline",
      "bullist",
      "numlist",
      "blockquote",
      "justifyleft",
      "justifycenter",
      "justifyright",
      "code",
      "link",
      "unlink",
      "image",
      "wp_adv"
      //add more here...
      );
    }
    drjohndimi
    Participant

    Hello All.
    I think this would be a great feature to have. Once a user creates/submits a topic, a popup appears and prompts the user to share his/her post on FB, Twitter or Whatsapp (possibly with the button in the notification message.

    Is there already a solution to this out there (maybe in a plugin or helpful code).

    Thank you for your time.

    JD

    #205097
    Chuckie
    Participant

    I tried sending a post using a non-admin user, with the TEXT editor and thus 3 hrefobjects and it still simply went through the system. Just thought I mention.

    #205092
    Robin W
    Moderator

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

    item 3 method 2 and you can put introductory text before the shortcode

    #205078
    Chuckie
    Participant

    I tried the code above and I get all the buttons.

    But it is missing the Insert Image button.

    #205046

    In reply to: Working Member List?

    Chuckie
    Participant

    Thanks for this plugin. Sorry if this is a dumb question – but suppose I add this as a a plugin, how do I actually use it to present data on a page? A shortcode?

    #205045
    John
    Participant

    I’m having the same issue with bbPress email notifications coming through as HTML code. I’m using the BuddyBoss theme and platform and have reached out to their support for help, but haven’t found a solution yet.


    @avaiya
    Did you ever find a solution to this? If so, what was it?

    #205038
    Robin W
    Moderator

    untested, but this might do it

    add_filter( 'bbp_get_reply_author_display_name' , 'rew_reply_change_to_login', 10 , 2 ) ;
    
    function rew_reply_change_to_login ($author_name, $reply_id) {
    	// Get the author ID
    	$author_id = bbp_get_reply_author_id( $reply_id );
    	$author_name = get_the_author_meta( 'user_login', $author_id );
    return $author_name ;
    }
    
    add_filter( 'bbp_get_topic_author_display_name' , 'rew_topic_change_to_login', 10 , 2 ) ;
    
    function rew_topic_change_to_login ($author_name, $topic_id) {
    	// Get the author ID
    	$author_id = bbp_get_topic_author_id( $topic_id );
    	$author_name = get_the_author_meta( 'user_login', $author_id );
    return $author_name ;
    }

    let me know

    #205030
    tomijolkkonen
    Participant

    Ok yes, starting with I’m completely new to this and I need to redesign my Father in laws, forum website. This would be my first time doing this and he said that there is no hurry as he heard from my wife that I know how to code but the thing is I’m only at the basics of C# so not sure if any use here but on to the point.

    So he is not able to connect to the old website host site because I dont think it really exists anymore and/or was transferred to another host service. But he has a backup from the old database that used phpBB and he is not really willing to part with everything that was stored in that forum as it contains over 10 years of garthered info on the matter which is central to the forum. So I don’t feel that copying every post would be really a good way as there are around 200k posts on it.
    So I have a wordpress site setup with BBpress and have the basics and the serviceprovider has the database on phpmyadmin. I’m looking to use the backup to somehow have the posts etc showup without messing with the actual site but im ok even if it wipes the new design.

    I have tried using bbPress import tool but to no avail. I have not found any info considering this. So the old site is still active but I have no access to the old database but I have the old backup. The import tool did not make much sense to me but I tried.For example I am not sure do I use the root name when typing in the database name in the import tool so I have tried to look for a deeper explanation.Also I dont know how the old posts would show up in bbPress.

    #205000
    Robin W
    Moderator

    I dug into this a bit further

    The moderation in bbpress is looking for ‘<href…’ so if you just post links ie

    you post this

    https://bbpress.org/forums/topic/posts-with-3-or-more-links/

    not this

    <a href="https://bbpress.org/forums/topic/posts-with-3-or-more-links/">some link</a>

    then no check is done – it is looking for links not urls

    There is some capability in the code via

    $reply_content = apply_filters( 'bbp_new_reply_pre_content', $reply_content );

    to take out more than 2 links, but there is not an easy way to put 3 urls into moderation

    #204997
    Robin W
    Moderator

    untested but try

    if ( current_user_can( 'subscriber' ) ) {
    add_action('wp_before_admin_bar_render', 'rew_admin_bar_remove_wp_profile', 0);
    add_action('admin_bar_menu', 'rew_add_bbp_profile', 999);
    }
     
     
    function rew_admin_bar_remove_wp_profile() {
            global $wp_admin_bar;
    
            /* **edit-profile is the ID** */
            $wp_admin_bar->remove_menu('edit-profile');
     }
     
    
    function rew_add_bbp_profile($wp_admin_bar) {
    	
    			$current_user = wp_get_current_user();
    			$user=$current_user->user_nicename  ;
    			$user_slug =  get_option( '_bbp_user_slug' ) ;
    			if (get_option( '_bbp_include_root' ) == true  ) {	
    				$forum_slug = get_option( '_bbp_root_slug' ) ;
    				$slug = $forum_slug.'/'.$user_slug.'/' ;
    			}
    			else {
    				$slug=$user_slug . '/' ;
    			}
    			
    			$profilelink = '/' .$slug. $user . '/edit' ;
    			
    			$wp_admin_bar->add_node( array(
    				'parent' => 'user-actions',
    				'id'		=> 'bbp-edit-profile',
    				'title' => 'Edit Profile',
    				'href' => $profilelink,
    			) );
    
    }
    #204993
    madflute
    Participant

    Thank you so so so much! This code is working great. Just one last thing. How can I make this code run only when the user role is Subscriber? -Hiro

    #204987
    Chuckie
    Participant

    This works:

    // Redirect Registration Page
    function my_registration_page_redirect()
    {
        global $pagenow;
     
        // Standard Registration Redirect
        if ( (strtolower($pagenow) == 'wp-login.php') && (strtolower($_GET['action']) == 'register') ) {
            wp_redirect( home_url('/register/') );
        }
      
        // Redirection after successful registration
        if ( (strtolower($pagenow) == 'wp-login.php') && (strtolower($_GET['checkemail']) == 'registered') ) {
            wp_redirect( home_url('/registration-complete/') );
        }
    }
     
    add_filter( 'init', 'my_registration_page_redirect' );
    #204982
    Chuckie
    Participant

    It was suggested:

    https://codex.wordpress.org/Plugin_API/Filter_Reference/registration_redirect

    But I tried:

    add_filter( ‘registration_redirect’, ‘my_redirect_home’ );
    function my_redirect_home( $registration_redirect ) {
    return ‘https://www.publictalksoftware.co.uk/registration-complete&#8217;;
    }

    I used the “Snippets” plugin and it did not seem to work.

    #204974
    Robin W
    Moderator

    This code will change the WordPress profile to bbpress profile

    add_action('wp_before_admin_bar_render', 'rew_admin_bar_remove_wp_profile', 0);
    
    function rew_admin_bar_remove_wp_profile() {
            global $wp_admin_bar;
    
            /* **edit-profile is the ID** */
            $wp_admin_bar->remove_menu('edit-profile');
     }
    
    add_action('admin_bar_menu', 'rew_add_bbp_profile', 999);
    
    function rew_add_bbp_profile($wp_admin_bar) {
    	
    			$current_user = wp_get_current_user();
    			$user=$current_user->user_nicename  ;
    			$user_slug =  get_option( '_bbp_user_slug' ) ;
    			if (get_option( '_bbp_include_root' ) == true  ) {	
    				$forum_slug = get_option( '_bbp_root_slug' ) ;
    				$slug = $forum_slug.'/'.$user_slug.'/' ;
    			}
    			else {
    				$slug=$user_slug . '/' ;
    			}
    			
    			$profilelink = '/' .$slug. $user . '/edit' ;
    			
    			$wp_admin_bar->add_node( array(
    				'parent' => 'user-actions',
    				'id'		=> 'bbp-edit-profile',
    				'title' => 'Edit Profile',
    				'href' => $profilelink,
    			) );
    
    }

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

    Code Snippets

    #204959
    demonboy
    Participant

    Hi Robin,

    Using your prompt I hacked something that removes the action altogether and just uses the if statement. On the loop-single-forum.php file I started with this:

    <?php $forum_id = bbp_get_forum_id(); 
        if (( $forum_id == 40250) ){
    ?>
         <li class="bbp-forum-info-40250">  
    <?php
        }
    
    else {?>
    	<li class="bbp-forum-info">
    <?php
    }?>

    where I set the CSS selector ‘bbp-forum-info-40250’ width to 100%. At the end of the template I then added this:

    <?php $forum_id = bbp_get_forum_id(); 
        if (( $forum_id == 40250) ){
    ?>
           
    <?php
        }
    
    else {?>	
    	<li class="bbp-forum-topic-count"><?php bbp_forum_topic_count(); ?></li>
            rest of the normal template follows
    	</li>
    <?php
    }?>

    where nothing appears for forum id 40250 and the rest of the template displays as normal for all other forums. So now my first forum description is 100% width without topic counts/views/freshness, whilst the rest of the forums display as normal.

    If interested you can see the result here.

    #204949
    Robin W
    Moderator

    agree line 2, and line 4 should be

    $user_id = $user->ID ;

    #204945
    Chuckie
    Participant

    On the login widget it has a register button. But it has no ID, so I had no choice but to use .user-submit like this:

    /* Main buttons */
    #bbp_user_edit_submit,
    #bbp_topic_submit,
    #bbp_reply_submit, #bbp_topic_content-tmce,
    #bbp_topic_content-html,
    #bbp_reply_content-tmce,
    #bbp_reply_content-html,
    #bbp_search_submit,
    .user-submit {
    	text-shadow: none;
    	font-style: normal;
    	background: #d35438 !important;
    	color: #000 !important;
      text-align: center;
      border-radius: 4px;
    	-moz-border-radius:4px;
      -webkit-border-radius:4px;
    	border: white 1px solid;
      -moz-box-shadow: none !important;
      -webkit-box-shadow: none !important;
    	box-shadow: none !important;
    }
    
    /* Main buttons - hover */
    #bbp_user_edit_submit:hover, #bbp_topic_submit:hover, #bbp_reply_submit:hover,
    #bbp_topic_content-tmce:hover,
    #bbp_topic_content-html:hover,
    #bbp_reply_content-tmce:hover,
    #bbp_reply_content-html:hover,
    #bbp_search_submit:hover,
    .user-submit:hover {
    	color: #fff !important;
      -moz-box-shadow: inset 0 0 20px #000 !important;
      -webkit-box-shadow: inset 0 0 20px #000 !important;
      box-shadow: inset 0 0 20px #000 !important;
    }
    

    It would be nice for consistency that this button have an official ID along with any other buttons missing the ID.

    #204944
    Chuckie
    Participant

    Understood. I know some php and know c++ and this tool looked not too much code. But then I don’t know the mechanics of BBPress and don’t really know how to debug properly except by trial and error for php.

    I might just try the tool on my staging site.

    #204942
    Robin W
    Moderator

    This code (untested) should subscribe all current users to forum ID 3

    $list = get_users();
    if (empty (get_option ('rew_done')) {
    	foreach ($list as $user) {
    		$user_id = $user=>ID ;
    		$forum_id = 3 ;
    		bbp_add_user_forum_subscription( $user_id, $forum_id ) ;
    	}
    	update_option ('rew_done' , 'done' ) ;
    }

    Put this in your child theme’s function file – or use
    https://en-gb.wordpress.org/plugins/code-snippets/ and load a page, then remove it

    #204929
    Robin W
    Moderator

    bbp style pack

    lets you add an ‘edit profile’ to the menu see

    dashboard>settings>bbp style pack>login

    and also has a shortcode that you can put into a text widget in the sidebar

    [bsp-profile’ label=’Edit Profile’ edit=’y’]

    see

    dashboard>settings>bbp style pack>shortcodes

    #204928
    Chuckie
    Participant

    There are lots of discussions about this.

    Pretty much all plugins are three versions of wp out of date. I don’t know which are stable to use. Since they are exposing source code I wonder if they can be updated?

    Or is there a known up to date way to do this?

Viewing 25 results - 3,501 through 3,525 (of 32,522 total)
Skip to toolbar