-use Onis::Config qw/get_config/;
-use Onis::Html qw/html_escape get_filehandle/;
-use Onis::Language qw/translate/;
-use Onis::Users qw/get_name get_link get_image nick_to_username/;
-use Onis::Data::Core qw#all_nicks nick_to_ident ident_to_nick get_main_nick register_plugin#;
-use Onis::Data::Persistent qw#init#;
-
-our $DATA;
-our $QUOTE_CACHE = init ('$QUOTE_CACHE', 'hash');
-
-our @H_IMAGES = qw#dark-theme/h-red.png dark-theme/h-blue.png dark-theme/h-yellow.png dark-theme/h-green.png#;
-our $QUOTE_CACHE_SIZE = 10;
-our $QUOTE_MIN = 30;
-our $QUOTE_MAX = 80;
-our $WORD_LENGTH = 5;
-our $SORT_BY = 'LINES';
-our $DISPLAY_LINES = 'BOTH';
-our $DISPLAY_WORDS = 'NONE';
-our $DISPLAY_CHARS = 'NONE';
-our $DISPLAY_TIMES = 0;
-our $DISPLAY_IMAGES = 0;
-our $DEFAULT_IMAGE = '';
-our $BAR_HEIGHT = 130;
-our $BAR_WIDTH = 100;
-our $LONGLINES = 50;
-our $SHORTLINES = 10;
+use Carp (qw(confess));
+use Exporter;
+
+=head1 NAME
+
+Onis::Plugins::Core
+
+=head1 DESCRIPTION
+
+Plugin for the main table and the hourly-statistics. This is the most
+complicated plugin so far.
+
+=cut
+
+use Onis::Config (qw(get_config));
+use Onis::Html (qw(html_escape get_filehandle));
+use Onis::Language (qw(translate));
+use Onis::Users (qw(get_realname get_link get_image chatter_to_name));
+use Onis::Data::Core (qw(get_all_nicks nick_to_ident ident_to_nick get_main_nick register_plugin));
+use Onis::Data::Persistent ();
+
+@Onis::Plugins::Core::EXPORT_OK = (qw(get_core_nick_counters get_sorted_nicklist nick_is_in_main_table));
+@Onis::Plugins::Core::ISA = ('Exporter');
+
+our $NickLinesCounter = Onis::Data::Persistent->new ('NickLinesCounter', 'nick',
+ qw(
+ lines00 lines01 lines02 lines03 lines04 lines05 lines06 lines07 lines08 lines09 lines10 lines11
+ lines12 lines13 lines14 lines15 lines16 lines17 lines18 lines19 lines20 lines21 lines22 lines23
+ )
+);
+our $NickWordsCounter = Onis::Data::Persistent->new ('NickWordsCounter', 'nick',
+ qw(
+ words00 words01 words02 words03 words04 words05 words06 words07 words08 words09 words10 words11
+ words12 words13 words14 words15 words16 words17 words18 words19 words20 words21 words22 words23
+ )
+);
+our $NickCharsCounter = Onis::Data::Persistent->new ('NickCharsCounter', 'nick',
+ qw(
+ chars00 chars01 chars02 chars03 chars04 chars05 chars06 chars07 chars08 chars09 chars10 chars11
+ chars12 chars13 chars14 chars15 chars16 chars17 chars18 chars19 chars20 chars21 chars22 chars23
+ )
+);
+
+our $QuoteCache = Onis::Data::Persistent->new ('QuoteCache', 'key', qw(epoch text));
+our $QuotePtr = Onis::Data::Persistent->new ('QuotePtr', 'nick', qw(pointer));
+
+our $QuoteData = {}; # Is generated before output. Nicks are merged according to Data::Core.
+our $NickData = {}; # Same as above, but for nicks rather than quotes.
+our $SortedNicklist = [];
+
+our $NicksInMainTable = {};
+
+our @HorizontalImages = qw#dark-theme/h-red.png dark-theme/h-blue.png dark-theme/h-yellow.png dark-theme/h-green.png#;
+our $QuoteCacheSize = 10;
+our $QuoteMin = 30;
+our $QuoteMax = 80;
+our $SortBy = 'LINES';
+our $DisplayLines = 'BOTH';
+our $DisplayWords = 'NONE';
+our $DisplayChars = 'NONE';
+our $DisplayTimes = 0;
+our $DisplayImages = 0;
+our $DefaultImage = '';
+our $LongLines = 50;
+our $ShortLines = 10;
+
+=head1 CONFIGURATION OPTIONS
+
+=over 4
+
+=item B<quote_cache_size>: I<10>
+
+Sets how many quotes are cached and, at the end, one is chosen at random.
+
+=cut