Notifications
Clear all

[Closed] Login name on Forum Title line

15 Posts
4 Users
4 Reactions
1,034 Views
Posts: 21
Topic starter
(@ghutchnet)
Eminent Member
Joined: 3 years ago

Many other forums have the login name displayed near the top of the forum page.  On WPForu it would look good on the main forum title line.  It could have an option to enable/disable it in settings.  Also the text could be editable with a default of "Hello %s" or "Welcome back %s".  If a guest is using the forum it could be blank.

As it is, unless you check your profile it is difficult to see if/how you are logged into the forum.

Just an idea... 😉 

Gary

14 Replies
dimalifragis
Posts: 2615
(@dimalifragis)
Famed Member
Joined: 4 years ago

Not related to your question BUT there is an "index.php" in your url and that is WRONG (in your whole site).

Also the "Wordpress" part of your url is UN-NEEDED (in your whole site). Since you are just staring, you better fix those because after some months, if you make the changes, your indexing and rank will be lost.

3 Replies
(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@dimalifragis thanks. I am aware of the WordPress and index.php issue. I have not been able to overcome it because of the file structure I've had to live with when I built my WordPress site.  When I setup wpforu it uses the url I have listed to access my forum page. I don't understand why.

dimalifragis
(@dimalifragis)
Joined: 4 years ago

Famed Member
Posts: 2615

@ghutchnet The "index.php" is because you have it in your PERMALINKS Wordpress options.

WP-ADMIN-->Settings-->Permalink and use the permalink structure change there.

(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@dimalifragis Thank you!  I have corrected the index.php problem.  The path problem still persists.  This site is built over an older site and I had to nest the new wordpress site inside the existing public_html folder.

Chris
Posts: 3649
(@chris)
Famed Member
Joined: 3 years ago

Hi @ghutchnet,

Posted by: @ghutchnet

Many other forums have the login name displayed near the top of the forum page.  On WPForu it would look good on the main forum title line.  It could have an option to enable/disable it in settings.

Can you provide screenshots.

Also, if you add wpForo Profile & Notification Widget, To show Users info on the sidebar.

 

Posted by: @ghutchnet

also the text could be editable with a default of "Hello %s" or "Welcome back %s".

You can edit every wpForo phrase from Dashboard > Forums > Phrases Page, 

 

3 Replies
(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@chris Thank you for the widget suggestion.  I have now applied that as you will see.  I would still prefer the option of showing the user's name, or nickname, in the forum body if possible.  I am attaching a screenshot I edited to show what I am suggesting.

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3649

@ghutchnet,

I don't think that this option will be included in our to-do list, the reason is that wpForo Dev team is working on 2.0 version which is a very big update with huge work to do. 

However, you can reach this yourself by theme customization, if you have PHP and WordPress coding knowledge, or you can contact gVectors custom work team with sales[at]gvectors.com, for custom work by your needs.

Check the below Doc about wpForo Theme Customization:

https://wpforo.com/docs/root/forum-themes/theme-customization/

(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@chris I understand. Thank you for responding. I really appreciate that. I look forward to the next iteration. 🙂

Tutrix
Posts: 1357
(@tutrix)
Noble Member
Joined: 4 years ago

Hi @ghutchnet

you can use this PHP code

<?php
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
if ( ($current_user instanceof WP_User) ) {
echo ' </br>¡Hello ' . esc_html( $current_user->display_name . '!');
}
}
?>

and paste it into the forum.php at the desired position

wpforo > wpf-themes > classic > forum.php

5 Replies
(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@tutrix wow! Thank you. I will consider this avenue.  I will play with it soon.  😀

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1357

@ghutchnet 

Inspired by your question, I also added this to my forum, with an additional info for guests 😉 

   <div class="wpf-welcome"><?php if (is_user_logged_in()) {
    $current_user = wp_get_current_user();
    echo 'Hallo <span>' . esc_html($current_user->display_name) . '</span> willkommen im Forum!';
} else {
    // Save current page url for redirect after login (optional):
    global $wp;
    $redirect = home_url($wp->request);

    echo 'Willkommen im Tutrix Forum, du musst dich <a href="' . esc_url(wp_login_url($redirect)) . '">anmelden oder regisrieren</a> um Beitr&auml;ge verfassen zu k&ouml;nnen';
} ?>
   </div>

replace the german words with text in your language

(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@tutrix Very nice!  This goes into forum.php as well?

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1357

@ghutchnet 

yes, on top directly after

<?php
if( !$forum = WPF()->current_object['forum'] ) : ?>
(@ghutchnet)
Joined: 3 years ago

Eminent Member
Posts: 21

@tutrix I made a few changes including the english translation. I also moved it to just before the first <h1>

 

<div class="wpf-welcome" style="padding-right: 1px; font-size: 13px;"><?php if (is_user_logged_in()) { // This adds Welcome user message :
$current_user = wp_get_current_user();
echo 'Welcome back, <span><strong>' . esc_html($current_user->display_name) . '</strong></span>!';
} else {
// Save current page url for redirect after login (optional):
global $wp;
$redirect = home_url($wp->request);

echo 'Welcome to the <span>' . esc_html(WPF()->general_options['title']) . '</span>,<br> you must<span> <a href="https://triumphclub.org/wordpress/community/?foro=signin">Login or Register</a> to post</span>';
} ?>
</div>