1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can anyone help me out with this?

Discussion in 'XenForo Development Discussions' started by Adrian i10, Dec 10, 2014.

  1. Adrian i10

    Adrian i10 Member

    Basically I have replaced all avatars in the forum for xbox live avatars by replacing all the <xen:avatar... tags in the templates with something like this :

    http://avatar.xboxlive.com/avatar/{$user.username}/avatar-body.png


    tukie2.png


    However I can't do the same with the autocomplete functions since i'm pretty sure the code is in the JS. Can someone help me in pointing me in the right direction? Thank you in advance

    tukie.png
     
  2. batpool52!

    batpool52! Well-Known Member

    Would require js file edit. If you want to do it, then
    Code:
    js/xenforo/full/xenforo.js
    Find:
    Code:
    .prepend($('<img class="autoCompleteAvatar" />').attr('src', result['avatar']));
    Replace with:
    Code:
    .prepend($('<img class="autoCompleteAvatar" />').attr('src', 'http://avatar.xboxlive.com/avatar/' + result['username'] + '/avatar-body.png'));
     
    Adrian i10 likes this.
  3. Nobita.Kun

    Nobita.Kun Well-Known Member

    Another way. You should extends this class: XenForo_ViewPublic_Member_Find

    And replace the avatarUrl by your URL. This way you do not edit js file.
     
    Adrian i10 likes this.
  4. Adrian i10

    Adrian i10 Member

    Could you please elaborate more on this?
     
  5. Nobita.Kun

    Nobita.Kun Well-Known Member

    Have you expirence with PHP?
     
  6. Adrian i10

    Adrian i10 Member

    Actually I used Batpool's method, but the file that had to be edited was :

    js/xenforo/xenforo.js

    Everything works now, thank you both for taking the time to help me!
     
  7. batpool52!

    batpool52! Well-Known Member

    I'm uploading a resource for you, it doesn't require a single file edit so you should be good to go for future xenforo upgrades. If you know php then you can understand what is in the code.
     
    wickedstangs likes this.
  8. batpool52!

    batpool52! Well-Known Member

  9. Adrian i10

    Adrian i10 Member

  10. batpool52!

    batpool52! Well-Known Member

    Updated and added option to change the avatar type. Please suggestions on my add-on threads.
     
    Adrian i10 likes this.

Share This Page