. .
ShallHelp

×


| Home | home
| Consumers |
| Quote |
| Licensed Professionals |
| Clients |

| EXPLORE |
| Community / Forum |
| Articles / Blogs |
| Members Chat |

| MY ACCOUNT | person
| Sign In or Register |
| Missions |
| Tech Team |

17 thoughts on “Session: Oct. 8 2020, Thursday

  1. Display Name

    OLD CODE:

    /**
    * Filters a user's display name before the user is created or updated.
    *
    * @since 2.0.3
    *
    * @param string $display_name The user's display name.
    */
    $display_name = apply_filters( 'pre_user_display_name', $display_name );

    And

     

    * @global string $user_identity The display name of the user

     

    Will test Registration New User

    NewUsero1012

    NewUsero10123456789

    NewUsero10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60cccccccc70cccccccc80

     

  2. NewUsero10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60cccccccc70cccccccc80

    – The Username Registration cuts of at 30

    – Couldn’t register you, Contact the Site Admin

    Testing 30

    – Couldn’t register you, Contact the Site Admin

    NewUsero10cccccccc20cccccccc30

    – Couldn’t register you, Contact the Site Admin

    Testing up to 16

    – Couldn’t register you, Contact the Site Admin

    Testing up to 15

    NewUserc10ccc15

    – Couldn’t register you, Contact the Site Admin

     

    Because I set it up to the Core file to default at 12

    Testing 12

    NewUserccc12

    IT WORKED! 

    Check Registration Email

    Got this from wordpress@CLG: 

    Username: NewUserccc12

    To set your password, visit the following address:

     

    Where you can set your new password. 

     

    Then now, Let’s test the Nickname again, will change from

    default (and allowable max of 12 characters)

    Nickname (which copies the username)

    newuserccc12

    Changing to  

    NewUsero10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60cccccccc70cccccccc80

    – User Data update failed … let’s see the max for this

    NewUsero10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60cccccccc70

    – User Data update failed … let’s see the max for this

     

    NewUsero10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60

    – User Data update failed … let’s see the max for this

    NewUsero10cccccccc20cccccccc30cccccccc40cccccccc50

    Max for Nickname that displays is 50

    I’ll dig dipper into the code again … 

     

  3. NEW CODES (wp-includes > user.php)

     // user_login must be between 0 and 12 characters.
    if ( empty( $user_login ) ) {
    return new WP_Error( 'empty_user_login', __( 'Cannot create a user with an empty login name.' ) );
    } elseif ( mb_strlen( $user_login ) > 12 ) {
    return new WP_Error( 'user_login_too_long', __( 'Username may not be longer than 12 characters.' ) );
    }

     

    AND

    /*
    * If a nicename is provided, remove unsafe user characters before using it.
    * Otherwise build a nicename from the user_login.
    */
    if ( ! empty( $userdata['user_nicename'] ) ) {
    $user_nicename = sanitize_user( $userdata['user_nicename'], true );
    if ( mb_strlen( $user_nicename ) > 12 ) {
    return new WP_Error( 'user_nicename_too_long', __( 'Nicename may not be longer than 12 characters.' ) );
    }
    } else {
    $user_nicename = mb_substr( $user_login, 0, 12 );
    }

    $user_nicename = sanitize_title( $user_nicename );

     

    AND

    /**
    * Filters a user's nicename before the user is created or updated.
    *
    * @since 2.0.3
    *
    * @param string $user_nicename The user's nicename.
    */
    $user_nicename = apply_filters( 'pre_user_nicename', $user_nicename );

    $user_nicename_check = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1", $user_nicename, $user_login ) );

    if ( $user_nicename_check ) {
    $suffix = 2;
    while ( $user_nicename_check ) {
    // user_nicename allows 12 chars. Subtract one for a hyphen, plus the length of the suffix.
    $base_length = 11 - mb_strlen( $suffix );
    $alt_user_nicename = mb_substr( $user_nicename, 0, $base_length ) . "-$suffix";
    $user_nicename_check = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1", $alt_user_nicename, $user_login ) );
    $suffix++;
    }
    $user_nicename = $alt_user_nicename;
    }

     

    AND

     

    /**
    * Filters a user's display name before the user is created or updated.
    *
    * @since 2.0.3
    *
    * @param string $display_name The user's display name.
    */
    $display_name = apply_filters( 'pre_user_display_name', $display_name );

    $description = empty( $userdata['description'] ) ? '' : $userdata['description'];

     

    Codes work on WP Core.  But if we use the Forum Registration, will hunt code there. 

     

  4. Will also have to change the verbiage on the registration page.  It shows there 3 to 15. 

    I’ll change it to 3 to 12.  This is because of the Error Code above, which says 

    – Couldn’t register you, Contact the Site Admin

    That can be solved by just saying use a username between 3 to Maximum 12 (otherwise you’ll receive an error that says ” Couldn’t register you, Contact the Site Admin”)

     

    Plugin Editor > wpforo > wpf-themes > classic > register.php

    OR

    Forum > Phrases 

    Do a search on “15” 

    This will display 

    Username length must be between 3 characters and 15 characters.

    Click Edit

    Changed it to 

    Username *

    Length must be between 3 characters and 12 characters. Use the Name as you would like it to appear in posts, comments, and likes. (example: JoeSmith or JoeS or Joe, or joe)

  5. Hide Display Name (an oxymoron)

     

    CODE: 

    /*Do not display Display Name Label & Text Field - PROFILE PAGE*/

    div.wpf-field.wpf-field-type-text.wpf-field-name-display_name.wpf-field-required {
    display: none;
    }

     

     

  6. Tested this Display Name: 

    CrisWwww10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60cccccccc70cccccccc80cccccccc90ccccccc100

     

    If not for the earlier code I put, it would break the Account Profile Page.  

    The Likes would be interesting… 

  7. Testing the nickname

    CrisWwww10cccccccc20cccccccc30cccccccc40cccccccc50cccccccc60cccccccc70cccccccc80cccccccc90ccccccc100

    – User Data update failed. 

     

    criswwww10cccccccc20cccccccc30cccccccc40cccccccc50

    – Max Length at 50. This also has to be reduced to 12. 

  8. For the Nicenames / URL , I added this code and it should stay.

    /*Automatically adjust long Nicenames or Nicknames to responsively fit smaller screens - COMMENT BOX*/

    div.wpf-author-nicename{
    white-space: wrap !important;
    max-width: 90% !important;
    width: 90% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    }
  9. OK Will share this with other Admins. 

     

    Hi Alvina,  Thanks for responding and getting your developers to look into this. In the meantime, I have temporarily used the code below to hide the “Display Name” from the Account Profile.  I thought I would share it here, in case others might want to use it too.  

    I found it important because I saw another portal get heavily spammed and when I noticed they were using WP, I tested it on our forums too.

    I was able to tweak the WP Core user file, so our WP site now has only 12 character limits for the Username (which on the forum, gets duplicated into the “Display Name” and the “Nickname” fields by default). 

    The issue I see in the form at the Member’s Account Profile, on the “Display Name” text field, it seems to not have a maxlength character limit on the field itself, so if anyone inputs extremely long Display Name, it will break the forum layout (“Profile“, “Post” Box, and the “Likes”  as shown in above screenshot). 

    So in the mean time, I put the codes below (Forum Settings > Styles > Custom CSS) 

    /*Do not display Display Name Label & Text Field - PROFILE PAGE*/
    div.wpf-field.wpf-field-type-text.wpf-field-name-display_name.wpf-field-required {
    display: none;
    }

    And since the Nickname field also has a maxlength of 50 characters, it also protrudes through the comment box, and does not look good so, I also added this code below: 

     

    /*Automatically adjust long Nicenames or Nicknames to responsively fit smaller screens – COMMENT BOX*/

    div.wpf-author-nicename {
    white-space: wrap !important;
    max-width: 90% !important;
    width: 90% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    }

    I hope that the Developers can look into the max-length of the field names for “Display Name” and “Nickname”.  

    Thanks!  God bless you! 🙂 

     

    Related: 

    How to hide some fields in the user's Account Profile

    https://wpforo.com/community/how-to-and-troubleshooting-2/trouble-when-removing-social-networks-fields-in-profile/#post-28480

     

     

     

     

  10. I switched the Top Container to white at SH. The white bar shows up on the latest version 1.8.4. 🙂

    So I changed the settings on the WP Theme. (I am so happy I made our own here, I know JUST where to tweak in a moment!)

    {
    background-color: white;
    }

  11. I also did this … (and helping other Admins with it)

    ———

    Hi Dok , 

    I looked at your attached screenshot above, and thought I’d type out  a suggestion you can try. 

    Have you tried the wpForo’s “Phrases” functionality?  It’s awesome and highly customizable.  For your use case, maybe you can also try to edit the “Topic Title” and add your text there?   Just go to… 

    1) Forum Dashboard
    2) Phrases
    3) On the “Front-end Phrases” Search box, type “Topic Title” 
    4) Under the Phrase key, hover your mouse, so the Edit appears
    5) Then on the Phrase Key, you wish to edit, in this example “Topic Title” , delete the Phrase key and just change it to “Topic Title (ideally, with maximum of 50 characters)” (as an example)
    6) Then save.

    You can do the same process for “Attach File” and “Topic Tags” 

    Might be a workaround. (I did that for my forum to remind members to be mindful of the length of their topics) 🙂 

    Good luck and God bless you!  🙂 

  12. I think I am done with the helpaholic mode, LOL!  

    This is good to go to open to announced and scheduled Registrations, then closed after a specific time.  

    I’ll copy the tweaks I did on here, and put it on SH.  🙂 

    Over an out.  

    That in ALL things God will be glorified.  (And we can always help others along the way… 🙂 

     

    Removing my funny looking nicename now.

    @criswwww10cccccccc20cccccccc30cccccccc40cccccccc50

    My code snippets work!

  13. I have changed the Share Codes

    from THIS (Yup I made that!  It’s not an extra plugin!)

    <script>document.write('<a href="mailto:?body='+encodeURIComponent(document.URL)+'%0A%0A'+encodeURIComponent(document.querySelector('meta[name=description]')?document.querySelector('meta[name=description]').content:'')+'&subject='+encodeURIComponent(document.title)+'"title="Mail" class="fa fa-envelope" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#1E4C91;"</a> <a href="https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(document.URL)+'"target="_blank"title="Facebook" class="fa fa-facebook" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#3B5998;"</a> <a href="https://twitter.com/share?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="Twitter" class="fa fa-twitter" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#55ACEE;"</a> <a href="https://www.reddit.com/submit?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'"target="_blank"title="Reddit" class="fa fa-reddit" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#ff5700;"</a> <a href="https://www.linkedin.com/shareArticle?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'"target="_blank"title="LinkedIn" class="fa fa-linkedin" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#007bb5;"</a> <a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'&caption='+encodeURIComponent(document.querySelector('meta[name=description]')?document.querySelector('meta[name=description]').content:'')+'"target="_blank"title="Tumblr" class="fa fa-tumblr" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#2c4762;"></a><a href="https://www.shallhelp.com/forum/general-discussions/#button/#add_wpftopic.wpf-button?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="ShallHelp"style="display:inline-block;vertical-align:middle;width:1.8em;height:1.7em;border-radius:10%;background:#1E4C91;" rel="noopener noreferrer"><img class="alignnone size-small wp-image-2078" src="https://www.shallhelp.com/wp-content/uploads/2019/01/ShallHelp_White_Smiley1000x1000.png" alt="" width="auto" height="" style="display:block;fill:#fff;height:44%;margin:28% auto;" viewBox="0 -256 864 1664" /></a>');</script>

     

     

    And Added our BRAND NEW CLG Share Code!  Woo hoo!!! 

    <script>document.write('<a href="mailto:?body='+encodeURIComponent(document.URL)+'%0A%0A'+encodeURIComponent(document.querySelector('meta[name=description]')?document.querySelector('meta[name=description]').content:'')+'&subject='+encodeURIComponent(document.title)+'"title="Mail" class="fa fa-envelope" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#1E4C91;"</a> <a href="https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(document.URL)+'"target="_blank"title="Facebook" class="fa fa-facebook" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#3B5998;"</a> <a href="https://twitter.com/share?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="Twitter" class="fa fa-twitter" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#55ACEE;"</a> <a href="https://www.reddit.com/submit?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'"target="_blank"title="Reddit" class="fa fa-reddit" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#ff5700;"</a> <a href="https://www.linkedin.com/shareArticle?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'"target="_blank"title="LinkedIn" class="fa fa-linkedin" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#007bb5;"</a> <a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'&caption='+encodeURIComponent(document.querySelector('meta[name=description]')?document.querySelector('meta[name=description]').content:'')+'"target="_blank"title="Tumblr" class="fa fa-tumblr" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#2c4762;"></a><a href="https://www.shallhelp.com/forum/general-discussions/#button/#add_wpftopic.wpf-button?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="ShallHelp"style="display:inline-block;vertical-align:middle;width:1.8em;height:1.7em;border-radius:10%;background:#1E4C91;" rel="noopener noreferrer"><img class="alignnone size-small wp-image-2078" src="https://www.shallhelp.com/wp-content/uploads/2019/01/ShallHelp_White_Smiley1000x1000.png" alt="" width="auto" height="" style="display:block;fill:#fff;height:44%;margin:28% auto;" viewBox="0 -256 864 1664" /></a> <a href="https://www.christianlifegroups.com/share/forum/general-discussions-general-discussions/#button/#add_wpftopic.wpf-button?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="ChristianLifeGroups"style="display:inline-block;vertical-align:middle;width:1.8em;height:1.7em;border-radius:10%;background:#1E4C91;" rel="noopener noreferrer"><img class="alignnone size-medium wp-image-2078" src="https://www.christianlifegroups.com/wp-content/uploads/2018/06/CLG_2018-logo512x512_white.png" alt="" width="auto" height="" style="display:block;fill:#fff;height:44%;margin:28% auto;" viewBox="0 -256 864 1664" /></a>');</script>

     

    What the code does is it grabs the title of whatever page you are at, and you can easily share.  

    Do not sell the code.  I’m sharing it here so other Christians who are not selling anything on their sites can use it.  To protect their website visitors from other snoopathons from other plugins or themes. 

  14. Test Topic

    For General Discussions Forum
    Customized Share Buttons for SH and CLG

  15. Here’s a better Share Code.  Final  (bigger icons that pop out of the box slightly …. ) 

     

    <script>document.write('<a href="mailto:?body='+encodeURIComponent(document.URL)+'%0A%0A'+encodeURIComponent(document.querySelector('meta[name=description]')?document.querySelector('meta[name=description]').content:'')+'&subject='+encodeURIComponent(document.title)+'"title="Mail" class="fa fa-envelope" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#1E4C91;"</a> <a href="https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(document.URL)+'"target="_blank"title="Facebook" class="fa fa-facebook" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#3B5998;"</a> <a href="https://twitter.com/share?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="Twitter" class="fa fa-twitter" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#55ACEE;"</a> <a href="https://www.reddit.com/submit?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'"target="_blank"title="Reddit" class="fa fa-reddit" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#ff5700;"</a> <a href="https://www.linkedin.com/shareArticle?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'"target="_blank"title="LinkedIn" class="fa fa-linkedin" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#007bb5;"</a> <a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'&caption='+encodeURIComponent(document.querySelector('meta[name=description]')?document.querySelector('meta[name=description]').content:'')+'"target="_blank"title="Tumblr" class="fa fa-tumblr" style="padding:0.3em;font-size:1.1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#2c4762;"></a><a href="https://www.shallhelp.com/forum/general-discussions/#button/#add_wpftopic.wpf-button?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="ShallHelp"style="display:inline-block;vertical-align:middle;width:1.8em;height:1.7em;border-radius:10%;background:#1E4C91;" rel="noopener noreferrer"><img class="alignnone size-medium wp-image-2078" src="https://www.shallhelp.com/wp-content/uploads/2019/01/ShallHelp_White_Smiley1000x1000.png" alt="" width="auto" height="" style="style="padding:0.5em;font-size:1em;width: 1.6em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#1E4C91;" viewBox="0 -256 864 1664" /></a> <a href="https://www.christianlifegroups.com/share/forum/general-discussions-general-discussions/#button/#add_wpftopic.wpf-button?url='+encodeURIComponent(document.URL)+'&text='+encodeURIComponent(document.title)+'"target="_blank"title="ChristianLifeGroups"style="display:inline-block;vertical-align:middle;width:1.8em;height:1.7em;border-radius:10%;background:#1E4C91;" rel="noopener noreferrer"><img class="alignnone size-medium wp-image-2078" src="https://www.christianlifegroups.com/wp-content/uploads/2018/06/CLG_2018-logo512x512_white.png" alt="" width="auto" height="" style="style="padding:0.5em;font-size:1.5em;width: 1.5em;text-align:center;text-decoration:none;margin:0.10em 0.10em;border-radius: 12%;hover-opacity:0.7;color:white;background:#1E4C91;" viewBox="0 -256 864 1664" /></a>');</script>
  16. Remove the Topic Title from the Phrases.  Shows up on the Forum (and not on the Add Topic area) 

    Removed 

    ” (ideally, with maximum of 50 characters)”

Comments are closed.