Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Member Stats

Asked Modified Viewed 5,128 times
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
asked
Veteran Member

Add this code into a custom page and set access to suit.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| \http://www.php-fusion.co.uk
+--------------------------------------------------------+
| Filename: member_stats.php
| CVS Version: 1.06
| Author: Philip Daly (HobbyMan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at \www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

if (!iADMIN) { redirect(BASEDIR."index.php"wink; }

$time = time();
$total_total = dbcount("(user_id)", DB_USERS);
$total_staff = dbcount("(user_id)", DB_USERS, "user_level>'101'"wink;
$total_sadmin = dbcount("(user_id)", DB_USERS, "user_level='103'"wink;
$total_admin = dbcount("(user_id)", DB_USERS, "user_level='102'"wink;
$total_female = dbcount("(user_id)", DB_USERS, "user_gender='1' && user_status = '0'"wink;
$total_male = dbcount("(user_id)", DB_USERS, "user_gender='2' && user_status = '0'"wink;
$total_unstated = dbcount("(user_id)", DB_USERS, "user_gender='0' && user_status = '0'"wink;
$total_members = dbcount("(user_id)", DB_USERS, "user_level='101' && user_status = '0'"wink;
$total_offset = dbcount("(user_id)", DB_USERS, "user_level='101' && user_offset != '0'"wink;
$total_1day = dbcount("(user_id)", DB_USERS, "(user_lastvisit - user_joined) < '8601' && user_status = '0'"wink;
$total_1year = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '31536000'wink < $time && user_status = '0'"wink;
$year_nopost = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '31536000'wink < $time && user_posts = '0' && user_status = '0'"wink;
$total_2year = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '63072000'wink < $time && user_status = '0'"wink;
$total_never = dbcount("(user_id)", DB_USERS, "user_lastvisit = '0' && user_status = '0'"wink;
$active_member = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '15768000'wink < $time && user_posts !='0' && user_status = '0'"wink;
$total_1post = dbcount("(user_id)", DB_USERS, "user_posts = '0' && user_status = '0'"wink;
$total_ypost = dbcount("(user_id)", DB_USERS, "user_posts != '0' && user_status = '0'"wink;
$total_theme = dbcount("(user_id)", DB_USERS, "user_theme != 'Default' && user_status = '0'"wink;
$total_hiddenemail = dbcount("(user_id)", DB_USERS, "user_hide_email = '0' && user_status = '0'"wink;
$total_avatar = dbcount("(user_id)", DB_USERS, "user_avatar != '' && user_status = '0'"wink;
$total_url = dbcount("(user_id)", DB_USERS, "user_web != '' && user_status = '0'"wink;
$ban_posts = dbcount("(user_id)", DB_USERS, "user_status = '1' && user_posts != '0'"wink;
$banned = dbcount("(user_id)", DB_USERS, "user_status = '1'"wink;
$blacklisted = dbcount("(blacklist_id)", DB_BLACKLIST);
$blacklist_ips = dbcount("(blacklist_ip)", DB_BLACKLIST, "blacklist_ip != ''"wink;
$blacklist_email = dbcount("(blacklist_email)", DB_BLACKLIST, "blacklist_email != ''"wink;

$one_day_members = round($total_1day*100/$total_members);
$post_percent = round($total_ypost*100/$total_total);
$ban_percent = round($banned*100/$total_total);
$percentage_offset = round($total_offset*100/$total_members);
if ($ban_percent < '1'wink { $show_ban_percent = "(Less than) 1"; } else { $show_ban_percent = $ban_percent; }

// PMs

$total_pmread = dbcount("(message_id)", DB_MESSAGES, "message_read = '1'"wink;
$total_pmunread = dbcount("(message_id)", DB_MESSAGES, "message_read = '0'"wink;
if ($total_pmread == '0'wink { $pm_percent = '0'; } else {
$pm_percent = round($total_pmunread*100/$total_pmread);
}

echo "<table class='tbl-border' align='center' width='80%'>\n";
echo "<tr>\n<td class='tbl1' align='right'><b>Total Users:</b></td><td class='tbl1' width='30%'><b>".$total_total."</b></td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Staff:</td><td class='tbl2'>".$total_staff."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Total Superadmins:</td><td class='tbl1'>".$total_sadmin."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Administrators:</td><td class='tbl2'>".$total_admin."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Total Members:</td><td class='tbl1'> ".$total_members."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Male:</td><td class='tbl1'> ".$total_male."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Female:</td><td class='tbl1'> ".$total_female."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Gender Unstated:</td><td class='tbl1'> ".$total_unstated."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='2'><hr /></td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>One Day Members:</td><td class='tbl1'>".$total_1day."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who last logged in over a year ago:</td><td class='tbl2'> ".$total_1year."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members with no posts who last logged in over a year ago:</td><td class='tbl1'> ".$year_nopost."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who last logged in over two years ago:</td><td class='tbl2'>".$total_2year."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have never logged in:</td><td class='tbl1'> ".$total_never."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who have logged in in the last six months and who have posted:</td><td class='tbl2'> ".$active_member."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Percentage of one day members:</td><td class='tbl1'> ".$one_day_members."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members with zero post count:</td><td class='tbl2'>".$total_1post."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have posted:</td><td class='tbl1'>".$total_ypost."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Percentage of Members who have posted:</td><td class='tbl2'>".$post_percent."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who don't use default theme:</td><td class='tbl1'> ".$total_theme."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who have chosen to hide their email address:</td><td class='tbl2'>".$total_hiddenemail."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have loaded an Avatar:</td><td class='tbl1'>".$total_avatar."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have a web address:</td><td class='tbl1'>".$total_url."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Posts by banned members:</td><td class='tbl2'>".$ban_posts."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Banned percentage of overall membership:</td><td class='tbl1'>".$show_ban_percent."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members using offset:</td><td class='tbl1'>".$total_offset." [".$percentage_offset."%]</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='2'><hr /></td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Total Personal Messages (Read):</td><td class='tbl1'>".$total_pmread."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Personal Messages (Unread):</td><td class='tbl2'>".$total_pmunread."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Percentage of PM's unread:</td><td class='tbl1'>".$pm_percent."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='2'><hr /></td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Banned Users:</td><td class='tbl1'>".$banned."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Blacklist:</td><td class='tbl1'>".$blacklisted."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Blacklisted IP's:</td><td class='tbl1'>".$blacklist_ips."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Blacklisted Emails:</td><td class='tbl1'>".$blacklist_email."</td>\n</tr>\n";

echo "</table>\n";

?>[/syntaxhighlighter]
Edited by HobbyMan on 07-03-2011 14:45,
0 replies

15 posts

S
stoerti
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
answered
Junior Member

does not go with me? When I insert this at your own pages?
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Quote

stoerti wrote:
does not go with me? When I insert this at your own pages?


Please explain what you mean. Thank you.
0 replies
S
stoerti
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
answered
Junior Member

This code shows with me for nothing ...
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

Try it now, damn smileys again
0 replies
S
stoerti
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
answered
Junior Member

Thx
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Quote

Philip wrote:
Try it now, damn smileys again
:D
0 replies
— 2 months later —
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

Updated version to include gender numbers also number and percentage of users availing of server time offset.

v1.06
0 replies
— 1 month later —
2
29sd102
2
  • Member, joined since
  • Contributed 107 posts on the community forums.
  • Started 26 threads in the forums
answered
Member

Quote

Unknown column 'user_gender' in 'where clause'Unknown column 'user_gender' in 'where clause'Unknown column 'user_gender' in 'where clause'


Getting this,
Any ideas.

thanks

i use : v7.00.07 bye way,
( removed the gender line,, all ok,, thanks) remove if you wish,
Edited by 29sd102 on 17-04-2011 18:59,
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk
+--------------------------------------------------------+
| Filename: member_stats.php
| CVS Version: 1.06
| Author: Philip Daly (HobbyMan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
 
  if (!iADMIN) { redirect(BASEDIR."index.php"); }
 
      $time = time();
      $total_total = dbcount("(user_id)", DB_USERS);
      $total_staff = dbcount("(user_id)", DB_USERS, "user_level>'101'");
     $total_sadmin = dbcount("(user_id)", DB_USERS, "user_level='103'");
      $total_admin = dbcount("(user_id)", DB_USERS, "user_level='102'");
    $total_members = dbcount("(user_id)", DB_USERS, "user_level='101' && user_status = '0'");
     $total_offset = dbcount("(user_id)", DB_USERS, "user_level='101' && user_offset != '0'");
       $total_1day = dbcount("(user_id)", DB_USERS, "(user_lastvisit - user_joined) < '8601'  && user_status = '0'");
      $total_1year = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '31536000') < $time  && user_status = '0'");
      $year_nopost = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '31536000') < $time  && user_posts = '0' && user_status = '0'");
      $total_2year = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '63072000') < $time  && user_status = '0'");
      $total_never = dbcount("(user_id)", DB_USERS, "user_lastvisit = '0'  && user_status = '0'");
    $active_member = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '15768000') < $time && user_posts !='0' && user_status = '0'");
      $total_1post = dbcount("(user_id)", DB_USERS, "user_posts = '0'  && user_status = '0'");
      $total_ypost = dbcount("(user_id)", DB_USERS, "user_posts != '0'  && user_status = '0'");
      $total_theme = dbcount("(user_id)", DB_USERS, "user_theme != 'Default'  && user_status = '0'");
$total_hiddenemail = dbcount("(user_id)", DB_USERS, "user_hide_email = '0'  && user_status = '0'");
     $total_avatar = dbcount("(user_id)", DB_USERS, "user_avatar != ''  && user_status = '0'");
        $total_url = dbcount("(user_id)", DB_USERS, "user_web != ''  && user_status = '0'");
        $ban_posts = dbcount("(user_id)", DB_USERS, "user_status = '1' && user_posts != '0'");
           $banned = dbcount("(user_id)", DB_USERS, "user_status = '1'");
      $blacklisted = dbcount("(blacklist_id)", DB_BLACKLIST);
    $blacklist_ips = dbcount("(blacklist_ip)", DB_BLACKLIST, "blacklist_ip != ''");
  $blacklist_email = dbcount("(blacklist_email)", DB_BLACKLIST, "blacklist_email != ''");
 
  $one_day_members = round($total_1day*100/$total_members);
     $post_percent = round($total_ypost*100/$total_total);
      $ban_percent = round($banned*100/$total_total);
$percentage_offset = round($total_offset*100/$total_members);
   if ($ban_percent < '1') { $show_ban_percent = "(Less than) 1"; } else { $show_ban_percent = $ban_percent; }
   
   // PMs
   
     $total_pmread = dbcount("(message_id)", DB_MESSAGES, "message_read = '1'");
   $total_pmunread = dbcount("(message_id)", DB_MESSAGES, "message_read = '0'");
   if ($total_pmread == '0') { $pm_percent = '0'; } else {
       $pm_percent = round($total_pmunread*100/$total_pmread);
     }
 
echo "<table class='tbl-border' align='center' width='80%'>n";
echo "<tr>n<td class='tbl1' align='right'><b>Total Users:</b></td><td class='tbl1' width='30%'><b>".$total_total."</b></td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Staff:</td><td class='tbl2'>".$total_staff."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Superadmins:</td><td class='tbl1'>".$total_sadmin."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Administrators:</td><td class='tbl2'>".$total_admin."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Members:</td><td class='tbl1'> ".$total_members."</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>One Day Members:</td><td class='tbl1'>".$total_1day."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who last logged in over a year ago:</td><td class='tbl2'> ".$total_1year."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members with no posts who last logged in over a year ago:</td><td class='tbl1'> ".$year_nopost."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who last logged in over two years ago:</td><td class='tbl2'>".$total_2year."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have never logged in:</td><td class='tbl1'> ".$total_never."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who have logged in in the last six months and who have posted:</td><td class='tbl2'> ".$active_member."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Percentage of one day members:</td><td class='tbl1'> ".$one_day_members."%</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members with zero post count:</td><td class='tbl2'>".$total_1post."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have posted:</td><td class='tbl1'>".$total_ypost."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Percentage of Members who have posted:</td><td class='tbl2'>".$post_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who don't use default theme:</td><td class='tbl1'> ".$total_theme."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who have chosen to hide their email address:</td><td class='tbl2'>".$total_hiddenemail."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have loaded an Avatar:</td><td class='tbl1'>".$total_avatar."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have a web address:</td><td class='tbl1'>".$total_url."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Posts by banned members:</td><td class='tbl2'>".$ban_posts."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Banned percentage of overall membership:</td><td class='tbl1'>".$show_ban_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members using offset:</td><td class='tbl1'>".$total_offset." [".$percentage_offset."%]</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Personal Messages (Read):</td><td class='tbl1'>".$total_pmread."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Personal Messages (Unread):</td><td class='tbl2'>".$total_pmunread."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Percentage of PM's unread:</td><td class='tbl1'>".$pm_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Banned Users:</td><td class='tbl1'>".$banned."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Blacklist:</td><td class='tbl1'>".$blacklisted."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Blacklisted IP's:</td><td class='tbl1'>".$blacklist_ips."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Blacklisted Emails:</td><td class='tbl1'>".$blacklist_email."</td>n</tr>n";
 
echo "</table>n";
 
?>
Edited by HobbyMan on 17-04-2011 19:14,
0 replies
I
icb
I
icb 10
  • Member, joined since
  • Contributed 54 posts on the community forums.
  • Started 16 threads in the forums
answered
Member

I also use 7.00.07 and have the same problem. And when using this other code no that problem but above the table on top of the page it says :

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn


instead of

Unknown column 'user_gender' in 'where clause'Unknown column 'user_gender' in 'where clause'Unknown column 'user_gender' in 'where clause' 


How to remove that ?
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

fixed, syntax highlighter failed
0 replies
I
icb
I
icb 10
  • Member, joined since
  • Contributed 54 posts on the community forums.
  • Started 16 threads in the forums
answered
Member

Quote

Philip wrote:

fixed, syntax highlighter failed


Hmm, still not I'm afraid :/

i226.photobucket.com/albums/dd281/dj_srle/SNAG-0000-1.jpg
0 replies
S
SiteMaster
S
If i have touched it, it's W3C Valid
  • Senior Member, joined since
  • Contributed 305 posts on the community forums.
  • Started 15 threads in the forums
answered
Senior Member

Quote

icb wrote:

Quote

Philip wrote:

fixed, syntax highlighter failed


Hmm, still not I'm afraid :/

i226.photobucket.com/albums/dd281/dj_srle/SNAG-0000-1.jpg


replace this
echo "<table class='tbl-border' align='center' width='80%'>n";
echo "<tr>n<td class='tbl1' align='right'><b>Total Users:</b></td><td class='tbl1' width='30%'><b>".$total_total."</b></td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Staff:</td><td class='tbl2'>".$total_staff."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Superadmins:</td><td class='tbl1'>".$total_sadmin."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Administrators:</td><td class='tbl2'>".$total_admin."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Members:</td><td class='tbl1'> ".$total_members."</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>One Day Members:</td><td class='tbl1'>".$total_1day."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who last logged in over a year ago:</td><td class='tbl2'> ".$total_1year."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members with no posts who last logged in over a year ago:</td><td class='tbl1'> ".$year_nopost."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who last logged in over two years ago:</td><td class='tbl2'>".$total_2year."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have never logged in:</td><td class='tbl1'> ".$total_never."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who have logged in in the last six months and who have posted:</td><td class='tbl2'> ".$active_member."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Percentage of one day members:</td><td class='tbl1'> ".$one_day_members."%</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members with zero post count:</td><td class='tbl2'>".$total_1post."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have posted:</td><td class='tbl1'>".$total_ypost."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Percentage of Members who have posted:</td><td class='tbl2'>".$post_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who don't use default theme:</td><td class='tbl1'> ".$total_theme."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who have chosen to hide their email address:</td><td class='tbl2'>".$total_hiddenemail."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have loaded an Avatar:</td><td class='tbl1'>".$total_avatar."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have a web address:</td><td class='tbl1'>".$total_url."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Posts by banned members:</td><td class='tbl2'>".$ban_posts."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Banned percentage of overall membership:</td><td class='tbl1'>".$show_ban_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members using offset:</td><td class='tbl1'>".$total_offset." [".$percentage_offset."%]</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Personal Messages (Read):</td><td class='tbl1'>".$total_pmread."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Personal Messages (Unread):</td><td class='tbl2'>".$total_pmunread."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Percentage of PM's unread:</td><td class='tbl1'>".$pm_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Banned Users:</td><td class='tbl1'>".$banned."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Blacklist:</td><td class='tbl1'>".$blacklisted."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Blacklisted IP's:</td><td class='tbl1'>".$blacklist_ips."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Blacklisted Emails:</td><td class='tbl1'>".$blacklist_email."</td>n</tr>n";
 
echo "</table>n";


with this
echo "<table class='tbl-border' align='center' width='80%'>n";
echo "<tr>n<td class='tbl1' align='right'><b>Total Users:</b></td><td class='tbl1' width='30%'><b>".$total_total."</b></td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Staff:</td><td class='tbl2'>".$total_staff."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Superadmins:</td><td class='tbl1'>".$total_sadmin."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Administrators:</td><td class='tbl2'>".$total_admin."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Members:</td><td class='tbl1'> ".$total_members."</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>One Day Members:</td><td class='tbl1'>".$total_1day."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who last logged in over a year ago:</td><td class='tbl2'> ".$total_1year."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members with no posts who last logged in over a year ago:</td><td class='tbl1'> ".$year_nopost."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who last logged in over two years ago:</td><td class='tbl2'>".$total_2year."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have never logged in:</td><td class='tbl1'> ".$total_never."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who have logged in in the last six months and who have posted:</td><td class='tbl2'> ".$active_member."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Percentage of one day members:</td><td class='tbl1'> ".$one_day_members."%</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members with zero post count:</td><td class='tbl2'>".$total_1post."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have posted:</td><td class='tbl1'>".$total_ypost."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Percentage of Members who have posted:</td><td class='tbl2'>".$post_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who don't use default theme:</td><td class='tbl1'> ".$total_theme."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Members who have chosen to hide their email address:</td><td class='tbl2'>".$total_hiddenemail."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have loaded an Avatar:</td><td class='tbl1'>".$total_avatar."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members who have a web address:</td><td class='tbl1'>".$total_url."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Posts by banned members:</td><td class='tbl2'>".$ban_posts."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Banned percentage of overall membership:</td><td class='tbl1'>".$show_ban_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Members using offset:</td><td class='tbl1'>".$total_offset." [".$percentage_offset."%]</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Total Personal Messages (Read):</td><td class='tbl1'>".$total_pmread."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Personal Messages (Unread):</td><td class='tbl2'>".$total_pmunread."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Percentage of PM's unread:</td><td class='tbl1'>".$pm_percent."%</td>n</tr>n";
echo "<tr>n<td class='tbl2' colspan='2'><hr /></td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Banned Users:</td><td class='tbl1'>".$banned."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Total Blacklist:</td><td class='tbl1'>".$blacklisted."</td>n</tr>n";
echo "<tr>n<td class='tbl1' align='right'>Blacklisted IP's:</td><td class='tbl1'>".$blacklist_ips."</td>n</tr>n";
echo "<tr>n<td class='tbl2' align='right'>Blacklisted Emails:</td><td class='tbl1'>".$blacklist_email."</td>n</tr>n";
 
echo "</table>n";
0 replies
— 1 year later —
H
hervan
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums
answered
Member

Quote

HobbyMan wrote:

Add this code into a custom page and set access to suit.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| \http://www.php-fusion.co.uk
+--------------------------------------------------------+
| Filename: member_stats.php
| CVS Version: 1.06
| Author: Philip Daly (HobbyMan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at \www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

if (!iADMIN) { redirect(BASEDIR."index.php"); }

$time = time();
$total_total = dbcount("(user_id)", DB_USERS);
$total_staff = dbcount("(user_id)", DB_USERS, "user_level>'101'");
$total_sadmin = dbcount("(user_id)", DB_USERS, "user_level='103'");
$total_admin = dbcount("(user_id)", DB_USERS, "user_level='102'");
$total_female = dbcount("(user_id)", DB_USERS, "user_gender='1' && user_status = '0'");
$total_male = dbcount("(user_id)", DB_USERS, "user_gender='2' && user_status = '0'");
$total_unstated = dbcount("(user_id)", DB_USERS, "user_gender='0' && user_status = '0'");
$total_members = dbcount("(user_id)", DB_USERS, "user_level='101' && user_status = '0'");
$total_offset = dbcount("(user_id)", DB_USERS, "user_level='101' && user_offset != '0'");
$total_1day = dbcount("(user_id)", DB_USERS, "(user_lastvisit - user_joined) < '8601' && user_status = '0'");
$total_1year = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '31536000') < $time && user_status = '0'");
$year_nopost = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '31536000') < $time && user_posts = '0' && user_status = '0'");
$total_2year = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '63072000') < $time && user_status = '0'");
$total_never = dbcount("(user_id)", DB_USERS, "user_lastvisit = '0' && user_status = '0'");
$active_member = dbcount("(user_id)", DB_USERS, "(user_lastvisit + '15768000') < $time && user_posts !='0' && user_status = '0'");
$total_1post = dbcount("(user_id)", DB_USERS, "user_posts = '0' && user_status = '0'");
$total_ypost = dbcount("(user_id)", DB_USERS, "user_posts != '0' && user_status = '0'");
$total_theme = dbcount("(user_id)", DB_USERS, "user_theme != 'Default' && user_status = '0'");
$total_hiddenemail = dbcount("(user_id)", DB_USERS, "user_hide_email = '0' && user_status = '0'");
$total_avatar = dbcount("(user_id)", DB_USERS, "user_avatar != '' && user_status = '0'");
$total_url = dbcount("(user_id)", DB_USERS, "user_web != '' && user_status = '0'");
$ban_posts = dbcount("(user_id)", DB_USERS, "user_status = '1' && user_posts != '0'");
$banned = dbcount("(user_id)", DB_USERS, "user_status = '1'");
$blacklisted = dbcount("(blacklist_id)", DB_BLACKLIST);
$blacklist_ips = dbcount("(blacklist_ip)", DB_BLACKLIST, "blacklist_ip != ''");
$blacklist_email = dbcount("(blacklist_email)", DB_BLACKLIST, "blacklist_email != ''");

$one_day_members = round($total_1day*100/$total_members);
$post_percent = round($total_ypost*100/$total_total);
$ban_percent = round($banned*100/$total_total);
$percentage_offset = round($total_offset*100/$total_members);
if ($ban_percent < '1') { $show_ban_percent = "(Less than) 1"; } else { $show_ban_percent = $ban_percent; }

// PMs

$total_pmread = dbcount("(message_id)", DB_MESSAGES, "message_read = '1'");
$total_pmunread = dbcount("(message_id)", DB_MESSAGES, "message_read = '0'");
if ($total_pmread == '0') { $pm_percent = '0'; } else {
$pm_percent = round($total_pmunread*100/$total_pmread);
}

echo "<table class='tbl-border' align='center' width='80%'>\n";
echo "<tr>\n<td class='tbl1' align='right'><b>Total Users:</b></td><td class='tbl1' width='30%'><b>".$total_total."</b></td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Staff:</td><td class='tbl2'>".$total_staff."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Total Superadmins:</td><td class='tbl1'>".$total_sadmin."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Administrators:</td><td class='tbl2'>".$total_admin."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Total Members:</td><td class='tbl1'> ".$total_members."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Male:</td><td class='tbl1'> ".$total_male."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Female:</td><td class='tbl1'> ".$total_female."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Gender Unstated:</td><td class='tbl1'> ".$total_unstated."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='2'><hr /></td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>One Day Members:</td><td class='tbl1'>".$total_1day."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who last logged in over a year ago:</td><td class='tbl2'> ".$total_1year."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members with no posts who last logged in over a year ago:</td><td class='tbl1'> ".$year_nopost."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who last logged in over two years ago:</td><td class='tbl2'>".$total_2year."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have never logged in:</td><td class='tbl1'> ".$total_never."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who have logged in in the last six months and who have posted:</td><td class='tbl2'> ".$active_member."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Percentage of one day members:</td><td class='tbl1'> ".$one_day_members."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members with zero post count:</td><td class='tbl2'>".$total_1post."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have posted:</td><td class='tbl1'>".$total_ypost."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Percentage of Members who have posted:</td><td class='tbl2'>".$post_percent."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who don't use default theme:</td><td class='tbl1'> ".$total_theme."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Members who have chosen to hide their email address:</td><td class='tbl2'>".$total_hiddenemail."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have loaded an Avatar:</td><td class='tbl1'>".$total_avatar."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members who have a web address:</td><td class='tbl1'>".$total_url."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Posts by banned members:</td><td class='tbl2'>".$ban_posts."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Banned percentage of overall membership:</td><td class='tbl1'>".$show_ban_percent."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Members using offset:</td><td class='tbl1'>".$total_offset." [".$percentage_offset."%]</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='2'><hr /></td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Total Personal Messages (Read):</td><td class='tbl1'>".$total_pmread."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Personal Messages (Unread):</td><td class='tbl2'>".$total_pmunread."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Percentage of PM's unread:</td><td class='tbl1'>".$pm_percent."%</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='2'><hr /></td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Banned Users:</td><td class='tbl1'>".$banned."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Total Blacklist:</td><td class='tbl1'>".$blacklisted."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='right'>Blacklisted IP's:</td><td class='tbl1'>".$blacklist_ips."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' align='right'>Blacklisted Emails:</td><td class='tbl1'>".$blacklist_email."</td>\n</tr>\n";

echo "</table>\n";

?>[/syntaxhighlighter]


Good:G
0 replies
L
Layzee
L
Layzee 10
Seen it - done it!
  • Member, joined since
  • Contributed 113 posts on the community forums.
  • Started 20 threads in the forums
answered
Member

Getting this message when open this custom page after save:

BIGINT UNSIGNED value is out of range in '(letsplay_.fusion6ae3a_users.user_lastvisit - letsplay_.fusion6ae3a_users.user_joined)'
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 15 posts
  • Votes 0 votes
  • Topic users 8 members

8 participants

H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
S
S
If i have touched it, it's W3C Valid
  • Senior Member, joined since
  • Contributed 305 posts on the community forums.
  • Started 15 threads in the forums
2
2
  • Member, joined since
  • Contributed 107 posts on the community forums.
  • Started 26 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
I
I
icb 10
  • Member, joined since
  • Contributed 54 posts on the community forums.
  • Started 16 threads in the forums
R
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
L
L
Layzee 10
Seen it - done it!
  • Member, joined since
  • Contributed 113 posts on the community forums.
  • Started 20 threads in the forums
H
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet