YourWBB


yourWBB » WoltLab Burning Board Generation 2 * » Alles von und für das WBB 2.3.x » [WBB 2.3.x] Hacks und Addons » 4 Button Startseiten Optionen Hack » Hallo Gast [Anmelden|Registrieren]
Letzter Beitrag | Erster ungelesener Beitrag 7.978 Views | | Thema zu Favoriten hinzufügen
Seiten (2): [1] 2 nächste »
Neues Thema erstellen Antwort erstellen

Zum Ende der Seite springen 4 Button Startseiten Optionen Hack
Autor
Beitrag « Vorheriges Thema | Nächstes Thema »
Yyoshii
Mitglied


images/avatars/avatar-4962.gif

Dabei seit: 18.01.04
Beiträge: 304
Forenversion: 2.3

 4 Button Startseiten Optionen Hack Antworten Zitieren Editieren Melden       UP

Titel: 4 Button Startseiten Optionen Hack
Version: 1.0
Beschreibung: Damals fürs WBB 2.1 umgecoded, nun wieder Verfügbar für das WBB 2.3.6

Folgende Buttons sind auf der Startseite Verfügbar:
einer mit dem man direkt einen neuen Thread erstellen kann,
einer mit dem man das jeweilige Forum zu den Favoriten hinzufügen kann,
einer mit dem man das jeweilige Forum durchsucht,
einer mit dem man das jeweilige Forum als gelesen markieren kann.

[IMG]http://www.toolsites.de/optionhack.JPG[/IMG]

11.04.07
Anleitung Angepasst
Codestellen überarbeitet
----


weiter zum Download


__________________
Hacks:
Advanced Header by Yyoshii (2.1.x & 2.2.x & AWH 2.3.x & AWH 2.3.x V2)
Optionen Hack mit 4 Buttons
Programm Add
Template:
Border um die Signatur
Anleitung:
Anleitung um Maarc's HideHack auf 2.2 zum laufen zu bringen
10.04.07 17:12 Yyoshii ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Yyoshii in deine Kontaktliste ein
HTML_Meister
Alternativ Mitglied


Dabei seit: 09.02.05
Beiträge: 42

Antworten Zitieren Editieren Melden       UP

Hallo

Ich finde im INDEX.tpl nicht:

php:
1:
<td class="tabletitle" align="center"><span class="smallfont"><b>{$lang->items['LANG_START_POSTS']}</b></span></td>

geschweige:
php:
1:
LANG_START_POSTS

Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von HTML_Meister: 10.04.07 20:52.

10.04.07 20:51 HTML_Meister ist offline Finden Als Freund hinzufügen
Maniac_81 Maniac_81 ist männlich
PHP Profi


images/avatars/avatar-5230.gif

Dabei seit: 27.06.06
Beiträge: 2.087
Fähigkeiten: WBB3 Anfänger; WBB2 Profi
Herkunft: localhost/
Forenversion: 2.3; Lite 2.0

Antworten Zitieren Editieren Melden       UP

Zitat:
Original von HTML_Meister
Hallo

Ich finde im INDEX.tpl nicht:

php:
1:
<td class="tabletitle" align="center"><span class="smallfont"><b>{$lang->items['LANG_START_POSTS']}</b></span></td>

geschweige:
php:
1:
LANG_START_POSTS


dann hast du wahrscheinlich getrennte kategorien?
dann findest die stelle in der "index_catbit.tpl"

__________________
zufrieden mit meinem Support? dann hier bitte bewerten!

Sie haben 3 gelbe Bananen gewählt!

ÄPFEL! 3!!!

Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von Maniac_81: 10.04.07 21:03.

10.04.07 20:58 Maniac_81 ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Maniac_81 in deine Kontaktliste ein MSN Passport-Profil von Maniac_81 anzeigen
HTML_Meister
Alternativ Mitglied


Dabei seit: 09.02.05
Beiträge: 42

Antworten Zitieren Editieren Melden       UP

OK Augenzwinkern

Nun soll ich aber in der "index_catbit.tpl"

php:
1:
2:
3:
4:
5:
Diese Zeile (kommt mehrfach vor):
<if($hide_modcell==0)><then>6</then><else>5

in das ändern:
<if($hide_modcell==0)><then>7</then><else>6


Und das kommt bei mir au ned vor.
10.04.07 21:45 HTML_Meister ist offline Finden Als Freund hinzufügen
Maniac_81 Maniac_81 ist männlich
PHP Profi


images/avatars/avatar-5230.gif

Dabei seit: 27.06.06
Beiträge: 2.087
Fähigkeiten: WBB3 Anfänger; WBB2 Profi
Herkunft: localhost/
Forenversion: 2.3; Lite 2.0

Antworten Zitieren Editieren Melden       UP

also normal is das schon darin enthalten, ausser der coder deines styles hat dies rausgelassen. poste doch mal deine index_catbit.tpl bitte.

__________________
zufrieden mit meinem Support? dann hier bitte bewerten!

Sie haben 3 gelbe Bananen gewählt!

ÄPFEL! 3!!!

10.04.07 21:49 Maniac_81 ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Maniac_81 in deine Kontaktliste ein MSN Passport-Profil von Maniac_81 anzeigen
HTML_Meister
Alternativ Mitglied


Dabei seit: 09.02.05
Beiträge: 42

Antworten Zitieren Editieren Melden       UP

