Re: [Jason] Adding a viewer Search Engine
Hi Jason, thanks for the help! I changed the form code. If I want it to search keywords of the content and the titles, is this correct?
<form method="post" action="search.php">
<input name="content_keyword,title_keyword" type="text" value="" size="13">
<input type="submit" name="submit" value="Go!">
</form>
It appears I'm still having an issue with the search.php page.
Doing a search on the world "center" still turns up nothing so I'm obviously missing a big piece of the puzzle here to get the keyword results to display on the search.php page.
The search.php page was attached previously, here's the web view:
http://www.nwsc5872139.myutilitydomain.com/search.php
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/services8/webpages/util/n/w/nwsc5872139.myutilitydomain.com/public/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load records
list($searchRecords, $searchMetaData) = getRecords(array(
'tableName' => 'search',
'perPage' => '30',
));
?>
++++++++++++++++++++
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<h1>Search - List Page Viewer</h1>
<?php foreach ($searchRecords as $record): ?>
Record Number: <?php echo $record['num'] ?><br/>
Title: <?php echo $record['title'] ?><br/>
Content: <?php echo $record['content'] ?><br/>
_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/>
<hr/>
<?php endforeach ?>
<?php if ($searchMetaData['invalidPageNum']): ?>
Results page '<?php echo $searchMetaData['page']?>' not found, <a href="<?php echo $searchMetaData['firstPageLink'] ?>">start over >></a>.<br/><br/>
<?php elseif (!$searchRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->
<!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
<?php if ($searchMetaData['prevPage']): ?>
<a href="<?php echo $searchMetaData['prevPageLink'] ?>"><< prev</a>
<?php else: ?>
<< prev
<?php endif ?>
- page <?php echo $searchMetaData['page'] ?> of <?php echo $searchMetaData['totalPages'] ?> -
<?php if ($searchMetaData['nextPage']): ?>
<a href="<?php echo $searchMetaData['nextPageLink'] ?>">next >></a>
<?php else: ?>
next >>
<?php endif ?>
<!-- /STEP3: Display Page Links -->
Thank you so much! Tina