AN-net |
02-15-2004 07:07 PM |
yeah i figured that out, thanks for the help though.
now i added a results page to my search engine thingy but it only shows this:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
this is my php code:
PHP Code:
if($show==searchresults){
$fresults= $DB_site->query("SELECT * FROM gallery WHERE gallery_id='$gallery' OR image_name='$imgname' OR artist_name='$artistname' $orderby $orderin");
$numresults= $DB_site->num_rows($fresults);
if($numresults==0){
$navbits = array();
$navbits["#"] = "Gallery";
$navbits["gallery.php?view=index"] = "Gallery Index";
$navbits["#"] = "Search";
$navbits[''] = "Search Results";
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('gallery_search_results_none') . '");');
}
else{
while($results= $DB_site->fetch_array($fresults)){
$imagedate=date("m/d/Y - g:i A",$results[image_date]);
eval('$resultsbits .= "' . fetch_template('gallery_search_resultsbits') . '";');
}
mysql_free_result($fresults);
$navbits = array();
$navbits["#"] = "Gallery";
$navbits["gallery.php?view=index"] = "Gallery Index";
$navbits["#"] = "Search";
$navbits[''] = "Search Results($numresults)";
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('gallery_search_results') . '");');
}
}
this is whats in the templates:
gallery_search_results:
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - Gallery Search Results:($numresults)</title>
$headinclude
</head>
<body>
$header
$navbar
<br />
<table class="tborder" align="center">
<tr class="tcat">
<td>Search Results for:$imgname $artistname</td>
</tr>
$resultsbits
</table>
<br />
$footer
</body>
</html>
gallery_search_resultsbits:
HTML Code:
<tbody>
<tr>
<td class="tcat" colspan="3">$results[image_name]</td>
</tr>
<tr class="thead">
<td>Thumbnail</td>
<td>Artist Name</td>
<td>Date Added</td>
</tr>
<tr>
<td clas="al2"><a href="gallery.php?view=entry&id=$results[gallery_id]&imgid=$results[image_id]" alt"Click to see full size image of $results[image_name]"><img src="$results[image_url]" alt="Click to see full size image of $results[image_name]" length="40" width="40" border="0"></a></td>
<td class="alt1">$results[artist_name]</td>
<td class="alt2">$imagedate</td>
</tr>
</tbody>
and this is whats in the search template:
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - Gallery Search:</title>
$headinclude
</head>
<body>
$header
$navbar
<br />
<form action="gallery.php?show=searchresults" method="post">
<table class="tborder" align="center">
<tr class="tcat">
<td align="center" colspan="2"><font size="2"><b>Search Gallery</b></font></td>
</tr>
<tr>
<td class="alt1">
<fieldset>
<legend>Search by Image Name</legend>
<table>
<tr>
<td><input type="text" name="imgname" value="" size="20"></td>
</tr>
</table>
</fieldset>
</td>
<td class="alt2">
<fieldset>
<legend>Search by Artist Name</legend>
<table>
<tr>
<td><input type="text" name="artistname" value="" size="15"></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr class="thead">
<td colspan="2">Additional Searching Options</td>
</tr>
<tr>
<td class="alt1">
<table>
<tr>
<td>
<fieldset>
<legend>Order Search Results by:</legend>
<table>
<tr>
<td><select name="orderby">
<optgroup label="orderbytypes">
<option value="ORDER BY gallery.gallery_id" SELECTED>Gallery</option>
<option value="ORDER BY gallery.image_name">Image Name</option>
<option value="ORDER BY gallery.image_date">Image Date</option>
<option value="ORDER BY gallery.arist_name">Artist's Name</option>
</optgroup>
</select>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>Order Results in:</legend>
<table>
<tr>
<td><select name="orderin">
<optgroup label="orderins">
<option value="DESC" SELECTED>Descending</option>
<option value="ASC">Ascending</option>
</optgroup>
</select>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</td>
<td class="alt2">
<fieldset>
<legend>Search in Gallery</legend>
<table>
<tr>
<td><select name="gallery" size="5">
<optgroup label="galleries">
$listgalleries
</optgroup>
</select>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr class="thead">
<td colspan="2" align="center"><input type="submit" value="Search Now"></td>
</tr>
</table>
</form>
<br />
$footer
</body>
</html>
|