Ich habe sie schon bis zu dem Punkt wo ich nicht weiterkomme bearbeitet.

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
</table>
<table cellspacing="0" cellpadding="0" border="0" style="width:{$style['tableinwidth']}"><tr>
<td align="left"><img src="{$style['imagefolder']}/untenlinks.gif" alt="" title="" /></td>
<td style="width:100%" class="untenmitte" align="center"><img src="{$style['imagefolder']}/untengrafik.gif" alt="" title="" /></td>
<td align="right"><img src="{$style['imagefolder']}/untenrechts.gif" alt="" title="" /></td>
</tr></table>
<br />
<table cellspacing="0" cellpadding="0" border="0" style="width:{$style['tableinwidth']}" class="obenmitte"><tr>
<td align="left"><img src="{$style['imagefolder']}/obenlinks.gif" alt="" title="" /></td>
<td style="width:100%" align="center">
<table cellspacing="0" cellpadding="0" border="0" style="width:100%"><tr>
<td align="center"><img src="{$style['imagefolder']}/obengrafik.gif" alt="" title="" /></td>
<td><span class="normalfont"><if($show_hide == 1)><then><a href="$current_url"><img src="{$style['imagefolder']}/minus.gif" border="0" alt="{$LANG_START_DEACTIVATE_CAT}" title="{$LANG_START_DEACTIVATE_CAT}" /></a></then><else><if($show_hide == 2)><then><a href="$current_url"><img src="{$style['imagefolder']}/plus.gif" border="0" alt="{$LANG_START_SHOWCAT}" title="{$LANG_START_SHOWCAT}" /></a></then></if></else></if></span></td>
</table>
</td>
<td align="right"><img src="{$style['imagefolder']}/obenrechts.gif" alt="" title="" /></td>
</tr></table>
<table cellpadding="{$style['tableincellpadding']}" cellspacing="{$style['tableincellspacing']}" border="{$style['tableinborder']}" style="width:{$style['tableinwidth']}" class="tableinborder">
 <tr>
 <td class="tablecat" align="left" colspan="<if($hide_modcell==0)><then>7</then><else>6</else></if>"><table cellpadding="0" cellspacing="0">
  <tr class="tablecat_fc">
   <td><span class="normalfont"><a href="board.php?boardid=$boards[boardid]&amp;sid=$session[hash]"><b>$boards[title]</b></a></span><span class="smallfont"><if($boards['description']!="")><then><br />$boards[description]</then></if><if($subboardbit!="")><then><br />{$lang->items['LANG_START_INCLUSIVE']} $subboardbit</then></if></span></td>
  </tr>
 </table></td>
</tr>
<switch($depth)>
 <case(1)> 
 <tr>
  <td class="tabletitle"><span class="smallfont">&nbsp;</span></td>
  <td class="tabletitle" style="width:<if($hide_modcell==0)><then>60</then><else>80</else></if>%" align="left"><span class="smallfont"><b>{$lang->items['LANG_START_BOARDS']}</b></span></td>
  <td class="tabletitle" align="center"><span class="smallfont"><b>{$lang->items['LANG_START_OPTIONS']}</b></font></td>
  <td class="tabletitle" align="center" style="width:60px" nowrap="nowrap"><span class="smallfont"><b>{$lang->items['LANG_START_POSTS']}</b></span></td>
  <td class="tabletitle" align="center" style="width:60px" nowrap="nowrap"><span class="smallfont"><b>{$lang->items['LANG_START_THREADS']}</b></span></td>
  <td class="tabletitle" align="center" nowrap="nowrap" style="width:280px"><span class="smallfont"><b>{$lang->items['LANG_START_LASTPOST']}</b></span></td>
  <if($hide_modcell==0)><then><td class="tabletitle" style="width:20%" align="center" nowrap="nowrap"><span class="smallfont"><b>{$lang->items['LANG_START_MODERATORS']}</b></span></td></then></if>
 </tr>
 

 
 
 </default>
</switch>
10.04.07 21:50 HTML_Meister ist offline Finden Als Freund hinzufügen
Maniac_81 Maniac_81 ist männlich
PHP Profi


images/avatars/avatar-5230.gif

Dabei seit: 27.06.06
Beiträge: 2.087
Fähigkeiten: WBB3 Anfänger; WBB2 Profi
Herkunft: localhost/
Forenversion: 2.3; Lite 2.0

Antworten Zitieren Editieren Melden       UP

Zeile 20 & 30 Augenzwinkern

da wurde halt anders gecodet. die hacks werden ja immer ans standart-template gerichtet.

__________________
zufrieden mit meinem Support? dann hier bitte bewerten!

Sie haben 3 gelbe Bananen gewählt!

ÄPFEL! 3!!!

Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von Maniac_81: 10.04.07 21:55.

10.04.07 21:53 Maniac_81 ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Maniac_81 in deine Kontaktliste ein MSN Passport-Profil von Maniac_81 anzeigen
HTML_Meister
Alternativ Mitglied


Dabei seit: 09.02.05
Beiträge: 42

Antworten Zitieren Editieren Melden       UP

Zitat:
Original von Maniac_81
Zeile 20 & 30 Augenzwinkern

da wurde halt anders gecodet. die hacks werden ja immer ans standart-template gerichtet.


Sorry, aber was soll ich dort machen verwirrt

// EDIT:

Danach heißt es auch noch

php:
1:
2:
3:
4:
5:
dann alle (kommt mehrfach vor):
<if($hide_modcell==0)><then>5</then><else>4

in das ändern:
<if($hide_modcell==0)><then>6</then><else>5

Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von HTML_Meister: 10.04.07 21:57.

10.04.07 21:56 HTML_Meister ist offline Finden Als Freund hinzufügen
Maniac_81 Maniac_81 ist männlich
PHP Profi


images/avatars/avatar-5230.gif

Dabei seit: 27.06.06
Beiträge: 2.087
Fähigkeiten: WBB3 Anfänger; WBB2 Profi
Herkunft: localhost/
Forenversion: 2.3; Lite 2.0

Antworten Zitieren Editieren Melden       UP

in zeile 20 is es ja schon geändert:

<if($hide_modcell==0)><then>7</then><else>6</else></if>">

sollte eigetnlich gehen. mach die halt ein backup und probier halt mal rum. is doch nur HTML, für nen Meister doch kein Problem...

__________________
zufrieden mit meinem Support? dann hier bitte bewerten!

Sie haben 3 gelbe Bananen gewählt!

ÄPFEL! 3!!!

10.04.07 21:59 Maniac_81 ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Maniac_81 in deine Kontaktliste ein MSN Passport-Profil von Maniac_81 anzeigen
HTML_Meister
Alternativ Mitglied


Dabei seit: 09.02.05
Beiträge: 42

Antworten Zitieren Editieren Melden       UP

Sooo und nochmal Augenzwinkern


code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:

>>>> search.php <<<<

Suche das:
if (!$boardids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
}

Darunter das einfügen:
if ($onlyboard != "") {
	$boardids = $onlyboard;
}



Das kommt bei mir 5 mal vor.... soll ich alle ersetzen ?
10.04.07 22:08 HTML_Meister ist offline Finden Als Freund hinzufügen
Mondstaub Mondstaub ist männlich
Mitglied


images/avatars/avatar-4990.jpg

Dabei seit: 25.01.04
Beiträge: 369
Herkunft: Sachsen
Forenversion: 2.3

Antworten Zitieren Editieren Melden       UP

Nettes Teil auch wenn seit Jahren keiner sich um die popeligen xhtml Fehler da drin geschert hat. Aber das scheint sowieso out zu sein großes Grinsen

__________________
**Was guckst du...?**

10.04.07 22:26 Mondstaub ist offline WWW Finden Als Freund hinzufügen
Yyoshii
Mitglied


