Latest topics
» [GAME] Post a random picture
by Valoish Yesterday at 18:35

» [GAME] this or that
by Valoish Yesterday at 18:35

» [GAME] Never have I ever..
by Valoish Yesterday at 18:34

» [GAME] Last Letter Game
by Valoish Yesterday at 18:34

» [GAME] Count to 999 using odd numbers Van-Helsing Edition
by Valoish Yesterday at 18:33

» [GAME] World Snake
by Valoish Yesterday at 18:33

» [GAME] Animal Game
by Valoish Yesterday at 18:33

» [GAME] Count to 1000 using even numbers Van-Helsing Edition
by Valoish Yesterday at 18:32

» [GAME] Count to One Million!
by Valoish Yesterday at 18:32

» [GAME] Countdown from 200,000
by Valoish Yesterday at 18:32

» [GAME] Q&A
by Valoish Yesterday at 18:32

» [GAME] Count to 30 - Ange Edition
by Valoish Yesterday at 18:26

» Widget : Member Statistics
by kian3210 Yesterday at 18:04

» Personal Emoticons
by Valoish Yesterday at 18:00

» Image Resizer
by Samantha NL Yesterday at 17:18

Recent Tutorials
Who is online?
In total there are 5 users online :: 0 Registered, 0 Hidden and 5 Guests

None

[ View the whole list ]


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

Display user activity in the profile

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome 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

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
Rhino.Freak

Title :
Lord of the 7 kingdoms and protector of the realm
Gender : Male
Age : 20
Posts : 274
Points : 1554
Reputation : 85
Location : India!
Language : English, Hindi
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://tokyoghoular.foruns.com.pt/

PostRhino.Freak on Tue 27 Jan 2015, 02:10

zomg! Added right away! Very Happy it looks so pro and stuff XD
THANK YOU ^^
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 12:44

You're welcome, I'm happy you like it ! Mr. Green

I used my boring style for the design, washed out colors and grays ! Razz
brandon_g

Title :
Gender : Unspecified
Age : 19
Posts : 431
Points : 1323
Reputation : 62
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://broadcastingduo.forumotion.com

Postbrandon_g on Tue 27 Jan 2015, 21:01

But its ok to use boring colors as long as you can make all from scratch, which I assume you do. Useful feature by the way!

-Brandon
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 27 Jan 2015, 21:10

Thanks ! ^^

Yep, I like to start from scratch, the only thing that wouldn't be mine would be the idea. The idea was actually given to me by a support topic, and I figured it would be a nice little feature.. Smile
brandon_g

Title :
Gender : Unspecified
Age : 19
Posts : 431
Points : 1323
Reputation : 62
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://broadcastingduo.forumotion.com

Postbrandon_g on Tue 27 Jan 2015, 21:13

An idea is only as good as the person who can make reality. Very Happy
Luke Spike
New Member
Title :
Design Addict
Gender : Male
Posts : 9
Points : 675
Reputation : 0
Location : Paradise
Language : English
Browser : Browser : Google Chrome Forum Version : Forum Version : punBB
Awards :
View all awards
View user profile

PostLuke Spike on Fri 06 Feb 2015, 16:45

Not working for me... Any specific version this code was for?
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Fri 06 Feb 2015, 17:00

@Luke Spike wrote:Not working for me... Any specific version this code was for?
It has been optimized for all versions, however, if you've heavily modified the templates, or are using the simple profile it wont work. Check to see if you're using the advanced profil :
Administration Panel > Users and groups > Profiles > General options

Activate advanced profile : Yes
Luke Spike
New Member
Title :
Design Addict
Gender : Male
Posts : 9
Points : 675
Reputation : 0
Location : Paradise
Language : English
Browser : Browser : Google Chrome Forum Version : Forum Version : punBB
Awards :
View all awards
View user profile

PostLuke Spike on Sat 07 Feb 2015, 11:37

@Ange Tuteur wrote:
@Luke Spike wrote:Not working for me... Any specific version this code was for?
It has been optimized for all versions, however, if you've heavily modified the templates, or are using the simple profile it wont work. Check to see if you're using the advanced profil :
Administration Panel > Users and groups > Profiles > General options

