The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Homepage Points Display

View previous topic View next topic Go down

Solved Homepage Points Display

Post by Ace 1 on October 2nd 2015, 5:22 pm

Any way I can use the current forumotion homepage user information, but with Rank, Posts, and PMs, Points Count is also displayed.

Anyone know lol?


Last edited by Ace 1 on October 2nd 2015, 5:54 pm; edited 1 time in total

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Homepage Points Display

Post by Ange Tuteur on October 2nd 2015, 5:43 pm

As far as I know, there isn't any data for that in the _userdata object. You can see what data is available by right clicking and going to "view page source", you can also press ctrl+u. All the data will be after :
Code:
var _userdata = new Object();

Example in Chrome :


If you wanted the points value, you'll most likely have to pull it from the user's profile via AJAX. Like this :
Code:
$(function() {
  var points,
      storage = window.localStorage,
      node = document.getElementById('pointsValue'),
      cache = 1*60*60*1000; // hh*mm*ss*ms

  if (node && storage && storage.faUserPts && storage.faUserPtsExp > +new Date - cache) node.innerHTML = storage.faUserPts;
  else $.get('/u' + _userdata.user_id, function(d) {
    points = $('#field_id-13', d)[0];

    if (points) {
      points = points.lastChild.firstChild.innerHTML;
      if (node) node.innerHTML = points;

      if (storage) {
        storage.faUserPts = points;
        storage.faUserPtsExp = +new Date;
      }
    }

  });
});
( You'll want to place this in the homepage )

Then you can add this element which the value will be applied to :
Code:
<span id="pointsValue">0</span>

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Homepage Points Display

Post by Ace 1 on October 2nd 2015, 5:54 pm

Sorry for the off topic post on the other topic.

solved

Ace 1
Helper
Helper

Male Posts : 767
Reputation : 51
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Homepage Points Display

Post by Ange Tuteur on October 2nd 2015, 6:58 pm

No problem, don't worry about it. Smile

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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