* 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:
		
							
								
								
									
										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
 | 
					10-24-04
 | 
				
			||||||
	* updated the UI
 | 
						* updated the UI
 | 
				
			||||||
	# fixed non validating UI
 | 
						# fixed non validating UI
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<div class="kwote-navigation">
 | 
					<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>
 | 
					</div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<div class="kwote-navigation">
 | 
					<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>
 | 
					</div>
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
<div class="kwote-navigation">
 | 
					<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>
 | 
					</div>
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,7 +47,7 @@
 | 
				
			|||||||
			<form action="${SCRIPT_NAME}" method="get">
 | 
								<form action="${SCRIPT_NAME}" method="get">
 | 
				
			||||||
				<div>
 | 
									<div>
 | 
				
			||||||
					<input type="hidden" name="action" value="show" />
 | 
										<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>
 | 
									</div>
 | 
				
			||||||
			</form>
 | 
								</form>
 | 
				
			||||||
			<span class="title">Kwotes - For happy goodness!</span>
 | 
								<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="?">Home</a></li>
 | 
				
			||||||
			<li class="tab"><a href="?action=add">Add</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=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">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=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>
 | 
								<li class="tab"><a href="?action=search">Search</a></li>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,8 @@
 | 
				
			|||||||
$DB_TYPE = "mysql";
 | 
					$DB_TYPE = "mysql";
 | 
				
			||||||
# dbi database type (only MySQL is
 | 
					# dbi database type (only MySQL is
 | 
				
			||||||
# supported currently, due to the
 | 
					# supported currently, due to the
 | 
				
			||||||
# fact that "LIMIT X,X" is used
 | 
					# fact that "LIMIT X,X", and "RAND()"
 | 
				
			||||||
 | 
					# is used
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$DB_NAME = "kwotes";
 | 
					$DB_NAME = "kwotes";
 | 
				
			||||||
# database name
 | 
					# database name
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										17
									
								
								kwotes.pl
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								kwotes.pl
									
									
									
									
									
								
							@@ -103,8 +103,14 @@ if ($action eq "add") {
 | 
				
			|||||||
} elsif ($action eq "list") {
 | 
					} elsif ($action eq "list") {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# what are we sorting on
 | 
						# what are we sorting on
 | 
				
			||||||
	my $sort = ($FORM{"o"} eq "date") ? 
 | 
						my $sort = undef;
 | 
				
			||||||
		"submit_dt" : ( ($FORM{"o"} eq "rating") ? "rating" : 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
 | 
						# get start index
 | 
				
			||||||
	my $start_index = (defined($FORM{"s"})) ? $FORM{"s"} : 0;
 | 
						my $start_index = (defined($FORM{"s"})) ? $FORM{"s"} : 0;
 | 
				
			||||||
@@ -132,11 +138,12 @@ if ($action eq "add") {
 | 
				
			|||||||
	$vars{MAX_RETURN}	= $max_returned;
 | 
						$vars{MAX_RETURN}	= $max_returned;
 | 
				
			||||||
	$vars{LAST_INDEX}	= $start_index-$max_returned;
 | 
						$vars{LAST_INDEX}	= $start_index-$max_returned;
 | 
				
			||||||
	$vars{MAX_RECORDS}	= $max_records;
 | 
						$vars{MAX_RECORDS}	= $max_records;
 | 
				
			||||||
 | 
						$vars{SEARCH_STRING}	= $search_string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# add the search header if it was a search
 | 
						# add the search header if it was a search
 | 
				
			||||||
	if (defined($search_string)) {
 | 
						#if (defined($search_string)) {
 | 
				
			||||||
		$main_content .= wrap_template("html/content-search.html", %vars);
 | 
						#	$main_content .= wrap_template("html/content-search.html", %vars);
 | 
				
			||||||
	}
 | 
						#}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# get the navigation template
 | 
						# get the navigation template
 | 
				
			||||||
	my $navigation_template = undef;
 | 
						my $navigation_template = undef;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user