images/avatars/avatar-4962.gif

Dabei seit: 18.01.04
Beiträge: 304
Forenversion: 2.3

Themenstarter Thema begonnen von Yyoshii
Antworten Zitieren Editieren Melden       UP

Also der Hack wurde für das Standard WBB gecoded, wenn nun schon mehrere Hacks die Boardansicht ändern, dann übernehme ich keine Garantie für die Funktion des Hacks.

Bei einer Standard Installation des WBB funktioniert der Hack zu 100%

__________________
Hacks:
Advanced Header by Yyoshii (2.1.x & 2.2.x & AWH 2.3.x & AWH 2.3.x V2)
Optionen Hack mit 4 Buttons
Programm Add
Template:
Border um die Signatur
Anleitung:
Anleitung um Maarc's HideHack auf 2.2 zum laufen zu bringen
10.04.07 23:10 Yyoshii ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Yyoshii in deine Kontaktliste ein
HTML_Meister
Alternativ Mitglied


Dabei seit: 09.02.05
Beiträge: 42

Antworten Zitieren Editieren Melden       UP

Dass du keine Garantie übernhemen kannst ist mir klar Augenzwinkern Aber ich poste mal meine search.php. Vielleicht könnt ihr mir dann helfen.

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593:
594:
595:
596:
597:
598:
599:
600:
601:
602:
603:
604:
605:
606:
607:
608:
609:
610:
611:
612:
613:
614:
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698:
699:
700:
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725:
<?php

$filename 'search.php';
@set_time_limit(0);
require('./global.php');

if (!$wbbuserdata['can_use_search']) access_error();
$lang->load('SEARCH');

if (!isset($_GET['action'])) $_GET['action'] = '';


