Hallo
Habe eine Frage Ich habe eine php/html suche welche zwar funktioniert aber zu irgendeiner ergebnis seite geht wenn es geht würde ich gerne bestimmen auf welcher seite die ergebnisse ausgegeben werden sollen.
wie kann ich das machen?
Hier ein teil der suche
Achja falls sich jemand beschwert die suche ist kostenlos und man darf sie bearbeiten.
Hier der Link zur suche
http://www.maianscriptworld.co.uk/fr...ine/index.html
Habe eine Frage Ich habe eine php/html suche welche zwar funktioniert aber zu irgendeiner ergebnis seite geht wenn es geht würde ich gerne bestimmen auf welcher seite die ergebnisse ausgegeben werden sollen.
wie kann ich das machen?
Hier ein teil der suche
PHP-Code:
<?php
/*---------------------------------------------
MAIAN SEARCH v2.0
Written by David Ian Bennett
E-Mail: support@maianscriptworld.co.uk
Website: www.maianscriptworld.co.uk
This File: Search
----------------------------------------------*/
error_reporting (0);
define('PATH', dirname(__FILE__).'/');
define('PARENT',1);
// Load include files..
include(PATH.'control/connect.inc.php');
include(PATH.'control/functions.php');
include(PATH.'control/Savant2.php');
include(PATH.'control/PaginateIt.php');
// Load Settings Data..
// We can mask the error thrown here and redirect index file to installer..
$SETTINGS = @mysql_fetch_object(
mysql_query("SELECT * FROM ".$database['prefix']."settings LIMIT 1")
);
// Check installer..
if (!isset($SETTINGS->language)) {
header("Location: install/index.php");
exit;
}
// Load language..
include(PATH.'lang/'.$SETTINGS->language);
// Initiate vars..
$skipWords = array_map('trim',explode(',',$SETTINGS->skipwords));
$sWords = array();
$sCount = 0;
$page = (isset($_GET['next']) ? strip_tags($_GET['next']) : '1');
$limit = $page * $SETTINGS->total - ($SETTINGS->total);
$html = '';
// Check page var is a digit..
if (!ctype_digit($page)) {
header("Location: search.php");
exit;
}
// Perform search..
if (isset($_GET['q'])) {
if (trim($_GET['q'])) {
// If this is the first page load, filter results..
if ($page==1) {
if (!empty($skipWords)) {
$thisSearchTerm = '';
foreach ($skipWords AS $removeWord) {
$thisSearchTerm = str_replace(' '.$removeWord.' ','',$_GET['q']);
}
} else {
$thisSearchTerm = $_GET['q'];
}
} else {
// If page number higher than 2 no filtering necessary..
// If someone manually enters the page number into the address bar it won`t really upset anything..
$thisSearchTerm = $_GET['q'];
}
if ($thisSearchTerm!='') {
// Log search if enabled..
if ($SETTINGS->log && $page==1) {
addToLogFile($thisSearchTerm);
}
// Query database based on search parameter..
// Build html..
// For keywords less than 3 characters, bypass fulltext..
if (strlen($thisSearchTerm)<4) {
$sCount = rowCount('pages',' WHERE title LIKE \'%'.safeImport($thisSearchTerm).'%\' OR description LIKE \'%'.safeImport($thisSearchTerm).'%\' OR keywords LIKE \'%'.safeImport($thisSearchTerm).'%\'');
$s_query = mysql_query("SELECT * FROM ".$database['prefix']."pages
WHERE title LIKE '%".safeImport($thisSearchTerm)."%' OR description LIKE '%".safeImport($thisSearchTerm)."%' OR keywords LIKE '%".safeImport($thisSearchTerm)."%'
ORDER BY title
LIMIT $limit, $SETTINGS->total
") or die(mysql_error());
} else {
$sCount = rowCount('pages',' WHERE MATCH(title,description,keywords) AGAINST(\''.safeImport($thisSearchTerm).'\' IN BOOLEAN MODE)');
$s_query = mysql_query("SELECT * FROM ".$database['prefix']."pages
WHERE MATCH(title,description,keywords) AGAINST('".safeImport($thisSearchTerm)."' IN BOOLEAN MODE)
ORDER BY title
LIMIT $limit, $SETTINGS->total
") or die(mysql_error());
}
if (mysql_num_rows($s_query)>0) {
while ($SEARCH = mysql_fetch_object($s_query)) {
$html .= str_replace(array('{title}','{description}','{url}','{target}'),
array(cleanData($SEARCH->title),cleanData($SEARCH->description),cleanData($SEARCH->url),($SETTINGS->target ? ' onclick="window.open(this);return false"' : '')),
file_get_contents(PATH.'templates/html/result.htm')
);
}
} else {
// No results..
$html = noResultsToDisplay();
}
}
} else {
// No results..
$html = noResultsToDisplay();
}
} else {
// No results..
$html = noResultsToDisplay();
}
$tpl = new Savant2();
$tpl->assign('CHARSET', $charset);
$tpl->assign('TITLE', $search4);
$tpl->assign('HEAD_MSG', str_replace(array('{keywords}','{count}'),array((isset($thisSearchTerm) ? cleanData($thisSearchTerm) : ' '),$sCount),$search3));
$tpl->assign('RESULTS', $html);
$tpl->assign('PAGE_NUMBERS', ($sCount>0 ? searchPageNumbers($sCount,$SETTINGS->total,$page) : '1'));
$tpl->display('templates/search.tpl.php');
?>
Achja falls sich jemand beschwert die suche ist kostenlos und man darf sie bearbeiten.
Hier der Link zur suche
http://www.maianscriptworld.co.uk/fr...ine/index.html
Kommentar