Latest topics
» IconSkouliki Graphics
by skouliki Fri 20 Oct 2017, 05:08

» "Edit this page" feature
by skouliki Fri 20 Oct 2017, 01:37

» Dark Mode + Another Question
by Haggis Thu 19 Oct 2017, 10:36

» [GAME] Count to 1000 using even numbers Van-Helsing Edition
by Van-Helsing Tue 17 Oct 2017, 15:07

» [GAME] What are you thinking right now?
by Ace 1 Tue 17 Oct 2017, 08:09

» [GAME] Count to One Million!
by Ace 1 Tue 17 Oct 2017, 08:07

» [GAME] Last Letter Game
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] World Snake
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] Never have I ever..
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] Animal Game
by universecat Mon 16 Oct 2017, 21:43

» [GAME] Post a random picture
by SLGray Mon 16 Oct 2017, 16:28

» Hi everyone!
by skouliki Mon 16 Oct 2017, 02:01

» Hai Guys~
by skouliki Mon 16 Oct 2017, 01:59

» Add a login popup for the toolbar
by Ape Sun 15 Oct 2017, 13:51

» Mobile Usability Test
by Ange Tuteur Sat 14 Oct 2017, 11:20

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

None

[ View the whole list ]


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

Get member data

View previous topic View next topic Go down

avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
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 Sun 23 Nov 2014, 21:40

Hi,

This is a simple tool to gather the data of your members and place it into a table. The table can be posted in topics, or for personal use..


Demo

For a demo, follow this link : http://fmdesign.forumotion.com/h6-member-data
Total members : 10
Field ID1 : #field_id-6
Feild ID2 : leave blank
Click initialize to begin the process.

The result should output a bbcode table, similar to the one below.

UsernamePosts:
Ange Tuteur572
Deux14
The Tester4
Sugar3
mist3r0us_b0y62
HagoromoOtsutsuki0
masinho0
SLGray203
Sasori2
Zyon108
Insallation

Go to Administration Panel > Modules > HTML pages management > Create a new HTML page

Title : Your choice
Use your forum header : YES
Paste this and save :
Code:
<script type="text/javascript">requestTime = 3000 // time in between requests</script>
<style type="text/css">
.fieldLabel {
  display:inline-block;
  width:150px;
}
#orderData {
  width:100%;
  margin:4px 0;
}
</style><div style="width:50%;margin:0 auto;">
  <div><span class="fieldLabel">Total members : </span><input id="memCount" placeholder="0" type="text"/></div>
  <div><span class="fieldLabel">Field ID1 : </span><input id="data1" placeholder="#field_id-6" type="text"/></div>
  <div><span class="fieldLabel">Field ID2 (optional) : </span><input id="data2" placeholder="#field_id-13" type="text"/></div>
  
  <input id="initData" type="button" value="Initialize" />
  <br/><br/>
  <strong>Progress : </strong><span id="progress"></span>
  <br/>
  <strong>Status : </strong><span id="status"></span>
  <br/>
  <textarea id="orderData" style="height:100px;" onclick="this.select()"></textarea>
  <div id="loadData" style="display:none"></div>
</div>

<script type="text/javascript">var mem_now = 1, mem_end, time = 0, data1 = document.getElementById('data1'), data2 = document.getElementById('data2'), total = 0, statusI = document.getElementById('status');
document.getElementById('initData').onclick = function() {
  mem_end = Number(document.getElementById('memCount').value);
  if (data1.value.length == 0 && data2.value.length == 0) return alert('Not enough data');
  if (data1.value.length > 0) total += 1;
  if (data2.value.length > 0) total += 1;
  
  init();
  statusI.innerHTML = 'Running.';
  statusI.style.color = 'brown';
  _timer = window.setInterval(function() {
    if (time == 3) {
      statusI.innerHTML = 'Running.';
      time = 0;
    } else {
      statusI.innerHTML += '.';
      time += 1;
    }
  },500);
};
  
