* 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:
parent
7ec597d0c2
commit
5e417ac25c
10
Changelog
10
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
<div class="kwote-navigation">
|
||||
<a href="?action=list&o=${ORDER}&s=${NEXT_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}">Next ></a>
|
||||
<a href="?action=list&o=${ORDER}&s=${NEXT_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}&ss=${SEARCH_STRING}">Next ></a>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="kwote-navigation">
|
||||
<a href="?action=list&o=${ORDER}&s=${LAST_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}">< Previous</a>
|
||||
<a href="?action=list&o=${ORDER}&s=${LAST_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}&ss=${SEARCH_STRING}">< Previous</a>
|
||||
</div>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class="kwote-navigation">
|
||||
<a href="?action=list&o=${ORDER}&s=${LAST_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}">< Previous</a>
|
||||
<a href="?action=list&o=${ORDER}&s=${LAST_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}&ss=${SEARCH_STRING}">< Previous</a>
|
||||
|
|
||||
<a href="?action=list&o=${ORDER}&s=${NEXT_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}">Next ></a>
|
||||
<a href="?action=list&o=${ORDER}&s=${NEXT_INDEX}&m=${MAX_RETURN}&mr=${MAX_RECORDS}&ss=${SEARCH_STRING}">Next ></a>
|
||||
</div>
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
<form action="${SCRIPT_NAME}" method="get">
|
||||
<div>
|
||||
<input type="hidden" name="action" value="show" />
|
||||
<span class="id-search">Kwote # <input type="text" size="5" /></span>
|
||||
<span class="id-search">Kwote # <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&o=date">Latest</a></li>
|
||||
<li class="tab"><a href="?action=list&o=random&m=100&mr=100">Random 100</a></li>
|
||||
<li class="tab"><a href="?action=list&o=rating&s=0&m=20&mr=50">Top 100</a></li>
|
||||
<li class="tab"><a href="?action=list&o=rating&s=0&m=20&mr=50&so=reverse">Bottom 100</a></li>
|
||||
<li class="tab"><a href="?action=search">Search</a></li>
|
||||
|
@ -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
|
||||
|
29
kwotes.pl
29
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;
|
||||
|
Loading…
Reference in New Issue
Block a user