So ich habs mal selber versucht und das einzigste was stimmt ist die Optik.
Leider fragt die Suche scheinbar nicht das GBook ab.
Nachdem ich zum Beispiel in der suche PLZ Bereich 1 durchsuchen, zeigt er mir danach nur die startseite der page an.
Kann sich mal einer anschauen wo der fehler liegt. ich sag gleich, ich hab keine ahnung vom coden... habs eben versucht und bis hierhin bin ich gekommen.
search.php
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
function serachgb($text,$such) {
#$text = BBcode($text);
$serar = explode(' ', $such);
$text = strip_tags($text);
$text = stripslashes($text);
$rte = '';
$tleng = 30;
foreach($serar as $v) {
$firs = strpos(strtolower($text),strtolower($v));
$begi = (($firs - $tleng) < 0 ? 0 : $firs - $tleng );
$leng = strlen($text);
$ende = (($firs + strlen($v) + $tleng) > $leng ? $leng : $firs + strlen($v) + $tleng );
$ttxt = substr($text,$begi,($ende - $begi));
$rte .= ' ... '.preg_replace("/".$v."/si",'<b>'.$v.'</b>',$ttxt);
}
return ($rte);
}
function searchgb() {
$design = new design ( 'Finduser' , '', 0 );
$design->header();
$tpl = new tpl ( 'searchgb' );
$tpl->out(0);
if ( isset ( $_PLZ['sub'] ) AND !empty($_PLZ['PLZ']) ) {
$name = str_replace('*',"%",$_POST['PLZ']);
$name = escape($name, 'string');
$q = "SELECT name,name FROM prefix_user WHERE name like '".$name."'";
$tpl->set ('gbook',dbliste('',$tpl,'gbook',$q));
$tpl->out(1);
}
$tpl->out(2);
$design->footer();
}
if ($menu->get(1) == 'gbook') {
searchgb();
exit();
}
$such = '';
if ($menu->get(1) != '') {
$such = $menu->get(1);
} elseif (isset($_REQUEST['searchgb'])) {
$such = $_REQUEST['searchgb'];
}
if ($such == 'aubt' OR $such == 'augt' OR $such == 'aeit') {
header('Location: index.php?gbook-'.$such);
exit();
}
$such = stripslashes(escape($such, 'string'));
$snac = 'Suche';
if ($such == 'augt' OR $such == 'aeit' OR $such == 'aubt') {
$ar_s = array('aubt'=>'unbeantworteten Themen','aeit'=>'eigenen Beiträgen','augt'=>'neue Themen seit dem letzten Besuch');
$snac = $ar_s[$such];
} elseif ( isset($_REQUEST['searchgb']) ) {
$snac = 'nach: '.$such;
}
$title = $allgAr['title'].' :: Suchen :: '.htmlentities($snac);
$hmenu = '<a class="smalfont" href="index.php?searchgb">Suchen</a><b> » </b>'.htmlentities($snac);
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('searchgb');
$tpl->set ('size', 30);
$gAnz = 0;
$autor = '';
if(isset($_GET['plz'])) {
$autor = escape($_GET['plz'],'string');
}
$tpl->set ('plz', $plz);
if(isset($_GET['in'])) {
for($i=1;$i<=3;$i++){
if($_GET['in'] == $i) {
$tpl->set ('checked'.$i, 'checked="checked"');
}
}
} else $tpl->set ('checked1', 'checked="checked"');
if ($such != 'augt' AND $such != 'aeit' AND $such != 'aubt') {
$tpl->set('searchgb',escape_for_fields($such),0);
}
if(isset($_GET['plz'])) {
$plz = ($_GET['plz'] == 10 ? 10 : intval($_GET['plz']));
}
else $plz = 10;
$plz_ar = array( 10 => 'Alle Einträge',
1 => 'PLZ mit 1 beginnend',
2 => 'PLZ mit 2 beginnend',
3 => 'PLZ mit 3 beginnend',
4 => 'PLZ mit 4 beginnend',
5 => 'PLZ mit 5 beginnend',
6 => 'PLZ mit 6 beginnend',
7 => 'PLZ mit 7 beginnend',
8 => 'PLZ mit 8 beginnend',
9 => 'PLZ mit 9 beginnend');
$tpl->set('plz',arlistee($plz, $plz_ar));
$tpl->out(0);
if (!empty($such) OR !empty($plz)) {
$page = 1;
if (isset($_GET['gbook'])) {
$page = str_replace('-p','',$_GET['gbook']);
}
$limit = 25; // Limit
$anfang = ($page - 1) * $limit;
$x = time() - (3600 * 24 * $plz);
$such = str_replace('-','',$such);
$such = str_replace('=','',$such);
$such = str_replace('&','',$such);
$serar = explode(' ', $such);
$str_gbook = '';
$str_gbook_a = '';
$str_gbook = '';
$str_gbook_a = '';
$str_gbook = '';
$str_gbook_ = '';
$str_gbook_a = '';
foreach($serar as $v) {
$str = str_replace('\'','',$v);
$str = str_replace('"','',$str);
$str = addslashes($str);
if ( !empty($str) ) {
if($_GET['in'] == 1) {
$str_gbook .= "txt LIKE '%".$str."%' AND ";
}
elseif($_GET['in'] == 2) {
$str_gbook .= "news_text LIKE '%".$str."%' AND ";
}
elseif($_GET['in'] == 3) {
$str_gbook .= "`descl` LIKE '%".$str."%' AND ";
$str_gbook_ .= "name LIKE '%".$str."%' AND ";
}
}
}
if(isset($_GET['pz'])) {
if($_GET['in'] == 1) {
$str_gbook_a .= "c.erst LIKE '%".$autor."%' AND ";
}
elseif($_GET['in'] == 2) {
$str_gbook_a .= "`name` LIKE '%".$autor."%' AND ";
}
elseif($_GET['in'] == 3) {
$str_gbook_a .= "`creater` LIKE '%".$autor."%' AND ";
}
}
// 1 = gbook, ist immer standart
$q = "
SELECT DISTINCT
a.fid as fid,
a.name as titel,
'foru' as typ,
a.id as id,
`time`,
c.erst as plz
FROM prefix_posts c
LEFT JOIN prefix_topics a ON a.id = c.tid
LEFT JOIN prefix_forums b ON b.id = a.fid
LEFT JOIN prefix_groupusers vg ON vg.uid = ".$_SESSION['authid']." AND vg.gid = b.view
LEFT JOIN prefix_groupusers rg ON rg.uid = ".$_SESSION['authid']." AND rg.gid = b.reply
LEFT JOIN prefix_groupusers sg ON sg.uid = ".$_SESSION['authid']." AND sg.gid = b.start
WHERE (((b.view >= ".$_SESSION['authright']." AND b.view <= 0) OR
(b.reply >= ".$_SESSION['authright']." AND b.reply <= 0) OR
(b.start >= ".$_SESSION['authright']." AND b.start <= 0)) OR
(vg.fid IS NOT NULL OR rg.fid IS NOT NULL OR sg.fid IS NOT NULL OR ".$_SESSION['authright']." = -9))
AND (".$str_gbook." 1 = 1)
AND (".$str_gbook_a." 1 = 1)
AND (time >= ". $x .")
GROUP BY a.id
ORDER BY time DESC";
if(isset($_GET['in'])) {
if($_GET['in'] == 2) {
$q = "
SELECT DISTINCT
0 as fid,
news_title as titel,
'news' as typ,
news_id as id,
news_time as `time`,
prefix_user.name as autor
FROM prefix_news
LEFT JOIN prefix_user ON prefix_news.user_id = prefix_user.id
WHERE (".$str_news." 1 = 1)
AND (".$str_gbook_a." 1 = 1)
AND (news_time >= ". $x .")
ORDER BY `time` DESC";
} elseif($_GET['in'] == 3) {
$q = "
SELECT DISTINCT
0 as fid,
CONCAT( name, ' ', version ) AS titel,
'down' as typ,
id,
UNIX_TIMESTAMP(`time`) as `time`,
creater as autor
FROM prefix_downloads
WHERE ((".$str_downs." 1 = 1)
OR (".$str_gbook_." 1 = 1))
AND (".$str_gbook_a." 1 = 1)
AND (UNIX_TIMESTAMP(`time`) >= ". $x .")
ORDER BY UNIX_TIMESTAMP(`time`) DESC";
}
}
$gAnz = db_num_rows(db_query($q));
$q .= " LIMIT ".$anfang.",".$limit;
$MPL = db_make_sites ($gbook , "" , $limit , "index.php?searchgb=".urlencode($such)."&autor=".urlencode($autor)."&in=".$_GET['in']."&plz=".$plz."&gbook=", "", $gAnz );
$tpl->set_ar_out(array('MPL'=>$MPL,'gAnz'=>$gAnz),1);
$q = db_query($q);
$class = '';
while($r = db_fetch_assoc($q) ) {
$class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$r['class'] = $class;
if ($r['typ'] == 'foru') {
$r['ctime'] = db_result(db_query("SELECT MAX(time) FROM prefix_posts WHERE tid = ".$r['id']),0,0);
$r['ord'] = gbook_get_ordner($r['ctime'],$r['id'],$r['fid']);
$r['link'] = 'gbook'.$r['id'];
} elseif ($r['typ'] == 'gbook') {
$r['ord'] = 'ord';
$r['link'] = 'gbook'.$r['id'];
} elseif ($r['typ'] == 'down') {
$r['ord'] = 'ord';
$r['link'] = 'gbook'.$r['id'];
}
$tpl->set_ar_out($r,2);
}
$tpl->out(3);
}
$design->footer();
?>
search.htm
<form action="index.php?searchgb" method="GET">
<table>
<tr><td height="5"></td></tr>
<tr><td>
</td></tr>
<tr><td>
PLZ eingrenzen: <select name="PLZ">{plz}</select>
</td></tr>
<tr height="14"><td></td></tr>
<tr><td><input type="submit" value="{_lang_search}" /></td></tr>
</table>
</form>
<hr>
{EXPLODE}
<br /><br />
<div style="float: left">{MPL}</div>
<div style="float: right; text-align: right">Gesamt: {gAnz}</div><br /><br />
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="border">
{EXPLODE}<tr class="{gbook}">
<td class="erstezeile" width="15"><img src="include/images/forum/{ord}.png" border="0"></td>
<td class="erstezeile"><a href="?{link}">{plz} von {autor}</a></td>
</tr>{EXPLODE}
</table>
{MPL}