DEF User Lister v1.2 Written by Drew [PWA] Last update 7-24-94 ----------------------------------------------------------------------------- Table of Contents: ----------------------------------------------------------------------------- I. Introduction II. Installation III. Description of Files IV. Programming notes V. Miscellaneous notes VI. Last words ----------------------------------------------------------------------------- I. Introduction ----------------------------------------------------------------------------- See HISTORY.DOC for changes since version 1.0. Version 1.2 fixes only a small bug in listing the areacode, and also now includes a totally DEF config program. :-) Spice up your user listing. This PPE is extremely configurable. You can choose to display these following attributes in your user listing: . User's handle (or first name w/ last name) . User's city (typically a user note) . User's areacode (extracted from the user's data phone number) . User's number of files uploaded . User's number of files downloaded . User's bytes dowloaded . User's bytes uploaded . User's last date called . User's last time called . Number of times user has called . User's byte ratio . User's file ratio . User's K uploaded (1K = 1024 bytes) . User's K downloaded (1K = 1024 bytes) . User's megabytes uploaded . User's megabytes downloaded Additional features pertaining to these attributes are: . Sysop definable colors for each attribute . Sysop definable order and positioning of each attribute (the only provision is that everything must fit on one line) * Ability to make the user listing regular text file pcb codes You must be using PCB 15.1 for this. If you're not, get a life, get a clue, and get an upgrade. ----------------------------------------------------------------------------- II. Installation ----------------------------------------------------------------------------- If you are upgrading from version 1.1, then simply copy over USER.PPE and you will be all set. If you are upgrading from version 1.0, you need to do a complete reinstall. Step 1. ======= Make a directory for the matrix. For example: mkdir c:\pcb\djp\user I suggest making a subdirectory called djp since I will be releasing numerous other PPE's in the future and it's just nice to be organized. :-) Step 2. ======= Unzip everything into that directory pkunzip dj-usr10 c:\pcb\djp\user Step 3. ======= This is the tricky part. It is up to you where you want to install this ppe. If you find that this PPE runs too slowly (typically, it will run more slowly if you have configured it to display users's various byte status), you can have it create a file (say, on logoff) which can then be displayed when the actual command is entered. The normal way is to just generate/show the user list on the fly. What this ppe will do depends on the parameter given to it. This ppe takes EXACTLY one parameter. If you do not specify a parameter or specify an incorrect parameter, the ppe exits immediately and nothing is printed. Valid parameters are: /REG For a regular, on-the-fly display /MAKE To make "USER.DAT", which will contain the user list /LIST To display "USER.DAT". If it doesn't exist, nothing except "USER.TOP" and "USER.BOT" are shown (see below for a description of "USER.TOP" and "USER.BOT") Now run pcbsetup, go into File Locations (B), select Configuration Files (B), and edit your CMD.LST. Add a new command, and call it anything you want (the obvious choice is "USER"), select the security level, and give it the full path of the ppe. Command Security PPE/MNU File or Keystroke Replacement ------- -------- ------------------------------------- USER 20 !C:\PCB\DJP\USER\USER.PPE /REG ^^^^ notice this!!! Use /REG if you want an on-the-fly display. If you are going to display it as a pre-made file, then use /LIST ***and*** you must run this ppe somewhere else to generate the list (logoff is the best place). So for a logoff example, I would run mkpcbtxt and edit the PCBTEXT file. Hit F3 and jump to record #192. Now replace the text with something like: %C:\PCB\DJP\USER\LOGOFF.TXT Basically, this makes the text entry point at this LOGOFF.TXT file. In the file itself, you will want to have something like: Minutes Used: @OPTEXT@ @HANGUP@ Updating user listing... !C:\PCB\DJP\USER\USER.PPE /MAKE Remember to have the /LIST option inside the CMD.LST entry if you do this! Step 4. ======= Modify user.cfg, user.top, and user.bot to your liking. The last two, user.top and user.bot, are totally optional. If they're not there, no header or footer will be printed. If decide to use them, you will have to at least modify SOME of it because it has my bbs name in it. (Read: don't be lazy.) For user.cfg, see the documentation within the file for instructions. It should be relatively painless to setup. Alternatively, if you are lazy, you can run "CONFIG.EXE" to configure just about all the options. This config program has default values and if you have an existing config file, it will read from that and use existing values (so you don't have to type EVERYTHING every time you run the darn thing). Be warned! -- CONFIG.EXE has no error checking. So don't be a wise-guy and enter "abcdefgh" if it asks for a PCB Color Code. ----------------------------------------------------------------------------- III. Description of Files ----------------------------------------------------------------------------- user.bot After the user listing is done, this is displayed. Basically, this is like a footer. This is an optional file to keep and/or use. If the file does not exist, it simply is not printed. user.top This file is displayed before the actual user listing. This is the header. This is an optional file to keep and/or use. If the file does not exist, it simply is not printed. user.cfg This is the configuration file used by this PPE. Read the notes inside of this file for details. user.ppe The main PPE file itself. user.doc This file. (You are reading it now.) user.dat Created only when USER.PPE is executed with the /MAKE parameter. Displayed when USER.PPE is executed with the /LIST parameter. If this file does not exist, nothing will be displayed when /LIST is used. ----------------------------------------------------------------------------- IV. Programming Notes ----------------------------------------------------------------------------- Many thanks to ViGilante for his tips on improving the speed of this user lister. Version 1.0 of this PPE was heinously slow because of constantly using the GETALTUSER statement in ppl. This version avoids it almost in all cases. The only time it requires the GETALTUSER statement is when accessing any statistic dealing with the user's BYTES transfered. There is no clear way as to how to read the bytes transfered (ul'ed, dl'ed) from the USERS file right now. I've even bugged Clark Development about this, but they have simply ignored my inquiries... So if anyone has an idea of how to get this piece of information, please let me know! I'm sure there are others who would love to know this as well. ----------------------------------------------------------------------------- V. Miscellaneous Notes ----------------------------------------------------------------------------- I did not do two things with this PPE: 1. Display one of this silly looking "columns" between statistics. 2. Have the text display saying "Leech!", "Great!", or whatever to show their xfer status according to their file/byte ratio. The reason for #1 is simply because I just felt it looked dumb. :-) The reason for #2 is because it doesn't make any sense. Say you're using a byte ratio. It obviously defeats the purpose already because either you're a leech or you're not. If you're using a file ratio, then it still doesn't make sense because a user could have uploaded 10mb in 8 files, but has downloaded 2mb in 100 files (like a bunch of ppe's). Is this person a leech? Maybe, maybe not. It would depend on what they have uploaded. And then there's the case that you decided to give a really cool user leech access. Then this user would be "labeled" as a leech when listed in the user list. What a deal. But anyway, I think you see my point. I may add either/both as a feature in a future release if I get enough requests/complaints about it. ----------------------------------------------------------------------------- VI. Last Words ----------------------------------------------------------------------------- I added the CONFIG.EXE program as an afterthought and did not really test it as thoroughly as I did with the PPE itself. I'm pretty confident it won't cough up a storm, but just to be sure, you will want to check the config file afterwards if you decide to use CONFIG.EXE. The CONFIG.EXE file uses commands that are present in MSDOS 6.2 (namely, it uses "cls", "del" and "rename"). If for some reason your system does not support these commands, then you cannot use CONFIG.EXE. Greets: - Defcon 4: Amazing.. I finished something. :-) - Scimitar: Merp. Did you know it stands for "Middle Earth Role Playing"? - And to all other PWA programmers out there for their excellent contributions and efforts. - To anyone who has ever doubted me about anything: BITE ME. If you need to contact me for any reason, you can reach me in these ways (in order of speed): 1. Internet email: drew@xinet.com 2. My board : The Silicon Phalanx Node 1: 510-795-0200 Node 2: 510-795-0400 3. Or on any major board through Attitude Net. Peace, --Drew [PWA]