The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Usernames not visible to guests after applying a Javascript code

View previous topic View next topic Go down

Solved Usernames not visible to guests after applying a Javascript code

Post by Guest on 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

Guest
Guest


Back to top Go down

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

Post by Ahkrir on 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
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 on 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.

Guest
Guest


Back to top Go down

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

Post by Ahkrir on 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
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 on 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.

Guest
Guest


Back to top Go down

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

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

No problem ;-)

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 on August 5th 2012, 9:20 pm

Topic Solved & Locked


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


SLGray
Administrator
Administrator

Male Posts : 36639
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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