1
i noticed some people are looking for these codes. so i decided to post here.
you can create as a block in xoops. must be php script. already tested and worked with phpbb forum module for xoops.
Thanks to UseLess from phpbbstyles.com for sql part.
here it is
$member_handler =& xoops_gethandler('member');
$total_members = $member_handler->getUserCount(new Criteria('level', 0, '>=')); // this will display total users
$total_active_members = $member_handler->getUserCount(new Criteria('level', 0, '>')); // this will display active users
$total_inactive_members = $member_handler->getUserCount(new Criteria('level', 0, '=')); //this will display inactive users
$dbhost = 'localhost'; // database host
$dbname = ''; // database name
$dbuser = ''; // database username
$dbpasswd = ''; // database password
$table_prefix = 'xoops_pbb_'; // this is phpbb module table for xoops
$db_link = mysql_connect($dbhost,$dbuser,$dbpasswd);
if( !$db_link )
{
die('Unable to connect to db server');
}
if( !mysql_select_db($dbname) )
{
die('Unable to select db: ' . $dbname);
}
$sql = "SELECT SUM(forum_topics) AS topic_total, SUM(forum_posts) AS post_total
FROM " . $table_prefix . "forums";
$result = mysql_query($sql);
if( !$result )
{
die('Error: ' . mysql_errno() . ': ' . mysql_error() . ' SQL: ' . $sql );
}
$info = mysql_fetch_array($result);
echo "Total Members : ".$total_members;
echo "
Total Active Members : ".$total_active_members;
echo "
Total Inactive Members :".$total_inactive_members;
echo '
Total Topics : ' . $info['topic_total'];
echo '
Total Posts : ' . $info['post_total'];
it should display like this
.............................
Total Members : 1234
Total Active Members : 1200
Total Inctive Members : 34
Total Topics : 65
Total Posts : 2500
.............................
i just wrote the codes in here again.. so if there are problems, let me know..
hope this help..