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.

Display user activity in the profile

View previous topic View next topic Go down

Solved Display user activity in the profile

Post by smurfavr on September 10th 2015, 2:05 pm

Can I make the information to be displayed as I have shown in the picture?
http://fmdesign.forumotion.com/t280-display-user-activity-in-the-profile

This information can you appear in the user's profile when viewing a topic is posted in this forum.


Last edited by smurfavr on October 4th 2015, 11:09 am; edited 1 time in total

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by APE on September 10th 2015, 3:21 pm

The data is saved on your V wall and i don't think that can be moved to your post profile sorry





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on September 10th 2015, 3:23 pm

If the code be changed?

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on September 11th 2015, 3:26 pm

Up

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on September 29th 2015, 12:46 pm

Up

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on October 1st 2015, 11:44 am

Up

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by Gytha on October 1st 2015, 3:51 pm

I don't understand what's the issue here. If you install the plugin following the instructions, the user activity display should show nicely.

Gytha
New Member

Posts : 1
Reputation : 1
Language : English

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on October 1st 2015, 4:39 pm

I want to show otherwise.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by APE on October 1st 2015, 8:07 pm

This is what the member is wanting for the data seen in the main profile to be shown in the post profile





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on October 3rd 2015, 3:03 pm

@Ange Tuteur Can you help?

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by Ange Tuteur on October 3rd 2015, 5:01 pm

Hi @smurfavr,

Go to Modules > JavaScript codes management > Create a new script

Placement : In the topics
Code:
$(function() {
  var viewing = 'Viewing',
      users = {}, row, name, profile, i, j;
 
  $.get('/viewonline?change_version=prosilver', function(d) {

    row = $('.table1 tbody tr', d);
    for (i = 0, j = row.length; i < j; i++) {
      name = row[i].firstChild.getElementsByTagName('A')[0];
      if (name) users[$(name).text()] = row[i].lastChild.innerHTML;
    }

    profile = $('.poster-profile');
    for (i = 0, j = profile.length; i < j; i++) {
      name = $(profile[i].parentNode.firstChild).text();
      if (users[name]) profile[i].insertAdjacentHTML('beforeEnd', '<span class="label">' + viewing + ': </span>' + users[name]);
    }
  });

});

It should add a new field at the bottom, BUT since you have to send a request to the who is online page, it'll always show yourself viewing that page when you're reading one of your posts.


This'll most likely do the same thing for other users if they're viewing a topic, since a request must be sent to that page to see the status of each user.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on October 3rd 2015, 5:13 pm

