______________________________________________________________________________
 Synchronet Top Users, v1.0  Copyright 2007  Philip Brown  Flaming Star BBS


This program was written to read the Synchronet log files and create a bulletin
showing monthly, and yearly Top Ten BBS users based on callers, messages posted,
files downloaded, kbytes downloaded, files uploaded, kbytes uploaded.

This program was written to run on MSDOS and Windows platforms.  It has been tested
on Windows XP Home edition and Windows 98 SE.

Below is a example of the yearly.asc file it creates.

______________________________________________________________________________
 Synchronet Top Users, v1.0  Copyright 2007  Philip Brown  Flaming Star BBS


@BBS@: 2007 Top Users List
 
Top Callers:
   +------------------------------------------------+
   |Rank User # Username/Alias                Calls |
   +----+------+-------------------------+----------+
   |  1 |   33 | .................       |      312 |
   |  2 |   34 | .................       |       97 |
   |  3 |    9 | .................       |       87 |
   |  4 |    2 | .................       |       72 |
   |  5 |   56 | .................       |       67 |
   |  6 |   60 | .................       |       60 |
   |  7 |   72 | .................       |       59 |
   |  8 |   80 | .................       |       47 |
   |  9 |   91 | .................       |       46 |
   | 10 |  148 | .................       |       34 |
   +----+------+-------------------------+----------+
@PAUSE@
 
Top Message Posters:
   +------------------------------------------------+
   |Rank User # Username/Alias             Messages |
   +----+------+-------------------------+----------+
   |  No messages posted                            |
   +----+------+-------------------------+----------+
@PAUSE@
 
Top Downloaders:
   +------------------------------------------------+
   |Rank User # Username/Alias                Files |
   +----+------+-------------------------+----------+
   |  No files downloaded                           |
   +----+------+-------------------------+----------+
@PAUSE@
 
Top Downloaders by Kbytes:
   +------------------------------------------------+
   |Rank User # Username/Alias               Kbytes |
   +----+------+-------------------------+----------+
   |  No files downloaded                           |
   +----+------+-------------------------+----------+
@PAUSE@
 
Top Uploaders:
   +------------------------------------------------+
   |Rank User # Username/Alias                Files |
   +----+------+-------------------------+----------+
   |  No files uploaded                             |
   +----+------+-------------------------+----------+
@PAUSE@
 
Top Uploaders by Kbytes:
   +------------------------------------------------+
   |Rank User # Username/Alias               Kbytes |
   +----+------+-------------------------+----------+
   |  No files uploaded                             |
   +----+------+-------------------------+----------+
 
 
Bulletin Created: 07/06/07 19:52:06



FILES USED BY THIS PROGRAM:

TOPTEN.EXE	Program used to create bulletins.
SETUP.EXE       Program used to setup bulletin paths, colors.
SETUP.DBF       Data file used to store program information.
TOPTEN.DBF      Temporary file used to read log file.
WORK.DBF        Temporary file used to read log file.
TOP10.BAT       Batch file to use when setting up a event.

TEMP FILES CREATED/DELETED BY THIS PROGRAM:
TMP.DBF         Temporary file used by TOPTEN Program. 
CALLTMP.NTX     Temporary file used by TOPTEN Program. 
MSGTMP.NTX      Temporary file used by TOPTEN Program. 
DLTMP.NTX       Temporary file used by TOPTEN Program.
ULTMP.NTX       Temporary file used by TOPTEN Program. 
DLKTMP.NTX      Temporary file used by TOPTEN Program.
ULKTMP.NTX      Temporary file used by TOPTEN Program. 
TEMP.NTX        Temporary file used by TOPTEN Program.
WORK.NTX        Temporary file used by TOPTEN Program.
LOCKED.MEM      Temporary file used by TOPTEN Program.


FILES CREATED BY THIS PROGRAM:

MONTHLY.ASC 	.ASC Bulletin created by TOPTEN Program.
MONTHLY.ANS     .ANS Bulletin created by TOPTEN Program.
YEARLY.ASC 	.ASC Bulletin created by TOPTEN Program.
YEARLY.ANS      .ANS Bulletin created by TOPTEN Program.


EXECUTING THE PROGRAM:

Below is a example of what the setup program looks like:

 Topten Setup Program, v1.0  Copyright 2007 Philip Brown  Flaming Star BBS
    +----------------------------+
    Log Path                    
    +----------------------------+
    +----------------------------+
    Bulletin Color Selection          Use The ? Or ? To Select Choice
    +----------------------------+      And Press ?-+
    +----------------------------+
    Include Sysop in Bulletins  
    +----------------------------+
    +----------------------------+
    Exit Setup Program          
    +----------------------------+


--------------------------------------------------------------------------------
 Current Values:
     Log Path:      c:\sbbs\data\logs
     Include Sysop: No


     +-----+   +-----+
     Month   Year 
     +-----+   +-----+


Step 1:

Run the setup.exe program and it will give you 4 menu choices.

1) Log Path                      Path of the log file.

