WebstuFF/
WebstuFF, by Will Fischer (stratocaster) --------------------

This code is three simple functions. The first, html_who(), will produce an HTML file with a table
listing the people currently logged in, their URL (if set), their ICQ number (if set), and their AOL
Instant Messenger screen name... and that's where the second function comes in. The set_aim() function
allows a user to set their AIM screen name, or blank it. The corresponding code allows staff to blank
offensive AIM names. The third function, view_player_aim() allows residents to get a list of all
the AIM names of all the people currently logged in. All pretty simple stuff. A note, however, before
we begin... the html_who() function will NOT work if your talker code is NOT in the same account as your 
webpage.

Oh, and before we continue, let me just say that by using this code, you agree to give me credit where
credit's due. If you have any problems, feel free to email them to me at stratocaster@notnet.co.uk,
but be forewarned... if you don't explain the problem clearly, or don't send the relevant info... I
probably won't answer.

Anyway, let's get down to the actual installation part.

1. As always, make a backup of your src/ directory.
2. Copy web.c to pgplus/src/.
3. Open web.c in your favorite text editor, and change the #define's at the top. 

***** For html_who() *****

--in parse.c: actual_timer(int c):

--find the following:
/* for sing */
      if (scan->no_sing > 0)
	scan->no_sing--;

-- and add this:
/* for WebstuFF (html_who) */
      if (time(0) % ONE_MINUTE == 0)
	html_who();

-- in case you were wondering, that will run the html_who() function, updating the page once every
-- minute.


--in include/proto.h:
--find this:
extern void hitells (player *, char *);

--below it, add:
extern void html_who(void);

--that's it! Onto the next one.

***** For set_aim() *****

--in admin2.c: blank_something():
--find this:
      else if (!strcasecmp(str, "fav3"))
	p2->favorite3[0] = 0;

--below that, add this:
      else if (!strcasecmp(str, "aim"))
	p2->aim[0] = 0;

--down a few lines, you'll see:
      else if (!strcasecmp(str, "fav3"))
	dummy.favorite3[0] = 0;

--add this:
      else if (!strcasecmp(str, "aim"))
	dummy.aim[0] = 0;

--down a few more lines, you'll see a "stack += sprintf(stack" with all the things that can be blanked
--listed there. Add "aim" to that list.

--in examine.c: newfinger():
--find:
    ADDSTACK("ICQ number          : %d \n", p2->icq);

--add below:
  if (p2->aim[0])
    ADDSTACK("AIM name            : %s \n", p2->aim);

--in examine.c: newexamine():
-- follow the directions for newfinger().

--in plists.c: file construct_save_data():
-- go down to the bottom of all those "stack = store_string(stack" and "store_int" bits.
-- make sure you're at the bottom. ;)
-- add the following, which should be the LAST in the list:
  stack = store_string(stack, p->aim);

--in plists.c: int load_player():
-- again, at the bottom of all the get_int_safe's and get_string_safe's:
-- add this:
  r = get_string_safe(p->aim, r, sp->data);

-- Now, go back over those last 2 instructions, and make sure they're at the END of their respective
-- areas.

--in plists.c: int restore_player_title():
--find:
  strcpy(p->git_by, "");

--and add:
  strcpy(p->aim, "");

--in include/clist.h:

-- find "view_player_hometown", and add: "set_aim" (without the quotes)
-- go down to:
{"age", set_age, 0, 0, 1, 0, DESCc},

--add:
{"aim", set_aim, BASE, 0, 1, 0, DESCc},

--last, but not least: in include/player.h: typdef struct p_struct: 
--(that's right, the p_struct. *phear*)
--find:
	swarn_message[MAX_SWARN + 2],

-- if you've added anything below this, but before:
	/* non saved */

-- then go down to the bottom of what you've added. Otherwise, directly below swarn_message, add:
	aim[MAX_SPODCLASS + 2],		/* AIM name */

-- *whew* Even being an experienced coder, the p_struct still scares me sometimes. ;)

***** For view_player_aim() *****

--in include/clist.h:

--go back to where you added "set_aim" before, and add "view_player_aim" after it. Don't forget those
--commas!

--find:
{"list", view_list, LIST, 0, 1, 0, LISTc},

--and add:
{"list_aim", view_player_aim, BASE, 0, 1, 0, INFOc},

--Now, you also have the option of making a "shortcut". Personally, I use this:
{"lsf", view_player_aim, BASE, 0, 1, 0, INFOc},

--You don't have to use lsf, but you get the idea.


***** for webstuff_version() *****
--Note: You MUST add this AS IS. No Exceptions.

--in version.c: pg_version()
--below:
  softmsg_version();

--add:
  webstuff_version();


--in include/proto.h:
--find:
extern void warn(player *, char *);

--below it, add:
extern void webstuff_version(void);


_____________________________________________

Well! That was fun! Now you need to do a 'make depend', and then 'make quick'. Next, and this is VERY
important... SHUTDOWN YOUR TALKER USING THE 'SHUTDOWN' COMMAND!!! DO NOT USE THE 'REBOOT' COMMAND!!!!

Once the angel restarts your talker, you can log back in, and everything *should* be working properly.
Remember, the html_who() function updates when the seconds hit 00. Once they've rolled over, load that
webpage, and have a look!

Feel free to pick through the code if you want to change the look of the page. It looks messy with all
that HTML and C mixed together, but you should be able to pick things out. If you start getting lost,
open the .html file in a text editor, and have a look at the output.

One last note: if you start seeing a lot of this:

 -=*> Program error recovered, action:

It's probably because something on your talker/machine doesn't like the html_who() function.

Any other questions, comments, or rude remarks, feel free to email me: stratocaster@notnet.co.uk

Will Fischer
July 5, 2001