|
|
|
|
![]() ![]() |
May 11 2005, 04:51 PM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 933 Joined: 24-August 04 Member No.: 892 |
This is for phpBB V2+
It displays the total number of registered users anywhere you want. This file is called: phpbb-totalusers.php CODE <?php /** * ©2005 Craig lloyd. All rights reserved. * * Mod Title: Total Registered Users * Author: Craig Lloyd * Description: Shows total number of registered users * Release: v1.2, 10th May 2005 *** * Demo: http://www.toxicsims.co.uk/ (stats box) * Installation Level: Easy * Installation Time: 1 minute * Files To Edit: This one * Included Files: phpbb-totalusers.php *** * Installation Notes: * Upload this file and set $config, * Include this into a page and your done! * * ----------------------[ HOW TO INSTALL ]---------------------------- * To display the total users, use the following code: * * readfile("http://www.YOURSITE.com/phpbb-totalusers.php"); * * with the php tags! NOTE: you NEED to include the full url to the * file including 'http://www.YOURSITE.com/' or it might not show! */ //----------------------[ EDIT THIS INFO ]------------------------------ $config = "forum/config.php"; // Path to the config.php file of your phpBB forum //----------------[ DO NOT EDIT BELOW HERE ]----------------------- include_once("$config"); $db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("cannot connect to host"); @mysql_select_db("$dbname",$db) or die("could not open database, connection to host ok"); $rows = mysql_num_rows(mysql_query("SELECT * FROM phpbb_users")); $total = $rows-1; echo "$total"; // end ?> You only need to edit ONE thing, the $config variable, change: forum/config.php to: where your forums config.phph file is located e.g. If your forum is installed in the folder: board then you will change it to board/config.php Hope this comes in useful to someone Craig. This post has been edited by cragllo: May 11 2005, 05:27 PM |
|
|
|
May 12 2005, 03:26 PM
Post
#2
|
|
|
Proud to be hosted ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 992 Joined: 11-July 04 From: NL Member No.: 75 |
Very nice piece of code, thanks forcontributing with us
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 04:31 AM |