Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 11,301 through 11,325 (of 14,243 total)
  • In reply to: Forum Width

    @robin-w

    Moderator

    you’ll need to work you way through this article

    Functions files and child themes – explained !

    @robin-w

    Moderator

    put the following in your style.css

    #bbpress-forums .button {
      background-color: blue;
      color: red;
    }

    Functions files and child themes – explained !

    @robin-w

    Moderator

    @robin-w

    Moderator

    would need a function recoded to do this, as there is a function that does the avatar and role display

    The function is bbp_reply_author_link

    and it’s held in

    bbpress\includes\replies\template.php

    it has a filter you can call, and if you fine with php you should be able to hack the code to change the order

    @robin-w

    Moderator

    Sorry for delay in replying, I have little knowledge of this importer, so was hoping that someone else with more knowledge would step in.

    I’d suggest you try

    Dashboard>tools>forums>repair forums and see if that helps establish the links

    @robin-w

    Moderator

    Not really they don’t seem to visit here much nowadays !

    In reply to: Forum Width

    @robin-w

    Moderator

    add the following to your style.css

    if you want it on the left but smaller

    #bbpress-forums {
      width: 66% !important;
    }
    

    If you want it centered

    #bbpress-forums {
      margin-left: auto !important;
      margin-right: auto !important;
      width: 66% !important;
    }
    
    

    Functions files and child themes – explained !

    Obviously play with the 66% to get whatever width you want

    @robin-w

    Moderator

    If it is just one line then add the following to your functions file

    function my_content () {
    	$content = 'Hello this is some content after the topic' ; 
    	echo $content ;
    	}
    	 
    add_action ('bbp_template_after_replies_loop', 'my_content' ) ;

    and change the text to what you want

    Functions files and child themes – explained !

    If it is more than that, then you will need to detail exactly what you want so I can help you.

    @robin-w

    Moderator

    can you provide a url to an example please

    @robin-w

    Moderator

    If you click the word ‘stick’ it makes it sticky
    If you click the words ‘(to front)’ it makes it super sticky

    I agree it’s not very clear

    By the way I’m not one of the authors, just a user.

    @robin-w

    Moderator

    can you help me fix the look of the registration page? – buttons.

    only if you can tell me what you would like changed !

    In reply to: no topics found

    @robin-w

    Moderator

    ok, when I click

    http://demo.vintageracecar.com/forums/topic/topic-by-non-admin-bryan/#post-6598

    I get ‘you must be logged in to reply to this topic’

    Can you recheck your permissions

    In reply to: Log In Problems

    @robin-w

    Moderator

    ok, is it just that one user, or have you tried several?

    and also try resetting the password for that user to see if that fixes

    @robin-w

    Moderator

    thanks for posting that full description – I have been through it, and only wish I could say “well in that case…”

    Clearly subscriptions continue to cause problems. I am only a user of this software who tries to help others, I’m not one of the authors.

    I’m not really sure what to suggest next – you would have though this was easy !

    In reply to: no topics found

    @robin-w

    Moderator

    and for

    Also, would like to change that “oh bother” to something less “cutesy”.

    add the following

    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Oh bother! No topics were found here!' ) {
    	$translated_text = 'new text';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );
    

    to your functions file

    Functions files and child themes – explained !

    @robin-w

    Moderator

    Hey great – glad we got there in the end !

    In reply to: no topics found

    @robin-w

    Moderator

    ok could be several reasons, but lets start with

    Dashboard>settings>permalinks and just click save

    this will reset the permalinks and quite often makes the above issue go away

    @robin-w

    Moderator

    ok so I can see a banner on

    http://new.stonemagegames.com/forums/

    but no forums listed below

    and in

    http://new.stonemagegames.com/SMG-Forums/Forum/gaming/

    I can see a forum but no banner

    which one of the above (or is it both) are you trying to fix, or have I misunderstood the problem?

    @robin-w

    Moderator

    oops sorry didn’t take the ); out of the previous line

    try

    function change_display_name( $user_id ) {
        $info = get_userdata( $user_id );
    	$args = array(
    		'ID' => $user_id,
    		'display_name' => $info->user_login ,
    'nickname' => $info->user_login 	);
    
        wp_update_user( $args );
    }
    add_action('user_register','change_display_name');

    @robin-w

    Moderator

    ok, let’s try setting both

    function change_display_name( $user_id ) {
        $info = get_userdata( $user_id );
    	$args = array(
    		'ID' => $user_id,
    		'display_name' => $info->user_login 	);
    'nickname' => $info->user_login 	);
    
        wp_update_user( $args );
    }
    add_action('user_register','change_display_name');

    This should set both display_name and nickname to the username

    @robin-w

    Moderator

    Having said that it does appear to be using the username now in the address bar ???

    with my code in, or without?

    @robin-w

    Moderator

    yes that’s to do with how wordpress stores stuff.

    the code you need to use is in the post above, don’t use the email one !

    Try again and come back !

    @robin-w

    Moderator

    and do let me know if it works !

    @robin-w

    Moderator

    ok, that is buddypress adding the profile fields, so you may need to take it up with them if the next bit doesn’t work !

    However whilst doing something for someone else today, I found a function on the net, which I have amended (but not tested) below

    function change_display_name( $user_id ) {
        $info = get_userdata( $user_id );
    	$args = array(
    		'ID' => $user_id,
    		'display_name' => $info->user_login 	);
        wp_update_user( $args );
    }
    add_action('user_register','change_display_name');
    
    

    then on registration it should set the display_name to the username

    put this in your functions file

    Functions files and child themes – explained !

    @robin-w

    Moderator

    good start, but that approach gets very complicated, as whilst you have added the fields, you have not saved them or said where to save them – that requires a whole bunch of other code !

    Easier approach :

    bbpress uses wordpress registration, so it’s easier to hook to that.

    The whole bunch of code below is not my original work (but I do use it on one of my sites, so know it works) but if you have a play with it, you should be able to adapt it.

    `//add code for adding first and last name to registration

    //1. Add a new form element…
    add_action(‘register_form’,’myplugin_register_form’);
    function myplugin_register_form (){
    $first_name = ( isset( $_POST[‘first_name’] ) ) ? $_POST[‘first_name’]: ”;
    $last_name = ( isset( $_POST[‘last_name’] ) ) ? $_POST[‘last_name’]: ”;
    ?>
    <p>
    <label for=”first_name”><?php _e(‘First Name as people call you eg Dave’,’mydomain’) ?><br />
    <input type=”text” name=”first_name” id=”first_name” class=”input” value=”<?php echo esc_attr(stripslashes($first_name)); ?>” size=”25″ /></label>
    </p>
    <p>
    <label for=”last_name”><?php _e(‘Last Name’,’mydomain’) ?><br />
    <input type=”text” name=”last_name” id=”last_name” class=”input” value=”<?php echo esc_attr(stripslashes($last_name)); ?>” size=”25″ /></label>
    </p>
    <?php
    }

    //2. Add validation. In this case, we make sure first_name and last_name is required.
    add_filter(‘registration_errors’, ‘myplugin_registration_errors’, 10, 3);
    function myplugin_registration_errors ($errors, $sanitized_user_login, $user_email) {

    if ( empty( $_POST[‘first_name’] ) )
    $errors->add( ‘first_name_error’, __(‘ERROR: You must include a first name.’,’mydomain’) );
    if ( empty( $_POST[‘last_name’] ) )
    $errors->add( ‘last_name_error’, __(‘ERROR: You must include a last name.’,’mydomain’) );

    return $errors;
    }

    //3. Finally, save our extra registration user meta.
    add_action(‘user_register’, ‘myplugin_user_register’);
    function myplugin_user_register ($user_id) {
    if ( isset( $_POST[‘first_name’] ) )
    update_user_meta($user_id, ‘first_name’, $_POST[‘first_name’]);
    if ( isset( $_POST[‘last_name’] ) )
    update_user_meta($user_id, ‘last_name’, $_POST[‘last_name’]);
    }

    in essence start by looking at the end – 3. save

    and the line

    update_user_meta($user_id, ‘first_name’, $_POST[‘first_name’]);

    this is updating a user_meta field called ‘first_name’ for the user_id $user_id with the information entered in $_POST[‘first_name’]

    So it is saving the first name the user enters in a user_meta field for that user called ‘first_name’

    My plugin stores the data in a user_meta field called ‘rpi_label1’, so a find/replace to change ‘first_name’ to ‘rpi_label1’ is what is needed throughout the code. then some tidying up of things like the prompts and you should have it working.

    Give it a go, and see how you get on. IF you get it working, the deal is you post the result back here, and I can nick it for the plugin (and give you a credit) !

    If you don’t then come back with how you are getting on, and I’ll help – too tied up to do all the work myself !

    This code by the way goes in your functions file see

    Functions files and child themes – explained !

Viewing 25 replies - 11,301 through 11,325 (of 14,243 total)