Hi,
I'm trying to get the multisearch function to work but have an issue with permalinks, as I don't want to have urls on search results like this: (http://domainame.com/category/article-detail.php?4)
My code looks like this:
<!-- STEP1: Load Record List (Paste this above other steps) -->
<?php
require_once "../cms/lib/viewer_functions.php";
$searchOptions = array();
$searchOptions['keywords'] = @$_REQUEST['q'];
$searchOptions['perPage'] = "10";
$searchOptions['debugSql'] = "1";
$searchTables = array();
$searchTables['ofertas'] = array(
'viewerUrl' => 'ofertas-detail.php',
'titleField' => 'title',
'summaryField' => 'texto_promo_social',
'searchFields' => array('title','content'),
'useSeoUrls' => true,
);
list($searchRows, $searchDetails) = searchMultipleTables($searchTables, $searchOptions);
?>
<!-- /STEP1: Load Record List -->
<!-- show errors -->
<?php if ($searchDetails['invalidPageNum']): ?>
Results page '<?php echo $searchDetails['page']?>' not found, <a href="<?php echo $searchDetails['firstPageLink'] ?>">start over >></a>.<br/>
<?php elseif ($searchOptions['keywords'] && $searchDetails['noRecordsFound']): ?>
No records matched search query!<br/><br/>
<?php elseif ($searchOptions['keywords'] == ""): ?>
Enter a keyword to search.<br/><br/>
<?php endif ?>
<!-- STEP2: Display Record List -->
<?php foreach ($searchRows as $record): ?>
<?php //showme($record); ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['_title'] ?></a><br/>
<?php if ($record['_summary']): ?>
<?php echo $record['_summary'] ?><br/>
<?php else: ?>
No description available for page.<br/>
<?php endif ?>
<a href="<?php echo $record['_link'] ?>" style="color: #008000"><?php echo $record['_link'] ?></a><br/><br/>
<?php endforeach ?>
<!-- /STEP2: Display Record List -->
As you can see, because of this line:
<a href="<?php echo $record['_link'] ?>" style="color: #008000"><?php echo $record['_link'] ?></a><br/><br/>
I'm receiving this kind of results
Article Name 4
Article Summary 4
http://domainame.com/category/article-detail.php?4
Article Name 6
Article Summary 6
http://domainame.com/category/article-detail.php?6
Article Name 8
Article Summary 8
http://domainame.com/category/articles-detail.php?8
Etc.
On my code generator, I'm seeing this line:
permalink: <?php echo htmlencode($record['permalink']) ?><br/>
and I'm just trying to replace it,
<a href="<?php echo htmlencode($record['permalink']) ?>" style="color: #008000"><?php echo htmlencode($record['permalink']) ?></a><br/><br/>
with no luck, as I'm seeing a white line and then this message on my logs.
E_NOTICE: Undefined index: permalink
/path/to/my/domain/html/category/multiSearch.php (line 69)
http://domainname.com/category/multiSearch.php?q=anyquesry&null=Search
I want to have results like this:
I'm receiving this kind of results
Article Name 4
Article Summary 4
http://domainame.com/category/permalink-url/
Article Name 6
Article Summary 6
http://domainame.com/category/permalink-url/
Article Name 8
Article Summary 8
http://domainame.com/category/permalink-url/
Thanks for pointing me on the right direction.
Jesus