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.
The forum of the forums
2 posters

    Usernames not visible to guests after applying a Javascript code

    avatar
    Guest
    Guest


    Solved Usernames not visible to guests after applying a Javascript code

    Post by Guest Sun 5 Aug - 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 Sun 5 Aug - 21:16; edited 2 times in total
    Ahkrir
    Ahkrir
    Forumember


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

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

    Post by Ahkrir Sun 5 Aug - 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?
    avatar
    Guest
    Guest


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

    Post by Guest Sun 5 Aug - 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.
    Ahkrir
    Ahkrir
    Forumember


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

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

    Post by Ahkrir Sun 5 Aug - 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?
    avatar
    Guest
    Guest


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

    Post by Guest Sun 5 Aug - 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.
    Ahkrir
    Ahkrir
    Forumember


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

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

    Post by Ahkrir Sun 5 Aug - 21:14

    No problem ;-)
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

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

    Post by SLGray Sun 5 Aug - 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.

      Current date/time is Sun 22 Sep - 17:38