vote-1.01/
Installation Instuctions:
Add the following lines of code into your existing files at the location specified.
If there is no location specified, that means the line should be outside of any
function or structure and on it's own line. Some lines may have a comment in them
instructing you to change part of the line to fit your system.

The file POLL_HELP is a text file containing the help that is posted for the system
on Legend of the Nobles. This help can be modified any way you like.

Lastly, do NOT remove ANY credit information from the poll system, either in the .c
or .h files, or from the actual pedit_credits section. These must remain intact in
order for this poll system to be used. Changing or removing any of these contents
will void your free use of this system.

If you really like the system, feel free to donate to Legend of the Nobles. There is
a link on our home page for donation purposes.

Please feel free to contact me with legitimate questions or comments, but keep in
mind that this IS free and has not gurantees or warranties.

- Valnir (valnir@legendofthenobles.com)

telnet://game.legendofthenobles.com:5400
http://www.legendofthenobles.com



/************************* olc.c *************************/

in function "run_olc_editor":
    case ED_POLL:
        pedit( d->character, d->incomm );
        break;

in function "olc_ed_name":
    case ED_POLL:
        sprintf( buf, "PEdit" );
        break;

in function "show_commands":
        case ED_POLL:
            show_olc_cmds( ch, pedit_table );
            break;



/************************* olc.h *************************/

#define ED_POLL		11	/* use your own number here, what ever is next */
void    pedit           args( ( CHAR_DATA *ch, char *argument ) );
extern  const struct olc_cmd_type pedit_table[];
DECLARE_DO_FUN( do_pedit	);

/* Poll editor */
olc.h:DECLARE_OLC_FUN( pedit_show	);
olc.h:DECLARE_OLC_FUN( pedit_list	);
olc.h:DECLARE_OLC_FUN( pedit_create	);
olc.h:DECLARE_OLC_FUN( pedit_topic	);
olc.h:DECLARE_OLC_FUN( pedit_to		);
olc.h:DECLARE_OLC_FUN( pedit_open	);
olc.h:DECLARE_OLC_FUN( pedit_close	);
olc.h:DECLARE_OLC_FUN( pedit_reopen	);
olc.h:DECLARE_OLC_FUN( pedit_choice	);
olc.h:DECLARE_OLC_FUN( pedit_publish	);
olc.h:DECLARE_OLC_FUN( pedit_delete	);
olc.h:DECLARE_OLC_FUN( pedit_credits	);

#define EDIT_POLL(Ch, Poll)     ( Poll = (POLL_DATA *)Ch->desc->pEdit )



/************************* interp.c *************************/

in the command table:
    { "poll",          do_poll,        POS_SLEEPING,   10,  LOG_NORMAL, 1 },
    { "psave",         save_polls,     POS_DEAD,       ML,  LOG_NORMAL, 1 },

in the olc command table:
    { "pedit",         do_pedit,       POS_DEAD,       ML,  LOG_NORMAL, 1 },



/************************* interp.h *************************/

DECLARE_DO_FUN( do_pedit	);
DECLARE_DO_FUN( do_poll		);
DECLARE_DO_FUN( save_polls	);



/************************* db.c *************************/

in the global variable definitions:
int                        top_poll;               /* voting polls */

in the external functions:
void       load_polls      args( ( void ) );

in the standard load section, by load_socials():
    load_polls();



/************************* merc.h *************************/

extern          int                     top_poll;
void     save_polls      args( ( CHAR_DATA *ch, char *argument ) );

in "struct pc_data":
    char *               polls;          /* record of polls voted on */


/************************* note.c *************************/

in the external functions:
void	do_poll	args( ( CHAR_DATA *ch, char *argument ) );

in function "do_unread" at the bottom:
    if ( ch->level >= 10 )	/* make sure people don't create, vote, delete */
        do_poll( ch, "new" );	/* inform character of new polls */


/************************* reboot.c *************************/

anywhere that auto saves data files (do_reboot, do_shutdown, etc):
    save_polls  ( ch, "" );         /* autosave polls */

/************************* save.c ***************************/
in function "fwrite_char":
	fprintf( fp, "Polls %s~\n", ch->pcdata->polls );

in function "fread_char" at the top to initialize the variable:
	ch->pcdata->polls = str_dup( "" );

in function "fread_char":
	KEY( "Polls", ch->pcdata->polls, fread_string( fp ) );