MyBB Community Forums

Full Version: Can we have a image as a username?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

I wanted to know if we can have our username as a image.eg:www.soft32.proboards85.com This used to be my forum before I switched to MyBB.You can see the name of tristam is a image.I would like to know if we could do this in MyBB.
This is the code used in proboards's global footers

<script type="text/javascript">
<!--
/* image as username */
function userImage(user,image) {
var img = document.createElement('img');
 img.src = image;
 img.border = '0';
var a = document.getElementsByTagName('a');
 for(i=0; i<a.length; i++) {
  if(a.item(i).href.match(new RegExp('viewprofile&user='+user+'$')))
   a[i].replaceChild(img.cloneNode(true), a[i].firstChild);
  }
}

userImage('admin','http://i94.photobucket.com/albums/l82/tristam_2006/tristam2.gif');

//-->
</script>



If this feature is available in MyBB please let me know or if the feature can be implemented.

Thanking You for your time,
Tristam
You'd need a modification to do that. You might be able to modify your current javascript to make it work. For example, perhaps try changing this line:
  if(a.item(i).href.match(new RegExp('viewprofile&user='+user+'$')))
to
  if(a.item(i).href.match(new RegExp('action=profile&uid='+user+'$')))
Its not working, it makes no difference.
1) Take that script and modify it as a separate page, so it accepts the username as a variable. (like, avatar.php?name=whatever)

2) Put this for the username style:
<img src='scriptlocation/avatar.php?name={username}' />

I hope that works!
Can you be more specific I don't get it