Show profile on the navigation bar

Go down

Show profile on the navigation bar Empty Show profile on the navigation bar

Post by RafaelS on July 23rd 2018, 10:21 pm

Enable by means of this script the addition of a button with the user's name and avatar to the navigation bar, which will redirect to the user's profile.

Author: RafaelS.
Working forum versions: All versions, except AwesomeBB

Application Result

The application will look as follows after being applied to the forum:

Show profile on the navigation bar LJqSE6k

Installation

The installation is unique, and can only be done by creating a new javascript. CSS can be modified, and is embedded in Javascript. Please follow the steps below to install the effect on your community.

Control Panel >> Modules >> HTML and Javascript >> Management of Javascript codes >> Create a new javascript

Placement: On all pages

Code:
/****
 * Application: Link and avatar in the navbar
 * Description: This application can show the link to the user's profile and avatar in the navbar.
 * Version: 1.0
 * Made and Optimizations by RafaelS. - 2018/07/06
 * View more in: https://ajuda.forumeiros.com
 * Copyright (c) 2018 RafaelS.<rafael_s at outlook dot pt>
 * This work is free. You can redistribute it and/or modify it
 * under the terms of the WTFPL, Version 2
 **/
 
$(function() {
if(_userdata.session_logged_in > 0) {
 
  var username = _userdata.username, userid = _userdata.user_id,navb,linkav = _userdata.avatar,prependcode = '<li><a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a></li>';
  
if($('body#modernbb').length > 0) navb = '.navbar.navlinks'; // ModernBB version
else if($('td.bodyline').length > 0){navb = '.bodyline table:eq(1) tr td';prependcode = '<a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a> &nbsp;';} // phpBB2 version
else if($('body#phpbb').length > 0){ navb = '.navbar .linklist.navlinks';prependcode = '<li><a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a> &nbsp;</li>';} // phpBB3 version
else if($('.pun #pun-intro').length > 0)navb = '#pun-navlinks ul.clearfix';// punBB version
else if($('#ipbwrapper').length > 0){ navb = '#submenu ul li'; prependcode= '<a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a>';} // Invision version
else return; // no valid version
  
$('head').append(
    '<style type="text/css">' +
    '.mainmenu.rafavatar img {' +
    'display: inline-block !important;'+
    'width:30px;' +
    'height: 30px;' +
    'vertical-align: middle;' +
    'border-radius: 16px;'    +
    'margin-right: 7px;'    +
    'box-shadow: 0 2px 2px rgba(0,0,0,0.1);' +
   'filter: none;' +
    '}' +
    '</style>'
  );
  
$(navb).prepend(prependcode);
}else{return;}});
RafaelS
RafaelS
New Member

Posts : 14
Reputation : 6
Language : Portuguese, English and French

http://ajuda.forumeiros.com/forum

Back to top Go down

Show profile on the navigation bar Empty Re: Show profile on the navigation bar

Post by TonnyKamper on July 24th 2018, 6:38 pm

@RafaelS wrote:Enable by means of this script the addition of a button with the user's name and avatar to the navigation bar, which will redirect to the user's profile.

Author: RafaelS.
Working forum versions: All versions, except AwesomeBB

Application Result

The application will look as follows after being applied to the forum:

Show profile on the navigation bar LJqSE6k

Installation

The installation is unique, and can only be done by creating a new javascript. CSS can be modified, and is embedded in Javascript. Please follow the steps below to install the effect on your community.

Control Panel >> Modules >> HTML and Javascript >> Management of Javascript codes >> Create a new javascript

Placement: On all pages

Code:
/****
 * Application: Link and avatar in the navbar
 * Description: This application can show the link to the user's profile and avatar in the navbar.
 * Version: 1.0
 * Made and Optimizations by RafaelS. - 2018/07/06
 * View more in: https://ajuda.forumeiros.com
 * Copyright (c) 2018 RafaelS.<rafael_s at outlook dot pt>
 * This work is free. You can redistribute it and/or modify it
 * under the terms of the WTFPL, Version 2
 **/
 
