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


    JS code for user infos

    avatar
    • ***


        Reputation : 0
        Registered on : 2015-05-26
        Posts : 27
        Love Fmcodes
      Hi,

      I searched for variables and have found this:
      https://www.fmcodes.com/t987p15-forumotion-variables

      On second page @ionuz posted a code for user infos. Does anyone know how to add the rank of the user?

      Greetings

      avatar
      • Veteran staff member

          Reputation : 8
          Registered on : 2012-04-07
          Posts : 173
          Its Yoshi Time
        Hello,
        I think doesn't exist any variable for user rank in forumotion. :/

        avatar
        • ***


            Reputation : 0
            Registered on : 2015-05-26
            Posts : 27
            Love Fmcodes
          I searched for it and think you're right. But how can I add the rank to the script? In the toolbar after clicking on "Welcome XY" you can see the rank, so it must be somehow possible. :D

          avatar
          • Veteran staff member

              Reputation : 8
              Registered on : 2012-04-07
              Posts : 173
              Its Yoshi Time
            I'm going to investigate that.. ;)


            So be patient

            EDIT: Here's a code, that you can try:

            Code:
            $(_lang.rank_title).text()

            If you have set the rank, it will show the name Wink

            You can test in the console with a alert:

            Code:
            alert($(_lang.rank_title).text())

            And remember: You need the Toolbar activated to work this

            avatar
            • ***


                Reputation : 0
                Registered on : 2015-05-26
                Posts : 27
                Love Fmcodes
              Thank you for your answer! But I don't understand you.
              Should I insert your code like the following? That doesn't work. :/

              Code:
              $(function() {
                 var a = _userdata.user_posts,b=_userdata.user_nb_privmsg,c=_userdata.point_reputation,d=$(_lang.rank_title).text();
                 // A = User Post on the forums, B = User PM, C = User like given, D = Rank Title.
                 e = document.getElementById('user_infos'); // Get of elements
                 e.innerHTML = '<b>Beiträge:</b> '+ a +'<br /><b>PNs:</b> '+ b +'<br /><b>Bewertung:</b> '+ c +<br /><b>Rang:<b/> ' + d +'';
              });

              avatar
              • ***


                  Reputation : 0
                  Registered on : 2015-05-26
                  Posts : 27
                  Love Fmcodes
                bump

                avatar
                • ***


                    Reputation : 0
                    Registered on : 2015-05-26
                    Posts : 27
                    Love Fmcodes
                  bump

                  avatar
                  • Administrator

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

                    do you have your toolbar enabled?



                    Niko wants you in the team Guest

                    Community manager and Administrator at Forumattivo.com

                    avatar
                    • ***


                        Reputation : 0
                        Registered on : 2015-05-26
                        Posts : 27
                        Love Fmcodes
                      Yes, but since the problem is solved, the topic can be closed. :D

                      avatar
                      • Administrator

                          Reputation : 315
                          Registered on : 2012-02-22
                          Posts : 2317
                          School of codes courses: coming soon
                        Sorry, I have been busy this months with my support forum :(



                        Niko wants you in the team Guest

                        Community manager and Administrator at Forumattivo.com

                        avatar
                        • Veteran staff member

                            Reputation : 8
                            Registered on : 2012-04-07
                            Posts : 173
                            Its Yoshi Time
                          The question(s) in this topic have been answered and the owner has been able to solve the problem. Because of this, the topic has been locked.

                          If you have other questions, please open a new topic.


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