Good art is a taste, good design is an opinion.


Come as guest, stay as family.
Board Index

Come as guest, stay as family.


You are not connected. Please login or register

Foto

[Javascript] How to put user avatars on custom locations



View previous topic View next topic Go down Message [Page 1 of 1]

1
Offline

  Shadow

Shadow
Administrator
Administrator

[Javascript] How to put user avatars on custom locations Alerte10

Tutorial: How to put user avatars on custom locations

A lot of people asked how to implement avatar on navigations, some separate pages, widgets, etc.

This is the easiest way to do so.



--> Tutorials, tips and tricks <--
How to put user avatars on custom locations



- Javascript
Placement: All pages

Code:
[panda=js]
//<![CDATA[
  $('span.PunBB-avatar').html('<a href="/u' + _userdata.user_id + '">' + _userdata.avatar + '<strong>' + _userdata.username + '</strong></a>');
//]]>


- HTML & CSS
Now in order to display an avatar, you just need to put
Code:
<span class="PunBB-avatar"></span>
to any template, widget, or page where HTML is enabled.

Furthermore you can style it with CSS
Code:
[panda=css].PunBB-avatar {
....
}




© PunBB Design


[Javascript] How to put user avatars on custom locations Act_bottom If you have any questions related to this topic create a topic with the following title:
How to put user avatars on custom locations

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

View previous topic View next topic Back to top Message [Page 1 of 1]


Topic URL's

URL
BBcode
HTML

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