• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

Implemented spaces in author name breaks author page

LPH

Flight Director
Flight Instructor
I've looked at this tonight and there is something very crucial that needs an answer. Are you redirecting the author links to XenForo? This is important to overcome the limitations of user_nicename in WordPress. WordPress builds the link to its author URL by using user_nicename, set by XenWord as $visitor['username'];

WordPress will strip out any spaces so that the author URL is built.

This is why my question is very important. Are you using the link XenWord creates or are you relying on the link built by WordPress?
 

dethfire

Baby Penguin
XenWord Professional
Are you using the link XenWord creates or are you relying on the link built by WordPress?
Using the link wordpress makes so a user can see all the posts by an author. Redirecting to XF will not show all their posts.
 

LPH

Flight Director
Flight Instructor
Using the link wordpress makes so a user can see all the posts by an author. Redirecting to XF will not show all their posts.

All author posts are not written to XF? OK. Not really relevant. The important point is that you are using the WordPress link.

XenWord uses a filter to build a link redirecting to XenForo and not a replacement. If you have that turned off in the XenWord panel then the author link is not the file.

Instead, it might be when the XF user is created in the database, the code writes nice_username as the $visitor['username']. Were these members first then became authors?
 

dethfire

Baby Penguin
XenWord Professional
Can you go into phymyadmin and look at the wp_users table for the accounts with spaces in XenForo and see how the user_nicename is written?
Looks like WP puts a hyphen in like rude-man and john-baez
 
  • Like
Reactions: LPH

LPH

Flight Director
Flight Instructor
Has this been fixed?

Since you are using WordPress links, the link isn't something that the plugin is changing. User_nicename is written to the database and can be modified by an admin. However, the user

As a recap, here is the issue:

/?author=1 is going to /author/GregBernhardt/ but should go to /author/Greg-Bernhardt/

Here are a couple of ideas

You could look at:
https://wordpress.org/plugins/edit-author-slug/

OR

https://wordpress.org/plugins/username-changer/

OR

Comment out Line 72 in class-xenword-users-data.php by putting //

PHP:
// $current_user->nickname                              = $visitor['username'];

If you could start at line 72 issue then we can see if the plugin is creating the issue by changing the nickname.
 

LPH

Flight Director
Flight Instructor
Let's get you updated to the latest version, have you comment out line 72 and see if that fixes this bug.;)
 

Gracie

Dogs Times Writer
Interesting. This isn't breaking here. We need to figure out the differences. Can you screenshot your settings for author redirect etc?

Misread things -- you commented out line 72 per @LPH instructions and it is still breaking. But did you go and fix the username in the WordPress user panel to match things properly?

If /?author=6 is not redirecting per WordPress then maybe @LPH needs to write another set of code to have it done properly. Is this possible?
 
Last edited:

dethfire

Baby Penguin
XenWord Professional
Misread things -- you commented out line 72 per @LPH instructions and it is still breaking. But did you go and fix the username in the WordPress user panel to match things properly?
Fix it how? I tried changing nickname, but it seems to still use username.
 

Gracie

Dogs Times Writer
Since you are using WordPress to build the link (and not the plugin), what is appearing in the User panel for the user?

Username Nickname .png


Next, what is the link being created?
Next, what is the link that it should be?
 

dethfire

Baby Penguin
XenWord Professional
For my example the username and nick are the same "Dr. Courtney"

I can change the nick to "DrCourtney"

But the link created is still
Code:
https://www.physicsforums.com/insights/author/Dr. Courtney/

When clicked turns into
https://www.physicsforums.com/insights/author/Dr. Courtney/

And appears broken

Wordpress doesn't seem to be grabbing the nickname but the username


Something strange is that I can't change the display name anymore. It doesn't save any change. Is that due to my file alteration?
 

dethfire

Baby Penguin
XenWord Professional
The edit author slug plugin is basically what I need but it doesn't work for me. No options seems to save.

I'm stunned no one else is having this problem

drcourtney.png
 

Gracie

Dogs Times Writer
This is how I got names with spaces working.

1. Comment out line 72 (class-xenword-users-data.php)
2. Install Edit Author Slug plugin (https://wordpress.org/plugins/edit-author-slug/)
3. Change slug author URL to Custom

Screen Shot 2016-03-26 at 6.42.22 PM.png


4. Surf to domain.com/author/customer-2 works.

Yes, it's strange. The Custom is set without a hyphen but surf to it with the hyphen.

Give it a try.
 
Top