$(function() {
if(_userdata.session_logged_in > 0) {
 
  var username = _userdata.username, userid = _userdata.user_id,navb,linkav = _userdata.avatar,prependcode = '<li><a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a></li>';
  
if($('body#modernbb').length > 0) navb = '.navbar.navlinks'; // ModernBB version
else if($('td.bodyline').length > 0){navb = '.bodyline table:eq(1) tr td';prependcode = '<a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a> &nbsp;';} // phpBB2 version
else if($('body#phpbb').length > 0){ navb = '.navbar .linklist.navlinks';prependcode = '<li><a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a> &nbsp;</li>';} // phpBB3 version
else if($('.pun #pun-intro').length > 0)navb = '#pun-navlinks ul.clearfix';// punBB version
else if($('#ipbwrapper').length > 0){ navb = '#submenu ul li'; prependcode= '<a class="mainmenu rafavatar" href="/u'+userid+'"><span id="img">'+linkav+'</span>'+username+'</a>';} // Invision version
else return; // no valid version
  
$('head').append(
    '<style type="text/css">' +
    '.mainmenu.rafavatar img {' +
    'display: inline-block !important;'+
    'width:30px;' +
    'height: 30px;' +
    'vertical-align: middle;' +
    'border-radius: 16px;'    +
    'margin-right: 7px;'    +
    'box-shadow: 0 2px 2px rgba(0,0,0,0.1);' +
   'filter: none;' +
    '}' +
    '</style>'
  );
  
$(navb).prepend(prependcode);
}else{return;}});

Wow this works flawless on my Invision forum @RafaelS awesome job Yes

Show profile on the navigation bar Avatar10

Am I allowed to translate this and share it on the Dutch support forum? Giving you de credits offcourse Smile

Have a nice day bye
TonnyKamper
TonnyKamper
Forumember

Female Posts : 430
Reputation : 33
Language : Dutch/English
Location : The Netherlands

http://www.nederlandheelt.nl/forum

Back to top Go down

Show profile on the navigation bar Empty Re: Show profile on the navigation bar

Post by RafaelS on July 24th 2018, 11:37 pm

I’m glad you enjoyed it and of course you are allowed @TonnyKamper, I see no problem there. Very Happy
RafaelS
RafaelS
New Member

Posts : 14
Reputation : 6
Language : Portuguese, English and French

http://ajuda.forumeiros.com/forum

Back to top Go down

Show profile on the navigation bar Empty Re: Show profile on the navigation bar

Post by TonnyKamper on July 25th 2018, 5:31 pm

@RafaelS wrote:I’m glad you enjoyed it and of course you are allowed @TonnyKamper, I see no problem there. Very Happy

Thank you very much @RafaelS cheers it's done and you can check your credits here at the bottom: Avatar met profiellink op navbar

Props to you Very good ~1~ salut
TonnyKamper
TonnyKamper
Forumember

Female Posts : 430
Reputation : 33
Language : Dutch/English
Location : The Netherlands

http://www.nederlandheelt.nl/forum

Back to top Go down

Show profile on the navigation bar Empty Re: Show profile on the navigation bar

Post by YoshiGM on August 26th 2018, 12:59 am

Wow! This is very cool! You can avoid some clicks to check your profile.
Thanks.

If you don't have any problem, i will translate your code to Spanish and of course give you the respective credits Wink

EDIT: Don't worked silent
YoshiGM
YoshiGM
Forumember

Male Posts : 790
Reputation : 110
Language : Spanish & English
Location : Mexico

http://asistencia.foroactivo.com/u21373

Back to top Go down

Show profile on the navigation bar Empty Re: Show profile on the navigation bar

Post by Moulds965 on March 25th 2019, 12:21 pm

The only thing I need now is a way for the providers (those who can post to the main blog) a way to create/edit posts. Other than adding a meta widget to the sidebar myprepaidcenter, is there a better way I can provide authors, contributors, etc.


Last edited by Moulds965 on March 26th 2019, 12:11 pm; edited 1 time in total
Moulds965
Moulds965
New Member

Posts : 1
Reputation : 1
Language : English

https://help.forumotion.com

Back to top Go down

Show profile on the navigation bar Empty Re: Show profile on the navigation bar

Post by skouliki on March 25th 2019, 12:24 pm

@Moulds965 wrote:The only thing I need now is a way for the providers (those who can post to the main blog) a way to create/edit posts. Other than adding a meta widget to the sidebar, is there a better way I can provide authors, contributors, etc.

please open a new thread with your issue giving all details and your forum url
skouliki
skouliki
Manager
Manager

Female Posts : 5909
Reputation : 928
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum