|
Post by jawn25 on Sept 6, 2011 23:50:13 GMT -5
I don't know JS so please bear with me.
So I made a script that counts the members in each groups to use in a table that shows census. I used the member page of the board as a database for it. But since each page can only show up to 200 members, I had to work some things to make it read all pages by inputting the total member count. Unfortunately, I couldn't get it to automatically get the data for the total member count. Currently, it asks for the total count to be written manually.
<script type="text/javascript"> $(document).ready(function(){ var total = 200; //total member count var pageNumber = Math.ceil(total/200); var counter = 1; var all_data = ""; while (counter <= pageNumber ) { $.get('/index.cgi?action=members&view=all&perpage=200&page=' + counter, function (data) { all_data += data; $('#resultg1').text( $('a.group1', all_data).length ); }); counter++; } }); </script> I want it to get the data (total member count) automatically so PLEASE HALP! >.<
|
|
|
Post by iPokemon on Sept 6, 2011 23:53:38 GMT -5
Welll, you can't really use Ajax requests on PB forums So manually updating will have to do. If you look in the code database, you could do the Replace Word in Board Description to do that if you wanted to.
|
|