FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 70 users online :: 0 Registered, 0 Hidden and 70 Guests :: 2 Bots

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

Display how many times a profile was viewed

View previous topic View next topic Go down

Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12253
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Fri 30 Jan 2015, 00:08

This plugin will allow you to display and log how many times someones profile was viewed. This is the first plugin for the database which will work on any version. Wink

Display how many times a profile was viewed Captur51


Creating a new table

If you haven't set up your database, please read over this topic : https://fmdesign.forumotion.com/t281-installation-a-database-for-your-forumotion-forum

Otherwise, go to your database, and click "New table" to create a new database table. In the textarea, paste the following code, and click submit.
Code:
[table id="fa_views" class="database_table"][tr][td]Username[/td][td]Views[/td][/tr][/table]

Display how many times a profile was viewed Captur52

Let it process your request, and the new table should be ready for us to use. Smile


Installation

If you want the style for the view module like in the example, go to Administration Panel > Display > Colors > CSS stylesheet, and paste the following code.
Code:
.fa_views { 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; }


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

Title : fa_views
Placement : In all the pages
Code:
window.location.pathname.match(/\/u\d+/) && $(function() {
  var pid = 279, uid = window.location.pathname.match(/u(\d+)/)[1], mod = '#profile-advanced-right .module:first',n;
  $('.bodylinewidth').length && (mod = 'td[width="300"] .forumline:first td.row1.gensmall');
  $('.pun').length && (mod = '#profile-advanced-right .module:first .main-content');
  $(mod).append('<div class="fa_views">Profile views : <span id="view_total">0</span></div>');
  $.get(_database.tid, function(data) {
    n = $('#fa_views #u'+uid+'_views',data);
    n.length ? n = Number(n.text()) + 1 : n = 1;
    document.getElementById('view_total').innerHTML = n;
    _database.post({
      pid : pid,
      tableid : 'u'+uid+'_views',
      update : ['\\[td id="u'+uid+'_views"\\]\\d+\\[/td\\]','[td id="u'+uid+'_views"]'+n+'[/td]'],
      newRow : '[tr][td]'+document.title.match(/^.*? - (.*)$/)[1]+'[/td][td id="u'+uid+'_views"]'+n+'[/td][/tr]'
    });
  });
});

In the script, where you see YOUR_PID, you need to replace this by your database table's post ID. To find this ID click "edit database", then edit the post which holds your new table. Right in the address bar will be your PID, copy and paste this where YOUR_PID is.
Display how many times a profile was viewed Captur53

When you're finished, save the script, and you should be ready to go ! To ensure that the installation was successful, make your way to a few profiles, and then return to your database. If the installation was successful, you'll see those profiles logged in the database table. Thumb left
Display how many times a profile was viewed Captur55



If any problems or questions, let me know. Enjoy ! Mr. Green
Beyonder
Beyonder
Member
Gender : Male
Age : 28
Posts : 18
Points : 3899
Reputation : 6
Location : Beyond Realm
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://narutorpguniverse.forumotion.com

PostBeyonder Sat 30 May 2015, 01:19

Does it take long for a new table?
Beyonder
Beyonder
Member
Gender : Male
Age : 28
Posts : 18
Points : 3899
Reputation : 6
Location : Beyond Realm
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://narutorpguniverse.forumotion.com

PostBeyonder Sat 30 May 2015, 15:00

Sad it isnt working for me.
Beyonder
Beyonder
Member
Gender : Male
Age : 28
Posts : 18
Points : 3899
Reputation : 6
Location : Beyond Realm
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://narutorpguniverse.forumotion.com

PostBeyonder Sun 26 Jul 2015, 07:30

Bump?
Sponsored content

PostSponsored content

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