[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/newspaper.c

This is a general newspaper edition handler. It will deal with keeping track of all the data for all the newspapers on the mud.

Written by Pinkfish

Started Sat Apr 28 02:30:49 PDT 2001

Includes

This class includes the following files /include/housing.h, /include/autodoc.h, /include/player_handler.h, /include/login_handler.h, /include/nroff.h, /include/room/newspaper.h and /include/board.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_edition_paper_sold
void add_edition_paper_sold(string paper,
                            int edition,
                            int cost)

This method adds a web paper sold to the specified edition.

Parameters:
paper - the paper which was sold
edition - the edition which was sold
cost - the amount it was sold for


add_edition_revenue
void add_edition_revenue(string paper,
                         int edition,
                         int revenue)

This method adds to the total revenue for this edition.

Parameters:
paper - the paper to look up
edition - the edition to look up
revenue - the revenue to add


add_edition_web_hit
void add_edition_web_hit(string paper,
                         int edition)

This method adds a web hit to the specified edition.

Parameters:
paper - the paper to add a hit on
edition - the edition to add a hit on


add_html_text
string add_html_text(string str)
add_newspaper_inform
void add_newspaper_inform(string paper,
                          string ob)

This method adds an object to be informed of a paper being published. When the paper is published, the function event_publish_paper, is called on all the objects in this list.

Parameters:
paper - the paper to be informed about
ob - the object to be informed


add_paper
void add_paper(string name,
               string long,
               string desc,
               string office,
               string language)

This method adds a paper.

Parameters:
paper - the name of the paper
long - the description on the newspapers themselves
desc - the description on the web page
office - the path to the office


add_paper_area
void add_paper_area(string area)

This method adds a paper area.

Parameters:
area - the area to add


add_paper_to_area
void add_paper_to_area(string paper,
                       string area)

This method adds a paper to a paper area.

Parameters:
paper - the paper to add to the area
area - the area to add the paper to


add_subscriber
void add_subscriber(string paper,
                    string subscriber,
                    int edition)

This method adds a subscriber into the list of people for a specific edition of the newspaper.

Parameters:
paper - the paper they subscribed to
subscriber - the person subscribing
edition - the edition they subscribed to


call_out_np
void call_out_np(mixed thing,
                 string paper)
close_all
string close_all()
close_block
string close_block()
close_tag
string close_tag()
convert_html
string convert_html(string input)

This method changes an input string into a 'nroff' equivilant output string.

Parameters:
str - the string to convert


is_allowed_to_read
int is_allowed_to_read(string paper,
                       string person,
                       int edition)

This checks and sees if the specified user is subscribed to the edition in question.

Parameters:
paper - the paper to check
person - the person to check
edition - the edition to find

Returns:
1 if they are subscribed


is_paper
int is_paper(string paper)

This method checks to see if the paper exists.

Parameters:
paper - the paper name to check for


is_paper_area
int is_paper_area(string area)

This method checks to see if the area exists or not.

Parameters:
area - the area to check for


is_valid_edition
int is_valid_edition(string paper,
                     int edition)

This checks to see if the specified edition is valid or not.

Parameters:
paper - the paper to check
edition - the edition to check

Returns:
1 if it ok, 0 if not


parse_tag
string parse_tag(string tag)
publish_paper
int publish_paper(string paper,
                  string headline,
                  class article * articles,
                  string * text,
                  class advert * adds,
                  string * editors)

This method publishes a new edition of the specified paper.

Parameters:
paper - the paper to publish an edition of
articles - the articles in the paper
text - the corresponding text to the articles
adds - the adverts in the paper

Returns:
1 if successful, 0 if not


query_all_papers
string * query_all_papers()

This method returns the list of all the papers.

Returns:
all the papers


query_article_text
string query_article_text(class article art)

This method reads in the data associated with the specified article.

Parameters:
article - the article to read the text for

Returns:
the article text


query_article_text_html
string query_article_text_html(class article art)

This method reads in the data associated with the specified article in html.

Parameters:
article - the article to read the text for

Returns:
the article text


query_article_text_plain
string query_article_text_plain(class article art)

This method reads in the data associated with the specified article in plain output.

Parameters:
article - the article to read the text for

Returns:
the article text


query_current_edition_num
int query_current_edition_num(string paper)

This method returns the current edition of the paper.

Parameters:
paper - the paper to get the edition of

Returns:
the current edition


query_edition_adverts
class advert * query_edition_adverts(string paper,
                                     int edition)

This method returns the adverts in the specified edition of the paper.

Parameters:
paper - the paper to look up
edition - the edition to look up

Returns:
the adverts in the edition


query_edition_articles
class article * query_edition_articles(string paper,
                                       int edition)

This method returns the articles in the specified edition of the paper.

Parameters:
paper - the paper to look up
edition - the edition to look up

Returns:
the articles in the edition


query_edition_date
int query_edition_date(string paper,
                       int edition)

This method returns the date at which the specified issue was published.

Parameters:
paper - the paper to check
edition - the edition to look up

Returns:
the date at which the edition was published


query_edition_num_sold
int query_edition_num_sold(string paper,
                           int edition)

This method returns the number of papers which have been sold.

Parameters:
paper - the paper which was sold
edition - the edition to check

Returns:
the number of papers that have been sold


query_edition_num_web_hits
int query_edition_num_web_hits(string paper,
                               int edition)

This method returns the number of web hits for the editon.

Parameters:
paper - the paper which was hit
edition - the edition to check

Returns:
the number of web hits on the edition


query_edition_revenue
int query_edition_revenue(string paper,
                          int edition)

This method returns the total revenue for this edition.

Parameters:
paper - the paper to look up
edition - the edition to look up

Returns:
the headline of the edition


query_language_for
string query_language_for(string paper)

This function returns the language for the given newspaper.

Parameters:
paper - The name of the paper.

Returns:
The language for the paper, "general" for none or 0 if for error


query_last_edition_num
int query_last_edition_num(string paper)

This method returns the last edition of the paper.

Parameters:
paper - the paper to get the edition of

Returns:
the last edition, 0 if there are no editions


query_newspaper_informs
string * query_newspaper_informs(string paper)

This method returns the list of objects that want to be informed about this paper.

Parameters:
paper - the paper to be informed about

Returns:
the list of objects to inform


query_paper_cost
int query_paper_cost(string paper)

This method returns the cost at which the paper will be sold.

Parameters:
paper - the paper to set the cost of

Returns:
the cost at which the paper will be sold


query_paper_description
string query_paper_description(string paper)

This method returns the description description of the paper. The long description is used in the newspapers around the place as it's description.

Parameters:
paper - the paper to get the long for


query_paper_headline
string query_paper_headline(string paper,
                            int edition)

This method returns the headline for the selected edition of the paper.

Parameters:
paper - the paper to look up
edition - the edition to look up

Returns:
the headline of the edition


query_paper_long
string query_paper_long(string paper)

This method returns the long description of the paper. The long description is used in the newspapers around the place as it's description.

Parameters:
paper - the paper to get the long for


query_paper_office
string query_paper_office(string paper)

This method returns the office of the paper.

Parameters:
paper - the paper to look up

Returns:
the office of the paper


query_papers_in_area
string * query_papers_in_area(string area)

This method returns all the articles in the specified paper area.

Parameters:
area - the area to lookup

Returns:
the papers in the area, returns a null array when there are no papers


remove_last_edition
class edition remove_last_edition(string paper)
remove_newspaper_inform
void remove_newspaper_inform(string paper,
                             string ob)

This method removes an object to be informed of a paper being published.

Parameters:
paper - the paper to no longer be informed about
ob - the object to no longer be informed


set_article_text
void set_article_text(class article art,
                      string text)

This moves the data for the article into the correct location.

Parameters:
article - the article to set the text for
text - the text to set


set_language_for
void set_language_for(string paper,
                      string language)

This function sets the language for the given paper.

Parameters:
paper - The name of the paper.
language - The language to use.


set_paper_cost
void set_paper_cost(string paper,
                    int cost)

This method sets the cost at which the paper will be sold.

Parameters:
paper - the paper to set the cost of
cost - the new cost of the paper


set_paper_description
void set_paper_description(string paper,
                           string description)

This method sets the description of the paper. The description is what is shown on the web page for the paper.

Parameters:
paper - the paper to set the long for
long - the new long description of the paper


set_paper_headline
void set_paper_headline(string paper,
                        int edition,
                        string headline)

This method returns the headline for the selected edition of the paper.

Parameters:
paper - the paper to look up
edition - the edition to look up
headline - the headline of the issue


set_paper_long
void set_paper_long(string paper,
                    string long)

This method sets the long of the paper. The long description is used in the newspapers around the place.

Parameters:
paper - the paper to set the long for
long - the new long description of the paper


set_paper_office
void set_paper_office(string paper,
                      string office)

This method sets the office of the paper.

Parameters:
paper - the paper to look up
office - the new office of the paper


validate_html
string validate_html(string str)

Classes

These are nice data types for dealing with... Data!