From 5e417ac25c886657e64479a2c07e29c5069ef378 Mon Sep 17 00:00:00 2001 From: briandilley Date: Wed, 27 Oct 2004 01:12:22 +0000 Subject: [PATCH] * added "random" sorting method, and "Random 100" to tab bar. * add "name" and "id" attribute to the text input box in the header, it wasn't working because it was missing. * removed the search header from the search results page. * fixed navigation buttons (next, prev)... they were missing the search string, pressing "next" or "prev" on a search aborted the search. --- Changelog | 10 ++++++++ html/content-list-navigate-no-back.html | 2 +- html/content-list-navigate-no-forward.html | 2 +- html/content-list-navigate.html | 4 +-- html/header.html | 3 ++- kwotes.conf.pl | 3 ++- kwotes.pl | 29 ++++++++++++++-------- 7 files changed, 36 insertions(+), 17 deletions(-) diff --git a/Changelog b/Changelog index 4fef913..2615b88 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,13 @@ +10-26-04 + * added "random" sorting method, and "Random 100" to + tab bar. + * add "name" and "id" attribute to the text input box + in the header, it wasn't working because it was missing. + * removed the search header from the search results page. + * fixed navigation buttons (next, prev)... they were + missing the search string, pressing "next" or "prev" + on a search aborted the search. + 10-24-04 * updated the UI # fixed non validating UI diff --git a/html/content-list-navigate-no-back.html b/html/content-list-navigate-no-back.html index 047826b..838e915 100644 --- a/html/content-list-navigate-no-back.html +++ b/html/content-list-navigate-no-back.html @@ -1,4 +1,4 @@
- Next > + Next >
diff --git a/html/content-list-navigate-no-forward.html b/html/content-list-navigate-no-forward.html index 700704c..0609152 100644 --- a/html/content-list-navigate-no-forward.html +++ b/html/content-list-navigate-no-forward.html @@ -1,4 +1,4 @@
- < Previous + < Previous
diff --git a/html/content-list-navigate.html b/html/content-list-navigate.html index 025688f..d339b0c 100644 --- a/html/content-list-navigate.html +++ b/html/content-list-navigate.html @@ -1,6 +1,6 @@
- < Previous + < Previous   |   - Next > + Next >
diff --git a/html/header.html b/html/header.html index fd012c1..a8dcfa3 100644 --- a/html/header.html +++ b/html/header.html @@ -47,7 +47,7 @@
- Kwote #  + Kwote # 
Kwotes - For happy goodness! @@ -57,6 +57,7 @@
  • Home
  • Add
  • Latest
  • +
  • Random 100
  • Top 100
  • Bottom 100
  • Search
  • diff --git a/kwotes.conf.pl b/kwotes.conf.pl index f49c14c..789481b 100755 --- a/kwotes.conf.pl +++ b/kwotes.conf.pl @@ -3,7 +3,8 @@ $DB_TYPE = "mysql"; # dbi database type (only MySQL is # supported currently, due to the -# fact that "LIMIT X,X" is used +# fact that "LIMIT X,X", and "RAND()" +# is used $DB_NAME = "kwotes"; # database name diff --git a/kwotes.pl b/kwotes.pl index eb64f87..9a493c7 100755 --- a/kwotes.pl +++ b/kwotes.pl @@ -103,8 +103,14 @@ if ($action eq "add") { } elsif ($action eq "list") { # what are we sorting on - my $sort = ($FORM{"o"} eq "date") ? - "submit_dt" : ( ($FORM{"o"} eq "rating") ? "rating" : undef); + my $sort = undef; + if ($FORM{"o"} eq "date") { + $sort = "submit_dt"; + } elsif ($FORM{"o"} eq "rating") { + $sort = "rating"; + } elsif ($FORM{"o"} eq "random") { + $sort = "RAND()"; + } # get start index my $start_index = (defined($FORM{"s"})) ? $FORM{"s"} : 0; @@ -126,17 +132,18 @@ if ($action eq "add") { my @rows = list_kwotes($dbh, $sort, $sort_order, $max_returned, $start_index, $search_string); # setup these vars - $vars{TITLE} = "Kwotes"; - $vars{ORDER} = $FORM{"o"}; - $vars{NEXT_INDEX} = $start_index+$max_returned; - $vars{MAX_RETURN} = $max_returned; - $vars{LAST_INDEX} = $start_index-$max_returned; - $vars{MAX_RECORDS} = $max_records; + $vars{TITLE} = "Kwotes"; + $vars{ORDER} = $FORM{"o"}; + $vars{NEXT_INDEX} = $start_index+$max_returned; + $vars{MAX_RETURN} = $max_returned; + $vars{LAST_INDEX} = $start_index-$max_returned; + $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); - } + #if (defined($search_string)) { + # $main_content .= wrap_template("html/content-search.html", %vars); + #} # get the navigation template my $navigation_template = undef;