Do not you understand me what I want. I want this information to be depicts the profile of the users when I read their topics.
Code:
window.location.pathname.match(/\/u\d+/) && $(function() {
  var b = document.createElement('DIV'),
  lang = {
    activity : 'Activity',
    loading : 'Checking activity...',
    offline : 'Offline',
    last : 'Last active',
    none : 'No recent activity...'
  }, placeholder = '<p class="viewing"><a href="#" onclick="return false;" class="loading">'+lang.loading+'</a><span class="lastactive">'+lang.last+' : '+lang.loading+'</span></p>',bb2;
 
  b.innerHTML = '<div style="background:#EEE;border:1px solid #CCC;margin:3px 0;padding:3px;color:#F66;text-align:center;"><div style="border-bottom:1px solid #CCC;text-align:left;">ERROR</div>Your template is not supported for the activity module. For assistance or information please <a href="http://fmdesign.forumotion.com/t280-display-user-activity-in-the-profile" target="_blank" style="color:#069">click here</a>.</div>';
  document.getElementById('wrap') && (b.innerHTML = '<div class="module"><div class="inner"><span class="corners-top"><span></span></span><div class="h3">'+lang.activity+'</div>'+placeholder+'<span class="corners-bottom"><span></span></span></div></div>');
  document.getElementById('ipbwrapper') && (b.innerHTML = '<div class="module borderwrap"><div class="maintitle"><h3>'+lang.activity+'</h3></div><div class="box-content profile center">'+placeholder+'</div></div>');
  $('.pun').length && (b.innerHTML = '<div class="module main" style="margin-bottom:4px !important;"><div class="main-head"><div class="h3">'+lang.activity+'</div></div><div class="main-content clearfix center">'+placeholder+'</div></div>');
  $('.bodylinewidth').length && (b.innerHTML = '<div style="height:3px;"></div><table class="forumline" border="0" cellpadding="0" cellspacing="1" width="100%"><tbody><tr><td class="catLeft"><span class="genmed module-title">'+lang.activity+'</span></td></tr><tr><td class="row1 gensmall" align="center">'+placeholder+'</td></tr></tbody></table>', bb2 = true);
 
  $('#profile-advanced-right .module:first, td[width="300"] .forumline:first').after(b);
  $.get('/viewonline',function(data) {
    var p = b.getElementsByTagName('P')[0], c = 'tr:has(a[href="/u'+window.location.pathname.match(/u(\d+)/)[1]+'"]) td';
    bb2 && (c = '.three-col table:has(.nav) + table ' + c);
    p.innerHTML = $(c+':last',data).html();
    !p.innerHTML.length ? p.innerHTML = '<a href="#" onclick="return false;" class="inactive">'+lang.offline+'</a><div class="lastactive">'+lang.last+' : '+lang.none+'</div>' : p.innerHTML += '<div class="lastactive">'+lang.last+' : ' + $(c+':eq(1)',data).html() + '</div>';
  });
});

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by Ange Tuteur on October 3rd 2015, 6:10 pm

Replace the script I gave you with this one :
Code:
$(function() {
  var lang = {
        activity : 'Activity',
        none : 'No recent activity',
       
        last : 'Last Active',
        offline : 'offline'
      },
      users = {}, row, name, profile, i, j;
 
  $.get('/viewonline?change_version=prosilver', function(d) {

    row = $('.table1 tbody tr', d);
    for (i = 0, j = row.length; i < j; i++) {
      name = row[i].firstChild.getElementsByTagName('A')[0];
      if (name) users[$(name).text()] = row[i];
    }

    profile = $('.poster-profile');
    for (i = 0, j = profile.length; i < j; i++) {
      name = $(profile[i].parentNode.firstChild).text();
      if (users[name]) profile[i].insertAdjacentHTML('beforeEnd', '<span class="label">' + lang.activity + ': </span>' + users[name].lastChild.innerHTML + '<br/><span class="label">' + lang.last + ': </span>' + users[name].firstChild.nextSibling.innerHTML);
      else profile[i].insertAdjacentHTML('beforeEnd', '<span class="label">' + lang.activity + ': </span>' + lang.none + '<br/><span class="label">' + lang.last + ': </span>' + lang.offline);
    }
  });

});

It should display the same information as the module I made. Example :

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on October 4th 2015, 12:12 am

It works, but each profile is displayed and no matter what their location in the user forum ..
Activity: who is online

psp
As a user is offline in the field of profile does not display the date but it is offline.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by Ange Tuteur on October 4th 2015, 10:44 am

@smurfavr wrote:It works, but each profile is displayed and no matter what their location in the user forum ..
Activity: who is online
Yes, that is a problem I mentioned. The problem is when you view the topic you have to send a request to the /viewonline page to get the proper data. This unfortunately counts as "viewing" that page. So, if other members are viewing a topic the script will do the same for them as well.

@smurfavr wrote:psp
As a user is offline in the field of profile does not display the date but it is offline.
The "last active" data is retrieved from /viewonline, if the user is not in the list they're considered "offline"

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Display user activity in the profile

Post by smurfavr on October 4th 2015, 11:09 am

Thank you Ange Tuteur.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: Display user activity in the profile

Post by SLGray on October 4th 2015, 4:34 pm

Topic solved and archived



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35670
Reputation : 2375
Language : English
Location : United States

http://fmthemes.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