IMPORTANT

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

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Fri 08 Jun 2018, 11:02

» 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

» Numbering of messages in the topic
by SLGray Mon 04 Dec 2017, 22:40

Recent Tutorials
Top posting users this month

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

None

[ View the whole list ]


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

Display how many times a profile was viewed

View previous topic View next topic Go down

avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4733
Points : 9875
Reputation : 2366
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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



Creating a new table

If you haven't set up your database, please read over this topic : http://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]


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.


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



If any problems or questions, let me know. Enjoy ! Mr. Green

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Beyonder
Member
Gender : Male
Age : 21
Posts : 18
Points : 1581
Reputation : 6
Location : Beyond Realm
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
View user profile http://narutorpguniverse.forumotion.com

PostBeyonder on Sat 30 May 2015, 01:19

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

PostBeyonder on Sat 30 May 2015, 15:00

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

PostBeyonder on 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