/**
* @return boardids string
* @desc returns the boards to which the current user has access.
*/
function getSearchableBoards() {
    global $db$n$wbbuserdata$boardcache;
    
    if (!isset($boardcache) || !is_array($boardcache)) $boardcache = array();
    $result $db->query("SELECT boardid,boardorder,parentid,parentlist FROM bb".$n."_boards ORDER BY parentid ASC, boardorder ASC");
    while ($row $db->fetch_array($result)) {
        $boardcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row;
    }

    $boardpermissions getPermissions();
    $boardids '';
    foreach ($boardcache as $key => $val) {
        foreach ($val as $key2 => $val2) {
            foreach ($val2 as $row) if (!isset($boardpermissions[$row['boardid']]['can_use_search']) || $boardpermissions[$row['boardid']]['can_use_search'] != 0$boardids .= ",".$row['boardid'];
        }    
    }
    return $boardids;
}


/**
* @return queryhash string
* @desc returns the hash of a particular search query
*/
function getQueryHash($postIDs$showPosts$sortBy$sortOrder$userID$ipAddress) {
    return md5($postIDs "\n" $showPosts "\n" $sortBy "\n" $sortOrder "\n" $userID "\n" $ipAddress);
}


/* new posts */
if ($_GET['action'] == 'new') {
    $boardids '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");
    
    $result $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
        while ($row $db->fetch_array($result)) {
            if ($boardids != ''$boardids .= ','.$row['boardid'];
            else $boardids $row['boardid'];
        }
        if (!$boardidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    }
    
    $savepostids '';
    $result $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1 AND p.posttime>'$wbbuserdata[lastvisit]'
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row $db->fetch_array($result)) $savepostids .= ','.$row['postid'];
    
    if (!$savepostidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    $result $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids0'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
        header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
        exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids0'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','0','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid $db->insert_id();
    
    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();     
}

/* new threads 24h */
if ($_GET['action'] == '24h') {
    $boardids '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");
    
    $result $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
        while ($row $db->fetch_array($result)) {
            if ($boardids != ''$boardids .= ','.$row['boardid'];
            else $boardids $row['boardid'];
        }
        if (!$boardidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    }    
    
    $savepostids '';
    $datecute time() - 86400;
    $result $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1 AND p.posttime>'$datecute'
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row $db->fetch_array($result)) $savepostids .= ','.$row['postid'];
    
    if (!$savepostidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    $result $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids0'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
        header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
        exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids0'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','0','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid $db->insert_id();
    
    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();     
}

/* userposts */
if ($_GET['action'] == 'user') {
    if (!isset($_GET['userid'])) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array('$adminmail' => $adminmail)));
    
    $boardids '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");
    
    $result $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
        while ($row $db->fetch_array($result)) {
            if ($boardids != ''$boardids .= ','.$row['boardid'];
            else $boardids $row['boardid'];
        }
        if (!$boardidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    }    
    
    $savepostids '';
    $userid intval($_GET['userid']);
    $result $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1 AND p.userid='$userid'
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row $db->fetch_array($result)) $savepostids .= ','.$row['postid'];
    
    if (!$savepostidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    $result $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids1'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
        header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
        exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids1'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','1','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid $db->insert_id();
    
    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();    
}

/* threads with polls */
if ($_GET['action'] == 'polls') {
    $boardids '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");
    
    $result $db->query("SELECT threadid FROM bb".$n."_polls WHERE timeout = 0 OR starttime + 86400 * timeout > '".time()."'");
    $threadIDs '';
    while ($row $db->fetch_array($result)) {
        $threadIDs .= "," $row['threadid'];
    }
    if (!$threadIDsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
        
    $result $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
        while ($row $db->fetch_array($result)) {
            if ($boardids != ''$boardids .= ','.$row['boardid'];
            else $boardids $row['boardid'];
        }
        if (!$boardidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    }    
    
    $savepostids '';
    $time time();
    $datecute $time 86400;
    $result $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND t.threadid IN (0".$threadIDs.") AND p.visible=1 
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row $db->fetch_array($result)) {
        $savepostids .= ','.$row['postid'];
    }
    
    if (!$savepostidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
    $result $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids0'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
        header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
        exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids0'lastpost''desc'$wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','0','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid $db->insert_id();
    
    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();    
}

if (isset($_GET['searchid'])) {
    require('./acp/lib/class_parse.php');
    
    $searchid intval($_GET['searchid']);
    if ($wbbuserdata['userid']) $search $db->query_first("SELECT * FROM bb".$n."_searchs WHERE searchid='$searchid' AND userid='$wbbuserdata[userid]'");
    else $search $db->query_first("SELECT * FROM bb".$n."_searchs WHERE searchid='$searchid' AND ipaddress='$REMOTE_ADDR'");
    
    if (!$search['searchid']) access_error();
    
    if ($search['showposts'] == 1) {
        $lang->load('THREAD');
        
        switch ($search['sortby']) {
            case "topic"$sortby "p.posttopic"; break;
            case "replycount"$sortby "t.replycount"; break;
            case "lastpost"$sortby "p.posttime"; break;
            case "author"$sortby "p.username"; break;
            case "board"$sortby "b.title"; break;
            case "views"$sortby "t.views"; break;
            default: $sortby "p.posttime"; 
        }
        
        switch ($search['sortorder']) {
            case "asc"$sortorder "asc"; break;
            case "desc"$sortorder "desc"; break;
            default: $sortorder "desc";
        }
        
        list($postcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_posts WHERE postid IN (0$search[postids])");
        
        if ($wbbuserdata['umaxposts']) $postsperpage $wbbuserdata['umaxposts'];
        else $postsperpage $default_postsperpage;
        if (isset($_GET['page'])) {
            $page intval($_GET['page']);
            if ($page 1$page 1;
        }
        else $page 1;
        $pages ceil($postcount $postsperpage);
        if ($pages 1$pagelink makepagelink("search.php?searchid=$searchid".$SID_ARG_2ND$page$pages$showpagelinks 1);
        
        $l_posts = ($page 1) * $postsperpage 1;
        $h_posts $page $postsperpage;
        if ($h_posts $postcount$h_posts $postcount;
        
        $threadjoin '';
        $boardjoin '';
        if (strstr($sortby't.') || strstr($sortby'b.')) $threadjoin "LEFT JOIN bb".$n."_threads t USING (threadid)";
        if (strstr($sortby'b.')) $boardjoin "LEFT JOIN bb".$n."_boards b USING (boardid)";
        
        $postids '';
        $result $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p
        $threadjoin
        $boardjoin
        WHERE p.postid IN (0$search[postids])
        ORDER BY $sortby $sortorder"0$postsperpage$postsperpage * ($page 1));
        
        while ($row $db->fetch_array($result)) $postids .= ",".$row[postid];
        
        $parse = &new parse($docensor75$wbbuserdata['showimages'], $search['searchstring'], $usecode);
        $result $db->query("SELECT
        p.*,
        t.topic, t.replycount, t.views, t.boardid, t.lastposttime, t.closed, t.prefix, 
        b.title, b.hotthread_reply, b.hotthread_view,
        i.iconpath, i.icontitle
        ".(($wbbuserdata['userid']) ? (", bv.lastvisit AS boardlastvisit, tv.lastvisit AS threadlastvisit") : (""))."
        FROM bb".$n."_posts p
        LEFT JOIN bb".$n."_threads t USING (threadid)
        LEFT JOIN bb".$n."_boards b USING (boardid)
        LEFT JOIN bb".$n."_icons i ON (p.iconid=i.iconid)
        ".(($wbbuserdata['userid']) ? ("LEFT JOIN bb".$n."_boardvisit bv ON (bv.boardid=b.boardid AND bv.userid='".$wbbuserdata['userid']."') LEFT JOIN bb".$n."_threadvisit tv ON (tv.threadid=t.threadid AND tv.userid='".$wbbuserdata['userid']."')") : (""))."
        WHERE p.postid IN (0$postids)
        ORDER BY $sortby $sortorder");
        
        $count 0;
        $postbit '';
        while ($posts $db->fetch_array($result)) {
            $tdclass getone($count"tablea""tableb");
            
            if ($posts['hotthread_reply'] == 0$posts['hotthread_reply'] = $default_hotthread_reply;
            if ($posts['hotthread_view'] == 0$posts['hotthread_view'] = $default_hotthread_view;
            
            if ($posts['boardlastvisit'] > $posts['threadlastvisit']) $posts['threadlastvisit'] = $posts['boardlastvisit'];
            if ($wbbuserdata['lastvisit'] > $posts['threadlastvisit']) $posts['threadlastvisit'] = $wbbuserdata['lastvisit'];
            
            $foldericon = (($posts['lastposttime'] > $posts['threadlastvisit']) ? ("new") : ("")).(($posts['replycount'] >= $posts['hotthread_reply'] || $posts['views'] >= $posts['hotthread_view']) ? ("hot") : ("")).(($posts['closed'] != 0) ? ("lock") : (""))."folder";
            
            $posts['message'] = $parse->doparse($posts['message'], $posts['allowsmilies'], $posts['allowhtml'], $posts['allowbbcode'], $posts['allowimages']);
            $posts['posttopic'] = htmlconverter(textwrap($posts['posttopic']));
            $posts['topic'] = htmlconverter(textwrap($posts['topic']));
            $posts['username'] = htmlconverter($posts['username']);
            
            if ($posts['iconid']) $posticon makeimgtag($posts['iconpath'], getlangvar($posts['icontitle'], $lang), 0);
            else $posticon '';
            if ($posts['lastposttime'] > $posts['threadlastvisit']) $newpost 1;
            else $newpost 0;
            $postdate formatdate($wbbuserdata['dateformat'], $posts['posttime'], 1);
            $posttime formatdate($wbbuserdata['timeformat'], $posts['posttime']);
            
            if ($posts['replycount'] >= 1000$posts['replycount'] = number_format($posts['replycount'], 0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
            if ($posts['views'] >= 1000$posts['views'] = number_format($posts['views'], 0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
            
            $posts['title'] = getlangvar($posts['title'], $lang);
            
            eval("\$postbit .= \"".$tpl->get("search_postbit")."\";");
            $count++;
        }
        
        $lang->items['LANG_SEARCH_RESULT_HITS_POSTS'] = $lang->get("LANG_SEARCH_RESULT_HITS_POSTS", array('$l_posts' => number_format($l_posts0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP")), '$h_posts' => number_format($h_posts0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP")), '$postcount' => number_format($postcount0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP"))));
        eval("\$tpl->output(\"".$tpl->get("search_post")."\");");
    }
    else {
        $lang->load("BOARD");
        $board['allowratings'] = 1;
        
        switch ($search['sortby']) {
            case "topic"$sortby "t.topic"; break;
            case "replycount"$sortby "t.replycount"; break;
            case "lastpost"$sortby "t.lastposttime"; break;
            case "author"$sortby "t.starter"; break;
            case "board"$sortby "b.title"; break;
            case "views"$sortby "t.views"; break;
            default: $sortby "t.lastposttime";
        }
        
        switch ($search['sortorder']) {
            case "asc"$sortorder "asc"; break;
            case "desc"$sortorder "desc"; break;
            default: $sortorder "desc";
        }
        
        $search['searchstring'] = urlencode($search['searchstring']);
        
        $threadids '';
        $result $db->query("SELECT DISTINCT threadid FROM bb".$n."_posts WHERE postid IN (0$search[postids])");
        $threadcount $db->num_rows($result);
        while ($row $db->fetch_array($result)) $threadids .= ','.$row['threadid'];
        
        $threadsperpage $default_threadsperpage;
        if (isset($_GET['page'])) {
            $page intval($_GET['page']);
            if ($page 1$page 1;
        }
        else $page 1;
        $pages ceil($threadcount $threadsperpage);
        if ($pages 1$pagelink makepagelink("search.php?searchid=$searchid".$SID_ARG_2ND$page$pages$showpagelinks 1);
        
        $result $db->unbuffered_query("SELECT t.threadid FROM bb".$n."_threads t
        ".(($sortby == "f.title") ? ("LEFT JOIN bb".$b."_boards b USING (boardid)") : (""))."
        WHERE t.threadid IN (0$threadids)
        ORDER BY $sortby $sortorder"0$threadsperpage$threadsperpage * ($page 1));
        $threadids '';
        while ($row $db->fetch_array($result)) $threadids .= ','.$row['threadid'];
        
        if ($showown && $wbbuserdata['userid']) {
            $ownuserid "DISTINCT p.userid,";
            $ownjoin "LEFT JOIN bb".$n."_posts p ON (t.threadid = p.threadid AND p.userid = '$wbbuserdata[userid]')";
        }
        else {
            $ownuserid "";
            $ownjoin "";    
        }
        
        if ($wbbuserdata['userid']) {
            $vselect ", bv.lastvisit AS boardlastvisit, tv.lastvisit AS threadlastvisit";
            $vjoin " LEFT JOIN bb".$n."_boardvisit bv ON (bv.boardid=b.boardid AND bv.userid='".$wbbuserdata['userid']."') LEFT JOIN bb".$n."_threadvisit tv ON (tv.threadid=t.threadid AND tv.userid='".$wbbuserdata['userid']."')";
        }
        else {
            $vselect '';
            $vjoin '';
        }
        
        $result $db->unbuffered_query("SELECT
        $ownuserid
        t.*,
        b.title, b.hotthread_reply, b.hotthread_view, b.postsperpage,
        i.*
        $vselect
        FROM bb".$n."_threads t
        LEFT JOIN bb".$n."_icons i USING (iconid)
        LEFT JOIN bb".$n."_boards b ON (b.boardid=t.boardid)
        $ownjoin
        $vjoin
        WHERE t.threadid IN (0$threadids)
        ORDER BY $sortby $sortorder");
        
        while ($threads $db->fetch_array($result)) {
            unset($firstnew);
            unset($multipages);
            unset($attachments);
            $prefix '';
            
            if ($threads['boardlastvisit'] > $threads['threadlastvisit']) $threads['threadlastvisit'] = $threads['boardlastvisit'];
            if ($wbbuserdata['lastvisit'] > $threads['threadlastvisit']) $threads['threadlastvisit'] = $wbbuserdata['lastvisit'];
            
            $threads['topic'] = htmlconverter(textwrap($threads['topic']));
            $threads['starter'] = htmlconverter(textwrap($threads['starter'], 25));
            $threads['lastposter'] = htmlconverter(textwrap($threads['lastposter'], 25));
            $threads['prefix'] = htmlconverter($threads['prefix']);
            
            if ($threads['voted'] && $threads['voted'] >= $showvotes$threadrating threadrating($threads['votepoints'], $threads['voted']);
            else $threadrating "&nbsp;";    
            
            if ($threads['hotthread_reply'] == 0$threads['hotthread_reply'] = $default_hotthread_reply;
            if ($threads['hotthread_view'] == 0$threads['hotthread_view'] = $default_hotthread_view;
            
            if ($threads['important'] == 2$foldericon "announce";    
            else $foldericon = ((isset($threads['userid']) && $threads['userid']) ? ("dot") : ("")).(($threads['lastposttime'] > $threads['threadlastvisit']) ? ("new") : ("")).(($threads['replycount'] >= $threads['hotthread_reply'] || $threads['views'] >= $threads['hotthread_view']) ? ("hot") : ("")).(($threads['closed'] != 0) ? ("lock") : (""))."folder";
            if ($threads['lastposttime'] > $threads['threadlastvisit']) $firstnew 1;
            
            if ($threads['pollid'] != 0$threadicon makeimgtag($style['imagefolder']."/poll.gif""");
            elseif ($threads['iconid']) $threadicon makeimgtag($threads['iconpath'], getlangvar($threads['icontitle'], $lang), 0);
            else $threadicon "&nbsp;";
            
            $lastpostdate formatdate($wbbuserdata['dateformat'], $threads['lastposttime'], 1);
            $lastposttime formatdate($wbbuserdata['timeformat'], $threads['lastposttime']);
            
            if ($wbbuserdata['umaxposts']) $postsperpage $wbbuserdata['umaxposts'];
            elseif ($threads['postsperpage']) $postsperpage $threads['postsperpage'];
            else $postsperpage $default_postsperpage;
            
            if ($threads['replycount'] + $postsperpage && $showmultipages != 0) {
                unset($multipage);
                unset($multipages_lastpage);
                $xpages ceil(($threads['replycount'] + 1) / $postsperpage);
                if ($xpages $showmultipages) {
                    eval("\$multipages_lastpage = \"".$tpl->get("board_threadbit_multipages_lastpage")."\";");
                    $xpages $showmultipages;
                }
                for ($i 1$i <= $xpages$i++) {
                    $multipage .= " ".makehreftag("thread.php?threadid=".$threads['threadid']."&amp;hilight=".$search['searchstring']."&amp;hilightuser=".$search['searchuserid']."&amp;page=$i".$SID_ARG_2ND$i);
                }
                eval("\$multipages = \"".$tpl->get("board_threadbit_multipages")."\";");
            }
            
            if ($threads['attachments']) $LANG_BOARD_ATTACHMENTS $lang->get("LANG_BOARD_ATTACHMENTS", array('$attachments' => $threads['attachments']));
            
            if ($threads['replycount'] >= 1000$threads['replycount'] = number_format($threads['replycount'], 0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
            if ($threads['views'] >= 1000$threads['views'] = number_format($threads['views'], 0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
            
            $threads['title'] = getlangvar($threads['title'], $lang);
            
            eval("\$threadbit .= \"".$tpl->get("board_threadbit")."\";");
        }
        
        $l_threads = ($page 1) * $threadsperpage 1;
        $h_threads $page $threadsperpage;
        if ($h_threads $threadcount$h_threads $threadcount;
        
        $lang->items['LANG_SEARCH_RESULT_HITS_THREADS'] = $lang->get("LANG_SEARCH_RESULT_HITS_THREADS", array('$l_threads' => number_format($l_threads0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP")), '$h_threads' => number_format($h_threads0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP")), '$threadcount' => number_format($threadcount0""$lang->get("LANG_GLOBAL_THOUSANDS_SEP"))));
        eval("\$tpl->output(\"".$tpl->get("search_thread")."\");");
    }
}
else {
    if (isset($_POST['send'])) {
        $searchstring wbb_trim($_POST['searchstring']);
        $searchuser wbb_trim($_POST['searchuser']);
        $searchprefix wbb_trim($_POST['searchprefix']);
        
        if (!$searchstring && !$searchuserredirect($lang->get("LANG_SEARCH_ERROR_INVALIDSEARCH"), "search.php" $SID_ARG_1ST);
                
        $postids '';
        if ($searchstring) {
            $topiconly intval($_POST['topiconly']);
            
            $searchstring preg_replace("/( \+|^\+)/s"" AND "$searchstring);
            $searchstring preg_replace("/( \-|^\-)/s"" NOT "$searchstring);
            $searchstring preg_replace("/[\/,\.:;\(\)\[\]?!#{}%_\-+=\\\\]/s"" "$searchstring);
            $searchstring preg_replace("/['\"]/s"""$searchstring);
            $searchstring preg_replace("/\s{2,}/"" "$searchstring);
            $tempsearchstring $searchstring;
            $searchstring str_replace("*""%"$searchstring);
            $searchstring preg_replace("/(%){2,}/s""%"$searchstring);
            $searchwords preg_split("/[\s]/"wbb_strtolower($searchstring), - 1PREG_SPLIT_NO_EMPTY);
            
            $badwords = array();
            if ($badsearchwords) {
                $temp explode("\n"wbb_strtolower($badsearchwords));
                while (list($key$val) = each($temp)) $badwords[wbb_trim($val)] = 1;
            }
            
            $goodwords = array();
            if ($goodsearchwords) {
                $temp explode("\n"wbb_strtolower($goodsearchwords));
                while (list($key$val) = each($temp)) {
                    unset($badwords[wbb_trim($val)]);
                    $goodwords[wbb_trim($val)] = 1;
                }
            }            
            
            $count_total 0;
            $count_bad 0;
            $firstloop 1;
            $addsplit '';
            $wordids '';
            $tempwordids = array();
            $wordidcache = array();
            $andlist = array();
            $orlist = array();
            $notlist = array();
            $tempwordids = array();
            $foundwordids = array();
            $wordcache = array();
            $doublecount 0;
            $i = array("AND" => 0"OR" => 0"NOT" => 0);
            while (list($key$val) = each($searchwords)) {
                if ($val == "and" || $val == "or" || $val == "not") {
                    $addsplit wbb_strtoupper($val);    
                    continue;
                }
                
                $count_total++;   
                if ((!isset($goodwords[$val]) && !$goodwords[$val]) && ((isset($badwords[$val]) && $badwords[$val] == 1) || wbb_strlen($val) < $minwordlength || wbb_strlen($val) > $maxwordlength)) {
                    $count_bad++;   
                    continue;
                }   
                
                $result $db->query("SELECT wordid FROM bb".$n."_wordlist WHERE word LIKE '$val'");
                if ($db->num_rows($result)) {
                    while ($row $db->fetch_array($result)) {
                        if ($firstloop == 1$tempwordids[] = $row['wordid'];
                        else {
                            if ($addsplit == ''$addsplit "AND";
                            $wordidcache[$addsplit][$i[$addsplit]][] = $row['wordid'];
                            if (count($tempwordids)) {
                                reset($tempwordids);
                                $doublecount 1;
                                while (list($key2$wordid) = each($tempwordids)) {
                                    if ($addsplit == "NOT"$wordidcache['AND'][$i[$addsplit] + 1][] = $wordid;
                                    else $wordidcache[$addsplit][$i[$addsplit] + 1][] = $wordid;
                                }
                                $tempwordids = array();
                            }
                        }
                        $wordids .= ",".$row['wordid'];
                    }
                    $firstloop 0;
                }
                elseif ($firstloop == && $addsplit == "AND") {
                    unset($wordids);
                    break;
                }
                
                
                if ($doublecount == 1) {
                    $i[$addsplit]++;
                    $doublecount 0;
                }
                $i[$addsplit]++;
            }
            
            if ($count_bad && $count_bad == $count_totalredirect($lang->get("LANG_SEARCH_ERROR_SEARCHBAD", array('$minwordlength' => $minwordlength'$maxwordlength' => $maxwordlength)), "search.php" $SID_ARG_1ST);
                        
            if (count($tempwordids)) {
                reset($tempwordids);
                while (list($key2$wordid) = each($tempwordids)) $wordidcache['AND'][$i[$addsplit]][] = $wordid;
            }
            
            $foundpostids = array();
            if ($wordids) {
                $result $db->unbuffered_query("SELECT wordid, postid FROM bb".$n."_wordmatch WHERE wordid IN (0$wordids)".(($topiconly == 1) ? (" AND intopic=1") : ("")));
                while ($row $db->fetch_array($result)) {
                    $foundpostids[$row['wordid']][$row['postid']] = 1;
                }
            }
            
            function myArrayMerge($array$add) {
                while (list($key$val) = each($add)) $array[$key] = $val;
                return $array;    
            }
            
            function mySearchArray($array$add$mode) {
                if ($mode == "OR") return myArrayMerge($array$add);
                if ($mode == "AND") {
                    $newarray = array();
                    while (list($key$val) = each($array)) if ($add[$key] == 1$newarray[$key] = 1;
                    return $newarray;
                }
                if ($mode == "NOT") {
                    while (list($key$val) = each($add)) if ($array[$key] == 1$array[$key] = 0;
                    return $array;    
                }
            }
            
            $globalarray = array();
            $addsplit = array("AND""OR""NOT");
            for ($i 0$i 3$i++) {
                $savearray = array();
                $count 0;
                if (count($wordidcache[$addsplit[$i]])) {
                    reset($wordidcache[$addsplit[$i]]);
                    while (list($key$wordids) = each($wordidcache[$addsplit[$i]])) {
                        $savearray[$count] = array();
                        $badx 1;
                        while (list($key2$wordid) = each($wordids)) {
                            if (isset($foundpostids[$wordid])) {
                                $badx 0;
                                $savearray[$count] = myArrayMerge($savearray[$count], $foundpostids[$wordid]);
                            }
                        }
                        
                        if ($badx == 0) {
                            if (!count($globalarray)) $globalarray $savearray[$count];
                            else $globalarray mySearchArray($globalarray$savearray[$count], $addsplit[$i]);
                        }
                        
                        $count++;
                    }
                }
            }
            
            $postids '';
            while (list($key$val) = each($globalarray)) {
                if ($val != 1) continue;
                if ($postids == ''$postids $key;
                else $postids .= ",$key";    
            }
        }
        
        if ($searchuser) {
            $userids '';
            if ($_POST['name_exactly'] == 1$result $db->unbuffered_query("SELECT userid FROM bb".$n."_users WHERE username='".addslashes($searchuser)."'");
            else $result $db->unbuffered_query("SELECT userid FROM bb".$n."_users WHERE username LIKE '%".addslashes($searchuser)."%'");
            while ($row $db->fetch_array($result)) {
                if ($userids != ''$userids .= ','.$row['userid'];
                else $userids $row['userid'];
            }
        }
        
        if (!$userids && !$postidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
        
        if ($_POST['searchdate']) {
            $cutetime time() - 86400 intval($_POST['searchdate']);
            if ($_POST['beforeafter'] == "after"$searchdate "posttime>='$cutetime'";
            else $searchdate "posttime<'$cutetime'";
        }
        if (isset($_POST['boardids']) && is_array($_POST['boardids'])) {
            reset($_POST['boardids']);
            if (count($_POST['boardids']) && $_POST['boardids'][0] != '*') {
                $tempids '';
                while (list($key$val) = each($_POST['boardids'])) if ($val 0$tempids .= ",".intval($val);
                if ($tempids) {
                    $result $db->unbuffered_query("SELECT boardid, childlist FROM bb".$n."_boards WHERE boardid IN (0$tempids)");
                    $selectedids '';
                    while ($row $db->fetch_array($result)) {
                        $selectedids .= ",".$row['boardid'];
                        if ($row['childlist']) $selectedids .= ",".$row['childlist'];
                    }
                }
            }
        }
        
        $boardids '';
        list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");
        
        // use of getSearchableBoards() to get the boards the current user may access
        $result $db->query("SELECT boardid FROM bb".$n."_boards WHERE ".(($_POST['boardids'][0] != '*') ? ("boardid IN (0$selectedids) AND ") : (""))."password='' AND boardid IN (0".getSearchableBoards().")");
        if ($db->num_rows($result) < $boardcount) {
            while ($row $db->fetch_array($result)) {
                if ($boardids != ''$boardids .= ','.$row['boardid'];
                else $boardids $row['boardid'];
            }
            if (!$boardidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
        }
        
        $savepostids '';
        $result $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1"
        . (($postids) ? (" AND p.postid IN (".$postids.")") : (""))
        . (($userids) ? (" AND ".((isset($_POST['onlystarter']) && $_POST['onlystarter'] == 1) ? ("t.starterid") : ("p.userid"))." IN ($userids)") : (""))
        . (($boardids) ? (" AND t.boardid IN (".$boardids.")") : (""))
        . (($searchprefix) ? (" AND t.prefix = '".addslashes($searchprefix)."'") : (""))
        . (($searchdate) ? (" AND $searchdate") : ("")));
        while ($row $db->fetch_array($result)) $savepostids .= ','.$row['postid'];
        
        if (!$savepostidsredirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" $SID_ARG_1ST);
        
        if (isset($_POST['onlystarter']) && $_POST['onlystarter'] == 1$_POST['showposts'] = 0;
        
        $result $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids$_POST['showposts'], $_POST['sortby'], $_POST['sortorder'], $wbbuserdata['userid'], $REMOTE_ADDR)."'");
        if ($result['searchid']) {
            header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);    
            exit();
        }
        
        $db->query("INSERT INTO bb".$n."_searchs (searchhash,searchstring,searchuserid,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
        VALUES ('".getQueryHash($savepostids$_POST['showposts'], $_POST['sortby'], $_POST['sortorder'], $wbbuserdata['userid'], $REMOTE_ADDR)."','".addslashes($tempsearchstring)."','".((!strstr($userids',')) ? (intval($userids)) : (0))."','$savepostids','".intval($_POST['showposts'])."','".addslashes($_POST['sortby'])."','".addslashes($_POST['sortorder'])."','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
        $searchid $db->insert_id();
        
        header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
        exit(); 
    }
    else {
        $prefixBoardCache = array();
        $result $db->unbuffered_query("SELECT boardid, parentid, boardorder, title, invisible, prefixuse, prefix FROM bb".$n."_boards WHERE externalurl = '' ORDER by parentid ASC, boardorder ASC");
        while ($row $db->fetch_array($result)) {
            if ($row['prefixuse'] > && $row['prefix'] != '') {
                $prefixBoardCache[] = $row; 
            }
            
            $boardcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row;
        }
        
        $permissioncache getPermissions();
        $board_options makeboardselect(0);
        
        $prefixTotal $default_prefix;
        $prefixBoardCacheCount count($prefixBoardCache);
        for ($i 0$i $prefixBoardCacheCount$i++) {
            if (!isset($permissioncache[$prefixBoardCache[$i]['boardid']]['can_view_board']) || $permissioncache[$prefixBoardCache[$i]['boardid']]['can_view_board'] == -1$permissioncache[$prefixBoardCache[$i]['boardid']]['can_view_board'] = $wbbuserdata['can_view_board'];
            
            if ($prefixBoardCache[$i]['invisible'] != && $permissioncache[$prefixBoardCache[$i]['boardid']]['can_view_board']) {
                $prefixTotal .= "\n" $prefixBoardCache[$i]['prefix']; 
            }
        }
                
        $prefixOptions '';
        if ($prefixTotal != '') {
            $prefixTotal preg_replace("/\s*\n\s*/""\n"wbb_trim($prefixTotal));
            $prefixArray explode("\n"$prefixTotal);    
            $prefixArray array_unique($prefixArray);
            sort($prefixArray);
            
            $prefixArrayCount count($prefixArray);
            for ($i 0$i $prefixArrayCount$i++) {
                $prefixArray[$i] = htmlconverter($prefixArray[$i]);
                $prefixOptions .= makeoption($prefixArray[$i], $prefixArray[$i], ''0);    
            }
        }
        
        
        eval("\$tpl->output(\"".$tpl->get("search")."\");");
    }
}
?>


Gruß Tizian
10.04.07 23:12 HTML_Meister ist offline Finden Als Freund hinzufügen
Mondstaub Mondstaub ist männlich
Mitglied


images/avatars/avatar-4990.jpg

Dabei seit: 25.01.04
Beiträge: 369
Herkunft: Sachsen
Forenversion: 2.3

Antworten Zitieren Editieren Melden       UP

Die search.php hat mit der Boardansicht nichts zu tun. Ja du solltest das 5x dort einfügen aber nicht ersetzen Augenzwinkern

__________________
**Was guckst du...?**

10.04.07 23:14 Mondstaub ist offline WWW Finden Als Freund hinzufügen
lenamaus lenamaus ist weiblich
Vollblutmama ;)


images/avatars/avatar-5598.jpg

Dabei seit: 02.01.07
Beiträge: 43
Fähigkeiten: WBB2 Anfänger
Herkunft: Wien
Forenversion: 2.3

Antworten Zitieren Editieren Melden       UP

also hab den hack eingebaut ist auch super klasse nur sind meine tabellen verschoebn also eine wie kann ich dass wieder richten und wo?

Dateianhang:
gif forum.gif (17,27 KB, 805 mal heruntergeladen)
26.06.07 02:53 lenamaus ist offline E-Mail WWW Finden Als Freund hinzufügen
Mondstaub Mondstaub ist männlich
Mitglied


images/avatars/avatar-4990.jpg

Dabei seit: 25.01.04
Beiträge: 369
Herkunft: Sachsen
Forenversion: 2.3

Antworten Zitieren Editieren Melden       UP

Die geänderten:

code:
1:
<if($hide_modcell==0)><then>7</then><else>6


mal mit den Zahlen spielen z.Bsp. mal mit 8 / 7 probieren so lange bis es passt
26.06.07 15:59 Mondstaub ist offline WWW Finden Als Freund hinzufügen
Krabbel
Mitglied


Dabei seit: 19.02.07
Beiträge: 4

Antworten Zitieren Editieren Melden       UP

Hallöle smile

der Hack ist echt super, ich hab allerdings mit der Suche irgendwie ein Problem(chen).

Und zwar, wird man direkt auf "Die Suche ergab keine Übereinstimmungen" weitergeleitet....*kopfkratz*

Im Anhang ist mal die search.php, ich hoffe ihr könnt mir da weiterhelfen.

In der index_boardbit.tpl ist's zumindest laut Anleitung drin und ich bilde mir eigentlich ein in der search.php auch....

Greetz
Antje

Dateianhang:
unknown search.php (34 KB, 0 mal heruntergeladen)
19.03.08 21:52 Krabbel ist offline E-Mail Finden Als Freund hinzufügen
Lerena Lerena ist weiblich
Mitglied


images/avatars/avatar-5295.jpg

Dabei seit: 09.06.07
Beiträge: 21
Forenversion: 2.3

Antworten Zitieren Editieren Melden       UP

Funzt perfekt. danke. hab den code mal etwas erweitert, so dass die user beim zeigen aufs bild auch die erklärung sieht und nicht nur, wenn das bild nicht angezeigt wird.

wenn jemand intressiert pn an mich.

@Krabbel

es werden nur nach neuen beiträgen in dem forum gesucht. das ist keine generelle suchfunktion.

__________________
zunn.de - Berliner die was machen wollen
bayandbuy.de - Lose4Posting Community

Dieser Beitrag wurde 2 mal editiert, zum letzten Mal von Lerena: 30.03.08 23:12.

26.03.08 01:20 Lerena ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Lerena in deine Kontaktliste ein
*Zauberfee* *Zauberfee* ist weiblich
Mitglied


Dabei seit: 01.05.06
Beiträge: 31
Fähigkeiten: WBB2 Profi
Forenversion: 3.1

Antworten Zitieren Editieren Melden       UP

Zitat:
Original von Lerena
Funzt perfekt. danke. hab den code mal etwas erweitert, so dass die user beim zeigen aufs bild auch die erklärung sieht und nicht nur, wenn das bild nicht angezeigt wird.

wenn jemand intressiert pn an mich.

@Krabbel

es werden nur nach neuen beiträgen in dem forum gesucht. das ist keine generelle suchfunktion.


Also, weiß nicht, was du da zusätzlich gemacht hast. Bei mir wird das auch so angezeigt.

Zur Suchfunktion: Bei mir wird auf die ganz normale Suchfunktion verwiesen, wenn ich das Symbol für die neuen Beiträge in dem Forum anklicke. D.h. habe eben nochmal geschaut: Erst kommt da auch der Spruch "Die Suche ergab keine Übereinstimmungen" (was nicht sein kann, da in dem Forum definitiv von mir ungelesene Beiträge sind), dann leitet es automatisch auf die SuFu weiter.

ausserdem lahmt seit dem Einbau mein Forum gewaltig.


edit: Problem mit der SuFu hab ich wohl gefunden. Und zwar habe ich da, wo es nicht korrekt funktioniert, also nicht auf die neuen Beiträge im Forum, sondern auf die allgemeine SuFu verweist, noch Unterforen eingebaut. Dann geht das nicht.

Nach mehrfach Neuladen der Seite etc. ging es dann doch- zumindest meistens. *gg*

Dieser Beitrag wurde 2 mal editiert, zum letzten Mal von *Zauberfee*: 03.04.08 13:25.

03.04.08 11:22 *Zauberfee* ist offline E-Mail WWW Finden Als Freund hinzufügen
Lerena Lerena ist weiblich
Mitglied


images/avatars/avatar-5295.jpg

Dabei seit: 09.06.07
Beiträge: 21
Forenversion: 2.3

Antworten Zitieren Editieren Melden       UP

ja es gibt probleme mit der anzeige, aber die lösung wurde hier im thread beschrieben. und die suchfunktion ist definitiv nur für das eine forum, wo du auch auf suchen klickst. probiers noch mal aus Augenzwinkern mein forum erleidet keine performence probleme. muss also an was anderem liegen.

__________________
zunn.de - Berliner die was machen wollen
bayandbuy.de - Lose4Posting Community
03.04.08 14:32 Lerena ist offline E-Mail WWW Finden Als Freund hinzufügen Füge Lerena in deine Kontaktliste ein
Seiten (2): [1] 2 nächste » Baumstruktur | Brettstruktur
Gehe zu:

Neues Thema erstellen Antwort erstellen

yourWBB » WoltLab Burning Board Generation 2 * » Alles von und für das WBB 2.3.x » [WBB 2.3.x] Hacks und Addons » 4 Button Startseiten Optionen Hack