Latest topics
» help me about Latest topic
by Haytam Today at 12:47

» Display a preview of the user profile on hover
by Haytam Today at 12:39

» Starred Forums
by Ange Tuteur Today at 12:27

» Chit Chat Thread
by Ange Tuteur Today at 12:11

» Colored Bar Navigation
by Valoish Yesterday at 23:03

» FM Themes
by SLGray Thu 25 May 2017, 22:39

» User - Made Creations
by SLGray Thu 25 May 2017, 22:37

» Classified Ads
by SLGray Thu 25 May 2017, 19:23

» Categories as tabs on Edge!
by STBW Thu 25 May 2017, 04:11

» [GAME] What are you thinking right now?
by Ange Tuteur Wed 24 May 2017, 15:10

» [GAME] Countdown from 200,000
by Ange Tuteur Wed 24 May 2017, 15:09

» [GAME] Post a random picture
by Ange Tuteur Wed 24 May 2017, 15:08

» [GAME] What are you doing right now?
by Ange Tuteur Wed 24 May 2017, 15:06

» [GAME] Count to 30 - Ange Edition
by Ange Tuteur Wed 24 May 2017, 15:05

» [GAME] Count to One Million!
by Ange Tuteur Wed 24 May 2017, 15:05

Recent Tutorials
Who is online?
In total there are 9 users online :: 2 Registered, 0 Hidden and 7 Guests :: 2 Bots

Haytam, Luffy

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Display user activity in the profile

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4544
Points : 9370
Reputation : 2294
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Mon 26 Jan 2015, 23:26

First topic message reminder :

The purpose of this plugin is to show the activity of the user whose profile you're currently viewing. The data is retrieved from the viewonline page and displayed in a new module just below the basic user data. Take the preview below as an example.


This plugin is optimized for all forum versions. So long as you haven't heavily modified your templates, it'll work without issues. You should also make sure the advanced profile is enabled. Go to Administration Panel > Users and Groups > Profiles > General Options, choose "yes" for "Activate advanced profile" and save.


Installation

To install this plugin go to Administration Panel > Modules > JavaScript codes management, and create a new script.

Title : Your choice
Placement : In all the pages
Paste the code below and submit :
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>';
  });
});


If you'd like the style in the preview go to Administration Panel > Display > Colors > CSS stylesheet and paste the following code.
Code:
.viewing a, .viewing .lastactive { color:#999; text-shadow:1px 1px 0 #FFF; text-decoration:none; text-align:center; font-size:11px; font-weight:bold; background:#EEE; border:1px solid #CCC; border-radius:3px; display:block; padding:5px 3px; margin:5px 0; }
.viewing a { color:#696 !important }
.viewing a.loading { color:#996 !important }
.viewing a.inactive { color:#C66 !important }


Information

At the top of the script you will notice a list of language data. If your forum is in another language, or you just want to change the default texts, the portion below is what you should modify.
Code:
  lang = {
    activity : 'Activity', // module title
    loading : 'Checking activity...', // loading texts
    offline : 'Offline', // displayed if user is offline
    last : 'Last active', // last activity texts
    none : 'No recent activity...' // displayed if user is offline
  }


If you have any questions or comments, feel free to leave them below. Have fun, and enjoy ! Mr. Green


Notice
Tutorial written by Ange Tuteur.
Reproduction not permitted without consent from the author.


Last edited by Ange Tuteur on Tue 15 Mar 2016, 06:21; edited 1 time in total

avatar
FiB

Title :
Gender : Male
Posts : 182
Points : 1126
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://www.ourbulgariaforum.com

PostFiB on Sun 19 Apr 2015, 17:50

Thank you
avatar
Theshaka

Title :
Gender : Male
Age : 22
Posts : 31
Points : 1131
Reputation : 0
Language : Polish,English,French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://seiya.forumotion.com/

PostTheshaka on Sat 02 May 2015, 06:19

It almost work, almost because it saying all time "Viewing the forum index" even if i viewing something else.
And when you're offline it not show last active time just saying "Last active : No recent activity..."
avatar
Theshaka

Title :
Gender : Male
Age : 22
Posts : 31
Points : 1131
Reputation : 0
Language : Polish,English,French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://seiya.forumotion.com/

PostTheshaka on Sat 16 May 2015, 16:01

@Theshaka wrote:It almost work, almost because it saying all time "Viewing the forum index" even if i viewing something else.
And when you're offline it not show last active time just saying "Last active : No recent activity..."
up?
avatar
Beyonder
Member
Title :
Gender : Male
Age : 20
Posts : 18
Points : 1163
Reputation : 6
Location : Beyond Realm
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://narutorpguniverse.forumotion.com

PostBeyonder on Fri 29 May 2015, 13:15

I will be using this for my Advertise forum! Very Happy
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 751
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Wed 02 Sep 2015, 18:26

This information can you appear in the user's profile when viewing a topic is posted in this forum.
avatar
Andrei34

Gender : Male
Posts : 170
Points : 937
Reputation : 56
Language : Romanian and English
Browser : Browser : Google Chrome Forum Version : Forum Version : punBB
Awards :
View all awards
View user profile

PostAndrei34 on Thu 03 Sep 2015, 12:15

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

What do you mean?
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 751
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 03 Sep 2015, 12:45

The information is displayed in the user's profile in the forum. As I have shown in the photo.
avatar
Royal Bengal

Title :
Gender : Male
Age : 28
Posts : 66
Points : 547
Reputation : 0
Language : English, hindi
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

PostRoyal Bengal on Fri 04 Mar 2016, 21:20

@Ange Tuteur this code is not working in my forum too. Just it is showing a bar under the user's profile. Give me solution. Forum link http://avacs.yforum.biz

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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