1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XenWord Development in May 2016

Discussion in 'XenWord Development Archives' started by LPH, May 4, 2016.

Thread Status:
Not open for further replies.
  1. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    Last edited: Nov 6, 2016
    • Like Like x 1
  2. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    Decided authentication needed my full attention. The following video shows the last sticking point, which is the login requires a refresh.



    The good news is that the WordPress cookie is being seen and caching is enabled on the development test sites.

    Note for a possible Temporary fix for Login Widget:

    PHP:
    1.  
    2. //cheks if ? already exists in URL
    3. if( strpos( $redirect_to, '?' ) !== false ) {
    4.      $redirect_to .= "&login=".rand( 1,999999999999 );
    5. } else {
    6.      $redirect_to .= "?login=".rand( 1,999999999999 );
    7. }
    8.  
     
    • Like Like x 1
  3. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    XenWord 3.0.6.01 is now installed on the server. This version has new authentication code.
     
    • Like Like x 3
  4. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    The new authentication code seems to be holding up under different cache systems. Tonight I added a new file for author descriptions in the author box. This deprecates a complex file that caused issues with get_userdata.

    Here is the code:

    PHP:
    1.  
    2. function get_the_author_meta_filter( $field = '', $user_id = false ) {
    3.  
    4.    $author_id = get_the_author_meta( 'id', $user_id );
    5.  
    6.    $userModel = XenForo_Model::create( 'XenForo_Model_User' );
    7.    $user      = $userModel->getFullUserById( $author_id );
    8.  
    9.    return $user['about'];
    10. }
    11.  
    12. add_filter( 'get_the_author_description', 'get_the_author_meta_filter' );
    13.  
    Pretty straight forward code: filter the description by returning the about information in the XenForo user table. The code has been uploaded onto this server and we'll see how it works.
     
  5. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    Started to organize the public CSS file. Each section is listed by most relevant to all sites; that is, most sites use the discuss link and the login widget. The least used is the WP Toolbar and Branding.

    Most of the time was spent on the discuss link CSS since it and the PHP were messed up. It looks like corrections made in a previous version were lost. Oops.

    I hope this improvement is useful.

    XenWord Organizing CSS.png
     
    • Like Like x 2
Thread Status:
Not open for further replies.

Share This Page