The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Usernames not visible to guests after applying a Javascript code

2 posters

Go down

Solved Usernames not visible to guests after applying a Javascript code

Post by Guest August 5th 2012, 7:01 pm

Because my forum is phpBB3, I was not able to modify the template. So in order to move usernames above avatars, I added a Javascript code which seemed to work flawless. But when I view a thread as a guest, usernames do not appear at all. Is there any way I can fix this? Here is the code:

Code:
$(function(){
    $('.postprofile dl').each(function(){
    var theBox = $(this).children('dt:first');
    var uNameX = theBox.children('strong').html()+'<br>';
    theBox.children('a').before(uNameX);
    theBox.children('strong').hide();
    });
    });


Last edited by pAiNleSS. on August 5th 2012, 9:16 pm; edited 2 times in total
avatar
Guest
Guest


Back to top Go down

Solved Re: Usernames not visible to guests after applying a Javascript code

Post by Ahkrir August 5th 2012, 7:39 pm

Could you try this instead ? :
Code:
$(function(){
    $('.postprofile dl').each(function(){
    var theBox = $(this).children('dt:first');
    var uNameX = theBox.children('strong').html()+'<br>';
    theBox.children('a').before(uNameX);
    });
    });

Not sure. Can you provide your forum url?
Ahkrir
Ahkrir
Forumember

Male Posts : 288
Reputation : 14
Language : English
Location : The Netherlands

http://smarterweb.go-board.com/forum

Back to top Go down

Solved Re: Usernames not visible to guests after applying a Javascript code

Post by Guest August 5th 2012, 7:49 pm

Forum URL: http://te-mafia.createatopic.com/t1-forum-rules

With that code, the username appears under the avatar when viewing as a guest, but when logged in it's both below and above the avatar.
avatar
Guest
Guest


Back to top Go down

Solved Re: Usernames not visible to guests after applying a Javascript code

Post by Ahkrir August 5th 2012, 8:18 pm

Ok. Nothing seems wrong with the code either when I look at it.
Have you tried making guests able to view someone's profile?
Ahkrir
Ahkrir
Forumember

Male Posts : 288
Reputation : 14
Language : English
Location : The Netherlands

http://smarterweb.go-board.com/forum

Back to top Go down

Solved Re: Usernames not visible to guests after applying a Javascript code

Post by Guest August 5th 2012, 9:11 pm

Ahkrir wrote:Have you tried making guests able to view someone's profile?
Thank you, Sir! That seemed to be the issue.

The code added a link to the profile to the username, which is probably why guests couldn't view it.

Issue solved.
avatar
Guest
Guest


Back to top Go down

Solved Re: Usernames not visible to guests after applying a Javascript code

Post by Ahkrir August 5th 2012, 9:14 pm

No problem ;-)
Ahkrir
Ahkrir
Forumember

Male Posts : 288
Reputation : 14
Language : English
Location : The Netherlands

http://smarterweb.go-board.com/forum

Back to top Go down

Solved Re: Usernames not visible to guests after applying a Javascript code

Post by SLGray August 5th 2012, 9:20 pm

Topic Solved & Locked


Usernames not visible to guests after applying a Javascript code Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51576
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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