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 5/8/2012, 19:01

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 5/8/2012, 21:16; 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 5/8/2012, 19:39

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 5/8/2012, 19:49

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 5/8/2012, 20:18

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 5/8/2012, 21:11

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 5/8/2012, 21:14

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 5/8/2012, 21:20

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 : 51555
Reputation : 3524
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