* 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.
This commit is contained in:
briandilley 2004-10-27 01:12:22 +00:00
parent 7ec597d0c2
commit 5e417ac25c
7 changed files with 36 additions and 17 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
<div class="kwote-navigation">
<a href="?action=list&amp;o=${ORDER}&amp;s=${NEXT_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}">Next &gt;</a>
<a href="?action=list&amp;o=${ORDER}&amp;s=${NEXT_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}&amp;ss=${SEARCH_STRING}">Next &gt;</a>
</div>

View File

@ -1,4 +1,4 @@
<div class="kwote-navigation">
<a href="?action=list&amp;o=${ORDER}&amp;s=${LAST_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}">&lt; Previous</a>
<a href="?action=list&amp;o=${ORDER}&amp;s=${LAST_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}&amp;ss=${SEARCH_STRING}">&lt; Previous</a>
</div>

View File

@ -1,6 +1,6 @@
<div class="kwote-navigation">
<a href="?action=list&amp;o=${ORDER}&amp;s=${LAST_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}">&lt; Previous</a>
<a href="?action=list&amp;o=${ORDER}&amp;s=${LAST_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}&amp;ss=${SEARCH_STRING}">&lt; Previous</a>
&nbsp; | &nbsp;
<a href="?action=list&amp;o=${ORDER}&amp;s=${NEXT_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}">Next &gt;</a>
<a href="?action=list&amp;o=${ORDER}&amp;s=${NEXT_INDEX}&amp;m=${MAX_RETURN}&amp;mr=${MAX_RECORDS}&amp;ss=${SEARCH_STRING}">Next &gt;</a>
</div>

View File

@ -47,7 +47,7 @@
<form action="${SCRIPT_NAME}" method="get">
<div>
<input type="hidden" name="action" value="show" />
<span class="id-search">Kwote #&nbsp;<input type="text" size="5" /></span>
<span class="id-search">Kwote #&nbsp;<input type="text" size="5" name="id" id="id" /></span>
</div>
</form>
<span class="title">Kwotes - For happy goodness!</span>
@ -57,6 +57,7 @@
<li class="tab"><a href="?">Home</a></li>
<li class="tab"><a href="?action=add">Add</a></li>
<li class="tab"><a href="?action=list&amp;o=date">Latest</a></li>
<li class="tab"><a href="?action=list&amp;o=random&amp;m=100&amp;mr=100">Random 100</a></li>
<li class="tab"><a href="?action=list&amp;o=rating&amp;s=0&amp;m=20&amp;mr=50">Top 100</a></li>
<li class="tab"><a href="?action=list&amp;o=rating&amp;s=0&amp;m=20&amp;mr=50&amp;so=reverse">Bottom 100</a></li>
<li class="tab"><a href="?action=search">Search</a></li>

View File

@ -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

View File

@ -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;