Moving User Avatars with JavaScript

Go down

Solved Moving User Avatars with JavaScript

Post by Yous000 on May 5th 2012, 10:21 pm

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.
avatar
Yous000
Forumember

Posts : 240
Reputation : 4
Language : English

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Sir Chivas™ on May 5th 2012, 10:23 pm

Hi, Hello

You can simply change the Version of your forum mate. Wink
Sir Chivas™
Sir Chivas™
Helper
Helper

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

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Yous000 on May 5th 2012, 10:46 pm

@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.
avatar
Yous000
Forumember

Posts : 240
Reputation : 4
Language : English

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Sir Chivas™ on May 5th 2012, 10:48 pm

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

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

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Yous000 on May 5th 2012, 11:13 pm

@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
avatar
Yous000
Forumember

Posts : 240
Reputation : 4
Language : English

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Sir Chivas™ on May 5th 2012, 11:20 pm

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
Sir Chivas™
Sir Chivas™
Helper
Helper

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

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by LGforum on May 5th 2012, 11:48 pm

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.

LGforum
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Yous000 on May 5th 2012, 11:50 pm

@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
avatar
Yous000
Forumember

Posts : 240
Reputation : 4
Language : English

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by LGforum on May 5th 2012, 11:58 pm

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.
LGforum
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Yous000 on May 6th 2012, 12:04 am

@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:
avatar
Yous000
Forumember

Posts : 240
Reputation : 4
Language : English

Back to top Go down

Solved Re: Moving User Avatars with JavaScript

Post by Jophy on May 6th 2012, 7:27 am

Topic Solved & Locked
Jophy
Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

Back to top


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