Activate advanced profile : Yes
I'm using the advanced profile and successfully installed the codes, but it's still not working. silent
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sat 07 Feb 2015, 21:39

@Luke Spike wrote:installed the codes, but it's still not working. silent
Could you provide the URL of your forum ?

Thanks Smile
Van-Helsing

Title :
Coding Expert.
I.T Manager.
Web Developer.
Gender : Male
Age : 42
Posts : 765
Points : 2022
Reputation : 69
Location : Somewhere out there!
Language : English, Greek
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : punBB
Awards :
View all awards
View user profile

PostVan-Helsing on Sun 08 Feb 2015, 20:11

It is perfect I already added.

--------

refresh101
Member
Title :
Gender : Unspecified
Posts : 16
Points : 688
Reputation : 3
Language : Filipino,English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postrefresh101 on Fri 03 Apr 2015, 12:27

doesn't work Sad it only displayed the last active not the user activity but it will load for a short time and suddenly will disappear
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sat 04 Apr 2015, 17:17

@refresh101 Are you using the advanced profile ? I so, can you access /viewonline on your forum ? For example : http://fmdesign.forumotion.com/viewonline
refresh101
Member
Title :
Gender : Unspecified
Posts : 16
Points : 688
Reputation : 3
Language : Filipino,English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postrefresh101 on Sun 05 Apr 2015, 00:04

yes i already activated it but it doesnt work Sad
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 07 Apr 2015, 17:05

Can I have a link to your forum ?

Thanks Smile
refresh101
Member
Title :
Gender : Unspecified
Posts : 16
Points : 688
Reputation : 3
Language : Filipino,English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postrefresh101 on Tue 07 Apr 2015, 21:30

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

PostAnge Tuteur on Thu 09 Apr 2015, 01:09

Is this page available ?
http://hunterxroleplay.forumh.net/viewonline

Sorry, I cannot tell myself as it requires logging it.
refresh101
Member
Title :
Gender : Unspecified
Posts : 16
Points : 688
Reputation : 3
Language : Filipino,English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postrefresh101 on Sat 11 Apr 2015, 22:37

yeah yeah it is available
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome 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 13 Apr 2015, 23:01

If you're using the advanced profile, and you can see /viewonline, then it should work without problem. You installed it in all the pages, correct ? If this is still occurring, could you provide a test account so I can get a better idea of what's going on ?

Thanks
refresh101
Member
Title :
Gender : Unspecified
Posts : 16
Points : 688
Reputation : 3
Language : Filipino,English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postrefresh101 on Tue 14 Apr 2015, 19:59

does not work ange it shows only the time not the users activity?

test account pm sent
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 15 Apr 2015, 03:04

Users don't have the rights to access viewonline. Make sure to enable it here :
Administration Panel > Users and Groups > Special rights

Users status display : At least Members
refresh101
Member
Title :
Gender : Unspecified
Posts : 16
Points : 688
Reputation : 3
Language : Filipino,English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postrefresh101 on Wed 15 Apr 2015, 03:32

still not working?

Once it loads the activity will appear but when the forum dones loading it will disappear?
FrOsTyXi
New Member
Title :
Gender : Unspecified
Posts : 8
Points : 630
Reputation : 2
Language : English
Browser : Browser : Google Chrome Forum Version : Forum Version : punBB
Awards :
View all awards
View user profile

PostFrOsTyXi on Fri 17 Apr 2015, 08:20

This is a nice feature I like it Thank you!
FiB

Title :
Gender : Male
Posts : 172
Points : 928
Reputation : 13
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://www.ourbulgariaforum.com

PostFiB on Fri 17 Apr 2015, 17:36

Can this be set so only admin can see it?
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4074
Points : 8361
Reputation : 1999
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sun 19 Apr 2015, 15:50

@FiB right before the following code :
Code:
var b = document.createElement('DIV'),

add this line :
Code:
if (_userdata.user_level != 1) return;

so it looks like this. Wink
Code:
if (_userdata.user_level != 1) return;
var b = document.createElement('DIV'),

Page 1 of 2 1, 2  Next

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