added configuration for site name.

added functionality for random tag lines.
made the search have a lot more options.
change HTML for footer.
added the Changelog to the footer.
updated intro page.
added installation instructions.
This commit is contained in:
briandilley
2004-10-28 06:29:35 +00:00
parent 5e417ac25c
commit 993a045eb4
10 changed files with 273 additions and 59 deletions

View File

@ -3,8 +3,13 @@
###################################################
# -*- kwotes.pl -*- #
###################################################
# TOD: Put some interesting shit here, perhaps #
# something about kwotes being GPL #
# This code is distributed under GPL licensing #
# terms, here's a link to the license and stuff: #
# #
# http://www.gnu.org/licenses/gpl.txt #
# #
# have fun with it, i'm not a major perl monger #
# or anything, so be easy on me :) #
###################################################
# bring in the required libs
@ -31,11 +36,13 @@ foreach my $key (keys %ENV) {
$vars{$key} = $ENV{$key};
}
# add information that is displayed on every page
# add information that can be displayed on every page
$vars{KWOTE_COUNT} = get_kwote_count();
$vars{KWOTE_BACKUP_COUNT} = get_kwote_backup_count();
$vars{SITE_NAME} = $SITE_NAME;
$vars{TAG_LINE} = get_tagline();
# send the HTML header
# send header
send_html_header();
############
@ -127,9 +134,22 @@ if ($action eq "add") {
# search string?
my $search_string = $FORM{"ss"};
# rating requirements?
my $max_rating = $FORM{"maxr"};
my $min_rating = $FORM{"minr"};
# get the kwote
my $dbh = get_db_connection();
my @rows = list_kwotes($dbh, $sort, $sort_order, $max_returned, $start_index, $search_string);
my @rows = list_kwotes(
$dbh,
$sort,
$sort_order,
$max_returned,
$start_index,
$search_string,
$min_rating,
$max_rating
);
# setup these vars
$vars{TITLE} = "Kwotes";
@ -140,26 +160,21 @@ if ($action eq "add") {
$vars{MAX_RECORDS} = $max_records;
$vars{SEARCH_STRING} = $search_string;
# add the search header if it was a search
#if (defined($search_string)) {
# $main_content .= wrap_template("html/content-search.html", %vars);
#}
# get the navigation template
my $navigation_template = undef;
# forward, no back
if ($start_index<=0 && @rows>=$max_returned
if ($FORM{"o"} ne "random" && $start_index<=0 && @rows>=$max_returned
&& ($start_index+$max_returned)<$max_records) {
$navigation_template = "html/content-list-navigate-no-back.html";
# forward and back
} elsif ($start_index>0 && @rows>=$max_returned
} elsif ($FORM{"o"} ne "random" && $start_index>0 && @rows>=$max_returned
&& ($start_index+$max_returned)<$max_records ) {
$navigation_template = "html/content-list-navigate.html";
# back only
} elsif ($start_index>0 && @rows<$max_returned) {
} elsif ($FORM{"o"} ne "random" && $start_index>0 && @rows<$max_returned) {
$navigation_template = "html/content-list-navigate-no-forward.html";
}