HomeHome  
  • WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • FAQFAQ  
  • SearchSearch  
  • MemberlistMemberlist  
  • UsergroupsUsergroups  
  • RegisterRegister  
  • Log inLog in  
  • You are not connected. Please login or register


    Forumotion Variables

    avatar
    • *****


        Reputation : 11
        Registered on : 2014-04-25
        Posts : 153
        Love Fmcodes
      Hi, can someone tell me all the variables for profile, users, info (and avatar if its possible) such as 
      Code:
      {USERNAME}
      Code:
      {USERLINK}

      i want for example to use a variable for avatar so every user see his own avatar :)



      Last edited by J0k3R^ on Fri May 30, 2014 4:15 pm; edited 2 times in total

      avatar
      • Administrator

          Reputation : 315
          Registered on : 2012-02-22
          Posts : 2317
          School of codes courses: coming soon
        Hello

        there isn't a variable for avatar, but you can do it with javascript :Good:



        Niko wants you in the team Guest

        Community manager and Administrator at Forumattivo.com

        avatar
        • *****


            Reputation : 11
            Registered on : 2014-04-25
            Posts : 153
            Love Fmcodes
          I tried to figure out a code for avatar from the 'avatar on last post' tutorial but i didnt make any sense :D could u tell me how to do it please?

          avatar
          • Manager

              Reputation : 30
              Registered on : 2012-04-17
              Posts : 199
            Hello

            create a new javascript code:
            Code:
            $(function(){$(window).load(function(){var av=$('#fa_usermenu img:eq(0)').attr('src');$('#avatarvariable').prepend('<img src="'+av+'" class="fa_avatar" />')})});

            then, add this code where you want to have the avatar of the "user"



            Welcome on the forum of Codes
            avatar
            • Manager

                Reputation : 30
                Registered on : 2012-04-17
                Posts : 199
              Hello

              can this issue be considered solved?
              If not, please post a bump message withing 7 days to let us know you still need assistance

              Thank you very much thanks



              Welcome on the forum of Codes
              avatar
              • *****


                  Reputation : 11
                  Registered on : 2014-04-25
                  Posts : 153
                  Love Fmcodes
                Bump.

                avatar
                • Administrator

                    Reputation : 315
                    Registered on : 2012-02-22
                    Posts : 2317
                    School of codes courses: coming soon
                  Have you tried the resource of Tiffany?

                  JS code:
                  Code:
                  $(function(){$(window).load(function(){var av=$('#fa_usermenu img:eq(0)').attr('src');$('#avatarvariable').prepend('<img src="'+av+'" class="fa_avatar" />')})});

                  Code where you want the avatar:
                  Code:
                  <div id="avatarvariable"></div>



                  Niko wants you in the team Guest

                  Community manager and Administrator at Forumattivo.com

                  avatar
                  • *****


                      Reputation : 11
                      Registered on : 2014-04-25
                      Posts : 153
                      Love Fmcodes
                    im actually getting the icon of the 'broken image'

                    avatar
                    • Administrator

                        Reputation : 315
                        Registered on : 2012-02-22
                        Posts : 2317
                        School of codes courses: coming soon
                      use this instead:

                      Code:
                      $(document).ready(function(){
                          if (typeof _userdata === "undefined") return;
                          if (_userdata["session_logged_in"] == '1') {

                      var av=$('#fa_usermenu img:eq(0)').attr('src');
                      $('#avatarvariable').prepend('<img src="'+av+'" class="fa_avatar">');

                          };

                      });



                      Niko wants you in the team Guest

                      Community manager and Administrator at Forumattivo.com

                      avatar
                      • *****


                          Reputation : 11
                          Registered on : 2014-04-25
                          Posts : 153
                          Love Fmcodes
                        still didnt work

                        avatar
                        • Administrator

                            Reputation : 315
                            Registered on : 2012-02-22
                            Posts : 2317
                            School of codes courses: coming soon
                          try this? :O

                          Code:
                          $(document).ready(function(){

                          var av=$('#fa_usermenu img:eq(0)').attr('src');
                          $('#avatarvariable').prepend('<img src="'+av+'" class="fa_avatar">');

                          });



                          Niko wants you in the team Guest

                          Community manager and Administrator at Forumattivo.com

                          avatar
                          • *****


                              Reputation : 11
                              Registered on : 2014-04-25
                              Posts : 153
                              Love Fmcodes
                            nothing changed.. when i try "copy image url" i get this link "http://fmplanet.forumgreek.com/undefined" :/

                            avatar
                            • Administrator

                                Reputation : 315
                                Registered on : 2012-02-22
                                Posts : 2317
                                School of codes courses: coming soon
                              oh, tha'ts because you ...

                              anyway
                              here you are:
                              Code:
                              $(document).ready(function(){

                              var av=$('.ipsUserPhotoLink img').attr('src');
                              $('#avatarvariable').prepend('<img src="'+av+'" class="fa_avatar">');

                              });



                              Niko wants you in the team Guest

                              Community manager and Administrator at Forumattivo.com

                              avatar
                              • *****


                                  Reputation : 11
                                  Registered on : 2014-04-25
                                  Posts : 153
                                  Love Fmcodes
                                it didnt work and also it bugs some codes of my forum :P

                                avatar
                                • ****


                                    Reputation : 4
                                    Registered on : 2012-05-05
                                    Posts : 58
                                  JS Code:
                                  Code:
                                  $(function() {
                                     var avatars = $(_userdata.avatar).attr('src');
                                     document.getElementById('user_avatar').src = avatars;
                                  });

                                  HTML:
                                  Code:
                                  <img src="" id="user_avatar" />

                                  avatar
                                  • *****


                                      Reputation : 11
                                      Registered on : 2014-04-25
                                      Posts : 153
                                      Love Fmcodes
                                    thank u very much! :)
                                    the avatar works good now.
                                    Is it possible to add other variables like "posts" and PM's like this ?



                                    i think FMCodes is using the forumotion toolbar for this menu, i just want to know if its possible to add these things w/o the toolbar. that was my first question at this topic tho.

                                    avatar
                                    • ****


                                        Reputation : 4
                                        Registered on : 2012-05-05
                                        Posts : 58
                                      Yes is posible.
                                      JS:
                                      Code:
                                      $(function() {
                                         var a = _userdata.user_posts,b=_userdata.user_nb_privmsg,c=_userdata.point_reputation;
                                         // A = User Post on the forums, B = User PM, C = User like given.
                                         d = document.getElementById('user_infos'); // Get of elements
                                         d.innerHTML = 'Posts : <b>'+ a +'</b><br />PMs : <b>'+ b +'</b><br />Reputation : <b>'+ c +'</b>';
                                      });

                                      HTML:
                                      Code:
                                      <div id="user_infos"></div>

                                      avatar
                                      • *****


                                          Reputation : 11
                                          Registered on : 2014-04-25
                                          Posts : 153
                                          Love Fmcodes
                                        thank u buddy!! this is solved

                                        avatar
                                        • Administrator

                                            Reputation : 315
                                            Registered on : 2012-02-22
                                            Posts : 2317
                                            School of codes courses: coming soon
                                          THank you ionuz :Good:



                                          Niko wants you in the team Guest

                                          Community manager and Administrator at Forumattivo.com


                                          YOUR BANNER HERE
                                          728x90
                                          DMCA.com Protection Status
                                          Create a forum on Forumotion | © PunBB | Free forum support | Contact | Report an abuse | Free forum