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
4 posters

    Moving User Avatars with JavaScript

    avatar
    Yous000
    Forumember


    Posts : 240
    Reputation : 4
    Language : English

    Solved Moving User Avatars with JavaScript

    Post by Yous000 Sat 5 May - 22:21

    For people using phpBB3 like myself you are unable to move the Users name and rank title above the avatar unless you use a javascript code. Many people have had this problem and I would highly appreciate if somebody who is good with JavaScript can write in the code for all user names and rank titles to appear above the avatar, it would help me out and other phpBB3 users a lot.

    Moving User Avatars with JavaScript FQbPz

    All replies are highly appreciated.
    Sir Chivas™
    Sir Chivas™
    Helper
    Helper


    Male Posts : 6980
    Reputation : 457
    Language : EN, FR, ES
    Location : || CSS || HTML || Graphics Designs || Support ||

    Solved Re: Moving User Avatars with JavaScript

    Post by Sir Chivas™ Sat 5 May - 22:23

    Hi, Hello

    You can simply change the Version of your forum mate. Wink
    avatar
    Yous000
    Forumember


    Posts : 240
    Reputation : 4
    Language : English

    Solved Re: Moving User Avatars with JavaScript

    Post by Yous000 Sat 5 May - 22:46

    Sir Chivas™️ wrote:Hi, Hello

    You can simply change the Version of your forum mate. Wink

    Somebody said if I did that I would have to start everything over.
    Sir Chivas™
    Sir Chivas™
    Helper
    Helper


    Male Posts : 6980
    Reputation : 457
    Language : EN, FR, ES
    Location : || CSS || HTML || Graphics Designs || Support ||

    Solved Re: Moving User Avatars with JavaScript

    Post by Sir Chivas™ Sat 5 May - 22:48

    No, you got that mistaken. That's for the Theme (skin) Wink
    avatar
    Yous000
    Forumember


    Posts : 240
    Reputation : 4
    Language : English

    Solved Re: Moving User Avatars with JavaScript

    Post by Yous000 Sat 5 May - 23:13

    Sir Chivas™️ wrote:No, you got that mistaken. That's for the Theme (skin) Wink

    So how would I do it then without losing my themes and stuff? Smile
    Sir Chivas™
    Sir Chivas™
    Helper
    Helper


    Male Posts : 6980
    Reputation : 457
    Language : EN, FR, ES
    Location : || CSS || HTML || Graphics Designs || Support ||

    Solved Re: Moving User Avatars with JavaScript

    Post by Sir Chivas™ Sat 5 May - 23:20

    Well, alright.

    ACP >> Display >> Choose a theme >> Version.

    Please note: If you only have codes in the CSS, that only work for Phpbb3, will not work for phpbb2
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: Moving User Avatars with JavaScript

    Post by LGforum Sat 5 May - 23:48

    Changing your forum version is a big step to take just for this small thing... it will DRASTICALLY change your forum. Not to mention your moving away from the most powerful board type.

    I'll give you some Javascript for this in a minute. Just wanted to press send before you make this silly mistake.

    avatar
    Yous000
    Forumember


    Posts : 240
    Reputation : 4
    Language : English

    Solved Re: Moving User Avatars with JavaScript

    Post by Yous000 Sat 5 May - 23:50

    LGforum wrote:Changing your forum version is a big step to take just for this small thing... it will DRASTICALLY change your forum. Not to mention your moving away from the most powerful board type.

    I'll give you some Javascript for this in a minute. Just wanted to press send before you make this silly mistake.


    Thanks so much. I have not done it yet, waiting for the JavaScript Razz
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: Moving User Avatars with JavaScript

    Post by LGforum Sat 5 May - 23:58

    Code:

    $(function(){
      var post = $('.postprofile');
      for(var i = 0, l = post.length; i<l; i++) {
          var av = post[i].getElementsByTagName('a')[0];
          var dd = document.createElement('dd').appendChild(av);
          post[i].getElementsByTagName('dl')[0].insertBefore(dd,post[i].getElementsByTagName('dd')[1]);
      }
    });

    Put that in a JS file, and have it running 'only in topics'. You can add it to an existing one if you have one.
    avatar
    Yous000
    Forumember


    Posts : 240
    Reputation : 4
    Language : English

    Solved Re: Moving User Avatars with JavaScript

    Post by Yous000 Sun 6 May - 0:04

    LGforum wrote:
    Code:

    $(function(){
      var post = $('.postprofile');
      for(var i = 0, l = post.length; i<l; i++) {
          var av = post[i].getElementsByTagName('a')[0];
          var dd = document.createElement('dd').appendChild(av);
          post[i].getElementsByTagName('dl')[0].insertBefore(dd,post[i].getElementsByTagName('dd')[1]);
      }
    });

    Put that in a JS file, and have it running 'only in topics'. You can add it to an existing one if you have one.

    Works like a CHARM! I now forever love you. This should be made into an official forumotion tutorial. :wouhou:
    Jophy
    Jophy
    ForumGuru


    Male Posts : 17922
    Reputation : 836
    Language : English
    Location : Somewhere

    Solved Re: Moving User Avatars with JavaScript

    Post by Jophy Sun 6 May - 7:27

    Topic Solved & Locked

      Current date/time is Mon 23 Sep - 21:22