function init() {
  var d1 = document.getElementById('data1').value, d2 = document.getElementById('data2').value, txt = document.getElementById('orderData');
  
  document.getElementById('progress').innerHTML = mem_now + ' / ' + mem_end;
  document.getElementById('initData').style.display = 'none';
  
  $('#loadData').load('/u' + mem_now + ' title, ' + d1 + ', ' + d2, function() {
  
    if (total == 1) {
      if (mem_now == 1) txt.value += '[table]\n[tr][td]Username[/td][td]'+ $(this).find('dl dt').text() +'[/td][/tr]\n[tr][td][url=http://'+ window.location.host + '/u' + mem_now +']'+ $(this).find('title').text().replace(/.*?- (.*?)/,'$1') +'[/url][/td][td]'+ $(this).find('dl dd .field_uneditable').text() +'[/td][/tr]';
      else if (mem_now != mem_end) txt.value += '\n[tr][td][url=http://'+ window.location.host + '/u' + mem_now +']'+ $(this).find('title').text().replace(/.*?- (.*?)/,'$1') +'[/url][/td][td]'+ $(this).find('dl dd .field_uneditable').text() +'[/td][/tr]';
      if (mem_now == mem_end) txt.value += '\n[tr][td][url=http://'+ window.location.host + '/u' + mem_now +']'+ $(this).find('title').text().replace(/.*?- (.*?)/,'$1') +'[/url][/td][td]'+ $(this).find('dl dd .field_uneditable').text() +'[/td][/tr]\n[/table]';
    }
    if (total == 2) {
      if (mem_now == 1) txt.value += '[table]\n[tr][td]Username[/td][td]'+ $(this).find('dl:eq(0) dt').text() +'[/td][td]'+ $(this).find('dl:eq(1) dt').text() +'[/td][/tr]\n[tr][td][url=http://'+ window.location.host + '/u' + mem_now +']'+ $(this).find('title').text().replace(/.*?- (.*?)/,'$1') +'[/url][/td][td]'+ $(this).find('dl:eq(0) dd .field_uneditable').text() +'[/td][td]'+ $(this).find('dl:eq(1) dd .field_uneditable').text() +'[/td][/tr]';
      else if (mem_now != mem_end) txt.value += '\n[tr][td][url=http://'+ window.location.host + '/u' + mem_now +']'+ $(this).find('title').text().replace(/.*?- (.*?)/,'$1') +'[/url][/td][td]'+ $(this).find('dl:eq(0) dd .field_uneditable').text() +'[/td][td]'+ $(this).find('dl:eq(1) dd .field_uneditable').text() +'[/td][/tr]';
      if (mem_now == mem_end) txt.value += '\n[tr][td][url=http://'+ window.location.host + '/u' + mem_now +']'+ $(this).find('title').text().replace(/.*?- (.*?)/,'$1') +'[/url][/td][td]'+ $(this).find('dl:eq(0) dd .field_uneditable').text() +'[/td][td]'+ $(this).find('dl:eq(1) dd .field_uneditable').text() +'[/td][/tr]\n[/table]';
    }
  
    txt.style.height = Number(txt.style.height.replace(/px/,'')) + 15 + 'px';
    if (mem_now < mem_end) {
      mem_now += 1;
      setTimeout(function() { init() },requestTime);
    } else if (mem_now == mem_end) {
      statusI.innerHTML = 'Complete !';
      statusI.style.color = 'green';
      window.clearInterval(_timer);
    }
  });
}// member data par ange tuteur</script>

At the top you can modify this variable if you like :
Code:
requestTime = 3000 // time in between requests
It determines the pause time between requests. It's to prevent you from hitting the request limit as this tool will be sending a request to multiple pages when initialized.


Usage

Exclamation ATTENTION : While using this tool for large ammounts of members (50+), make sure that you are not logged in as it will cause bugs.

Total members : Input the total amount of members on your board to return a complete list of your members. You can input lower values to return a smaller list..

Field ID1 : This is the ID of the field you want to grab, for example : "Posts" By default the ID of the posts fields is #field_id-6. To find these IDs you can use the developer tools(F12)

To return language I would input #field_id1


Field ID2 : ID2 is the same as ID1, only it is completely optional.

When finished inputing your data click "Initialize" to begin building the table.


Style

To style the table simply add a class name to it. For example :
Code:
[table class="postTable"]
[tr][td]Username[/td][td]Posts: [/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u1]Ange Tuteur[/url][/td][td]572[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u2]Deux[/url][/td][td]14[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u3]The Tester[/url][/td][td]4[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u4]Sugar[/url][/td][td]3[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u5]mist3r0us_b0y[/url][/td][td]62[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u6]HagoromoOtsutsuki[/url][/td][td]0[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u7]masinho[/url][/td][td]0[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u8]SLGray[/url][/td][td]203[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u9]Sasori[/url][/td][td]2[/td][/tr]
[tr][td][url=fmdesign.forumotion.com/u10]Zyon[/url][/td][td]108[/td][/tr]
[/table]

Then you can add some CSS to your stylesheet, to style it :
Code:
.postTable { border:1px solid #000; padding:3px; }
.postTable td { border:1px solid #333; padding:3px; }


Any questions, comments, or bugs, you may leave them below.

Thanks Smile
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1716
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Sat 29 Nov 2014, 13:09

O_O
i did not understand everything
but looks good
avatar
Beyonder
Member
Title :
Gender : Male
Age : 21
Posts : 18
Points : 1312
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:03

(I find my old account lol.)
Nice codes like always!

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