2) Bulletin Color Selection      Menu with 2 boxes (Monthly, Yearly)

        After you select one of the two boxes, it will give you a
        selection of color choices, using your arrow keys, move to the
        color and press enter to make your choice and above the choices
        it will show your selection as you try other colors.
        When finished, select 'Exit Color Selector' and then pick another
        box and like above, pick your colors.  When done select
        'Exit Color Selection' and it will return to the menu.

3) Include Sysop in Bulletin     Select 'Yes' or 'No'.

4) Exit Setup Program            Exit Program.

        Before exiting, check the values and colors you have selected.


Step 2:

Run the topten.exe program and it will read the setup data file for the
information it needs to process the log and create both ascii and ansii
bulletins.


If you run the topten.exe program without running setup.exe, you will get
the following error:

For Example:

 Error. See example: topten monthly or topten yearly

Once you have ran the setup program and gave it the information it needs, then
run "topten monthly" or "topten yearly" (no quotes), and it will read the setup
information and process the log and create both ascii and ansi bulletins.

The topten program has 2 command line options you can use.

For Example:

topten monthly - This program creates a top ten bulletin on monthly BBS usage.

topten yearly  - This program creates a top ten bulletin on yearly BBS usage.


If you run the program for example "topten monthly", and another window is 
running the same program, you will get the following message:

 Program in use, retrying... please wait.

It will continue to trying and if the other program finishes, it will run as 
normal but if it does not you will get the following message:

 Program in use, retrying... please wait.
 Tried 50000 times, exiting program. Please try again later.

If you know that this program is not running anywhere else, delete a file 
called "LOCKED.MEM" in the directory this program is in, and run your event 
batch file or "topten monthly" or "topten yearly" to process your logs and
create your ansi/ascii bulletins.


Below is a example of what the topten program looks like when you run the 
program "topten monthly".

+-----------------------------------------------------------------------------+
 Synchronet Top Users, v1.0  Copyright 2007 Philip Brown  Flaming Star BBS 
+-----------------------------------------------------------------------------+
 Opening Data and Log Files
 Processing Log, (Sysop not included in bulletins)
 Reading Log Line #13794, 1563 Matching Items Found
 Calculating Calls, Messages Posted, Downloads, and Uploads
 Creating Ascii Bulletin
 Creating Ansi Bulletin
 Cleaning Work Area
 Done


MODIFYING BULLSEYE.CFG/BULLSEYE.ASC:

To show the new bulletin need to modify the bullseye.cfg file located
in the sbbs\text folder.

For Example:

0
../text/system.msg
../text/newuser.msg
../text/sbbs.msg
../docs/dove-net.txt
c:/sbbs/topten/monthly.ans
c:/sbbs/topten/yearly.ans

Then modify the bullseye.asc file in the sbbs\text folder.

For Example:

l0nc4k0
4c  hyBulletins  nk40
4c+kb0

 hy1 ngStatistics for h@BBS-L....................................@nb
 hy2 ngNew user instructions                                     b
 hy3 ngAbout this version of Synchronet BBS Software             b
 hy4 ngWhat is DOVE-Net?                                         b
 hy5 ngMonthly Top Ten Users for h@BBS-L.........................@nb
 hy6 ngYearly Top Ten Users for h@BBS-L..........................@nb
n

LOGON/TIMED EVENTS:

Depending on when you want to execute TOPTEN, you can setup events to run 
them for you.


Below is an example of a timed event. 

+[][?]--------------------------------------------------------------+
                          EVENT Timed Event                         
--------------------------------------------------------------------
 Internal Code                   TOPTEN                            
 Start-up Directory              c:\sbbs\topten                    
 Command Line                    top10.bat                         
 Enabled                         Yes                               
 Execution Node                  4                                 
 Execution Days of Month         Any                               
 Execution Days of Week          All                               
 Execution Frequency             12 times a day                    
 Requires Exclusive Execution    No                                
 Force Users Off-line For Event  No                                
 Native (32-bit) Executable      No                                
 Use Shell to Execute            No                                
 Background Execution            Yes                               
 Always Run After Init/Re-init   No                                
+--------------------------------------------------------------------+

You can create a batch file as shown below. (change paths to match your BBS)

	cd\sbbs\topten
	topten monthly
	topten yearly
	cd\
	exit


CONTACT INFORMATION:

+-----------------------------------------------------------------------------+
  By Philip Brown  The Flaming Star BBS  telnet/www bbs.flamingstar.com    
+-----------------------------------------------------------------------------+

    Email: pbmountaincat@flamingstar.no-ip.info
   TELNET: telnet://flamingstar.no-ip.info
   TELNET: telnet://flamings.synchro.net
   TELNET: telnet://flamingstar.bbsdatabase.com
      FTP: ftp://flamingstar.no-ip.info
      WWW: http://www.flamingstar.com

NOTES:

If you like this program, or have a suggestion, please send me a email me.

Thanks,
Philip Brown aka Pbmountaincat
Flaming Star BBS

______________________________________________________________________________
 Synchronet Top Users, v1.0  Copyright 2007  Philip Brown  Flaming Star BBS

