Searchresult Highlighted

MrMind
Titel: Searchresult Highlighted
Version: 1.0
Beschreibung: Autor:
MrMind

Version:
Version 1.0

Copyright:
Copyright liegt bei mir.

Beschreibung:
- Die gesuchten Wörter werden in den Beiträgen rot dargestellt bzw. die Usernamen werden als Rot angezeigt, wenn die suche nach einem User (bzw. mehreren Usern) geht

Getestet mit
wBB-Lite 1.0.2

Demo
www.mindcoder.de/wbblite/

Sonstige Informationen
- Dieser Hack darf nur von mir angeboten werden.
- Ich übernehme keinerlei Haftung, die durch diesen Hack entstehen können.
- Eine Ergänzung für die User mit dem No-Avatar-Hack wurde angehängt

Bekannte Bugs
- Wenn bei der Suche test als Beispiel eingetragen wird, dann werden durch die Suche alle Beiträge gezeigt die auch folgendes haben z. B. : Supertest und Testeintrag. Diese werden doch net gehighlighted. Bei gelegenheit optimiere ich die Suchanalyse dementsprechend noch.

Mfg
MrMind
----
Demo: http://www.mindcoder.de/wbblite/

weiter zum Download
hutzi
hi
ich habe in der Search.php dieses 2 mal vorhanden:

while($row=$db->fetch_array($result)) $savepostids.=','.$row[postid];

3 x mal einfügen den hack da oder nur beim ersten oder beim 2. Vorkommnis ?

Zeilen = 89, 161, 1058
Thorsten_2004
aso ich habe ein andares proplem
Zitat:
Parse error: parse error, unexpected T_ELSEIF in /usr/export/www/vhosts/funnetwork/hosting/thorstensseite/ALLY_X/forum/threa
d.php on line 237


und zwar steht bei dir in der Anleitung
Zitat:
if($posts['avatarid'] && $showavatar==1 && $wbbuserdata['showavatars']==1) {
$avatarname="images/avatars/avatar-$posts[avatarid].$posts[avatarextension]
";
$avatarwidth=$posts['width'];
$avatarheight=$posts['height'];
eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
}


und im meinem /thread.php ist das so
Zitat:
if($posts['avatarid'] && $showavatar==1 && $wbbuserdata['showavatars']==1) {
$avatarname="images/avatars/avatar-$posts[avatarid].$posts[avatarextension]
";
$avatarwidth=$posts['width'];
$avatarheight=$posts['height'];

eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
}


was ist den nun richtig ?



aber sonst guter Hack
MrMind
beim letzten.

Ich werde es im Anhang morgen aktuallisieren

Danke für den Hinweis.

@Thorsten

Das ist doch egal. Es kommt definitiv nur einmal vor und daher ist es egal ob eine Leerzeile dazwischen ist oder net Augenzwinkern

Mfg
MrMind
Thorsten_2004
aber was habe ich den jetz falsch gemacht mit der zeile 237
code:
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:
 <?php
$filename="thread.php";

require("./global.php");
require("./acp/lib/class_parse.php");

if((!isset($postid) && !isset($threadid)) || $thread['closed']==3) eval("error(\"".$tpl->get("error_falselink")."\");");

if($wbbuserdata['canuseacp']==1 || $wbbuserdata['issupermod']==1 || ($wbbuserdata['ismod']==1 && $modpermissions['userid'])) $visible="";
else $visible="AND visible=1";

if($_REQUEST['goto']=="lastpost") {
 $result = $db->query_first("SELECT postid FROM bb".$n."_posts WHERE threadid = '$threadid' $visible ORDER BY posttime DESC LIMIT 1");
 header("Location: thread.php?sid=$session[hash]&postid=$result[postid]#post$result[postid]");
 exit();
}

if(isset($_COOKIE['threadvisit'])) $threadvisit=decode_cookie($_COOKIE['threadvisit']);
else $threadvisit=array();

if(isset($_COOKIE['postvisit'])) $postvisit=decode_cookie($_COOKIE['postvisit']);
else $postvisit=array();


if($_REQUEST['goto']=="firstnew") {
if($threadvisit[$threadid]<$wbbuserdata['lastvisit']) $threadvisit[$threadid]=$wbbuserdata['lastvisit'];
$result = $db->query_first("SELECT postid FROM bb".$n."_posts WHERE threadid='$threadid' AND posttime>'$threadvisit[$threadid]' $visible ORDER BY posttime ASC",1);
if($result['postid']) header("Location: thread.php?sid=$session[hash]&postid=$result[postid]#post$result[postid]");
else header("Location: thread.php?goto=lastpost&threadid=$threadid&sid=$session[hash]");
exit();
}

if($_REQUEST['goto']=="nextnewest") {
 $result = $db->query_first("SELECT threadid FROM bb".$n."_threads WHERE visible = 1 AND lastposttime>'$thread[lastposttime]' AND closed <> 3 AND boardid = '$boardid' ORDER BY lastposttime ASC",1);
 if(!$result['threadid']) eval("error(\"".$tpl->get("error_nonextnewest")."\");");
 $threadid=$result['threadid'];
 $thread = $db->query_first("SELECT * FROM bb".$n."_threads WHERE threadid = '$threadid'");
}

if($_REQUEST['goto']=="nextoldest") {
 $result = $db->query_first("SELECT threadid FROM bb".$n."_threads WHERE visible = 1 AND lastposttime<'$thread[lastposttime]' AND closed <> 3 AND boardid = '$boardid' ORDER BY lastposttime DESC",1);
 if(!$result['threadid']) eval("error(\"".$tpl->get("error_nonextoldest")."\");");
 $threadid=$result['threadid'];
 $thread = $db->query_first("SELECT * FROM bb".$n."_threads WHERE threadid = '$threadid'");
}


if($wbbuserdata['umaxposts']) $postsperpage=$wbbuserdata['umaxposts'];
elseif($board['postsperpage']) $postsperpage=$board['postsperpage'];
else $postsperpage=$default_postsperpage;
$postorder=$board['postorder'];

if(isset($postid)) {
 if($postorder==0) $result = $db->query_first("SELECT COUNT(*) AS posts FROM bb".$n."_posts WHERE threadid='$threadid' AND postid<='$postid' $visible");
 else $result = $db->query_first("SELECT COUNT(*) AS posts FROM bb".$n."_posts WHERE threadid='$threadid' AND postid>='$postid' $visible");
 $_GET['page']=ceil($result['posts']/$postsperpage);
}

$db->unbuffered_query("UPDATE bb".$n."_threads SET views=views+1 WHERE threadid='$threadid'",1);

$boardnavcache=array();
if($showboardjump==1) $boardjump=makeboardjump($boardid);
$navbar=getNavbar($board['parentlist']);
eval ("\$navbar .= \"".$tpl->get("navbar_board")."\";");

/* flat view */
if($threadview==0) {
 $result = $db->query_first("SELECT COUNT(*) FROM bb".$n."_posts WHERE threadid = '$threadid' $visible");
 $postcount = $result[0];

 if(isset($_GET['page'])) {
  $page=intval($_GET['page']);
  if($page==0) $page=1;
 }
 else $page=1;
 $pages = ceil($postcount/$postsperpage);
 if($pages>1) $pagelink=makepagelink("thread.php?threadid=$threadid&sid=$session[hash]",$page,$pages,$showpagelinks-1);

 $postids="";
 $result = $db->query("SELECT postid FROM bb".$n."_posts WHERE threadid = '$threadid' $visible ORDER BY posttime ".ifelse($postorder,"DESC","ASC")." LIMIT ".($postsperpage*($page-1)).",".$postsperpage);
 while($row=$db->fetch_array($result)) $postids .= ",".$row['postid'];
}

$parse = new parse($docensor,75,$board['allowsmilies'],$board['allowbbcode'],$wbbuserdata['showimages'],$usecode);

$userfields="";
$userfieldsjoin="";

if($showavatar==1) {
 $avatar=", av.avatarid, av.avatarextension, av.width, av.height";
 $avatarjoin="LEFT JOIN bb".$n."_avatars av ON (u.avatarid=av.avatarid)";
}
else {
 $avatar="";
 $avatarjoin="";
}

if($board['allowicons']==1) {
 $icon=", i.iconpath, i.icontitle";
 $iconjoin="LEFT JOIN bb".$n."_icons i ON (p.iconid=i.iconid)";
}
else {
 $icon="";
 $iconjoin="";
}
$result = $db->query("SELECT
p.*,
u.userposts,
u.regdate,
u.signature,
u.email,
u.homepage,
u.icq,
u.aim,
u.yim,
u.msn,
u.showemail,
u.receivepm,
u.usercanemail,
u.gender,
u.invisible,
u.title,
u.lastactivity,
r.ranktitle, r.rankimages
$userfields
$icon
$avatar
FROM bb".$n."_posts p
LEFT JOIN bb".$n."_users u USING (userid)
LEFT JOIN bb".$n."_ranks r USING (rankid)
$userfieldsjoin
$iconjoin
$avatarjoin
WHERE p.postid IN (0$postids)
ORDER BY p.posttime ".ifelse($postorder,"DESC","ASC"));

$count=0;
while($posts=$db->fetch_array($result)) {
 if($userfieldcache) reset($userfieldcache);
 $signature="";
 $threadstarter="";
 $lastedit="";
 $search="";
 $homie="";
 $email="";
 $homepage="";
 $icq="";
 $aim="";
 $yim="";
 $user_online="";
 $userfields="";
 $gender="";
 $useravatar="";
 $rankimages="";
 $setvisible="";
 $pm="";
 $invisible="";
 $userlevel="";

 /** mod/admin option -> set visible post **/
 if($posts['visible']==0 && $posts['posttime']!=$thread['starttime']) eval ("\$invisible = \"".$tpl->get("thread_invisible")."\";");

 $tdbgcolor=getone($count,"{tablecolorb}","{tablecolora}");
 $tdid=getone($count,"tableb","tablea");

 $posts['message']=$parse->doparse($posts['message'],$posts['allowsmilies']*$board['allowsmilies'],$board['allowhtml'],$board['allowbbcode'],$board['allowimages']);
 $posts['posttopic']=$parse->textwrap($posts['posttopic'],30);
 if($posts['iconid'] && $board['allowicons']==1) $posticon=makeimgtag($posts['iconpath'],$posts['icontitle']);
 else $posticon="";
 if($wbbuserdata['lastvisit']<=$posts['posttime'] && $postvisit[$posts['postid']]!=1) eval ("\$postsign = \"".$tpl->get("thread_newpost")."\";");
 else eval ("\$postsign = \"".$tpl->get("thread_nonewpost")."\";");
 $postdate=formatdate($dateformat,$posts['posttime'],1);
 $posttime=formatdate($timeformat,$posts['posttime']);
 if( !empty($_GET['hilight']) )
 {
    $hilight = htmlspecialchars(urldecode($_GET['hilight']));
    $posts['message'] = $parse->getHilight($hilight,$posts['message']);
    $posts['posttopic'] = $parse->getHilight($hilight,$posts['posttopic']);
 }

 if($posts['editorid']) {
  $editdate=formatdate($dateformat,$posts['edittime']);
  $edittime=formatdate($timeformat,$posts['edittime']);
  eval ("\$lastedit = \"".$tpl->get("thread_lastedit")."\";");
 }
 if($posts['userid']) {
  $rankimages=formatRI($posts['rankimages']);
  if($rankimages) eval ("\$rankimages = \"".$tpl->get("thread_rankimages")."\";");
  if($posts['title']) $posts['ranktitle']=$posts['title'];
  $userlevel=userlevel($posts['userposts'],$posts['regdate']);

  if($showonlineinthread==1) {
   if(($posts['invisible']==0 || $wbbuserdata['canuseacp']==1) && $posts['lastactivity']>=time()-$useronlinetimeout*60) eval ("\$user_online = \"".$tpl->get("thread_user_online")."\";");
   else eval ("\$user_online = \"".$tpl->get("thread_user_offline")."\";");
  }

  if($showregdateinthread==1) {
   $posts['regdate']=formatdate($dateformat,$posts['regdate']);
   eval ("\$posts['regdate'] = \"".$tpl->get("thread_regdate")."\";");
  }
  else $posts['regdate']="";

  if($showuserfieldsinthread==1 && is_array($userfieldcache) && count($userfieldcache)) {
   while(list($key,$val)=each($userfieldcache)) {
    $fieldcontent=$parse->textwrap($posts["field".$val['profilefieldid']],20);
    if($fieldcontent) eval ("\$userfields .= \"".$tpl->get("thread_userfields")."\";");
   }
  }

  if($showgenderinthread==1 && $posts['gender']>0) {
   if($posts['gender']==1) eval ("\$gender = \"".$tpl->get("thread_gender_male")."\";");
   if($posts['gender']==2) eval ("\$gender = \"".$tpl->get("thread_gender_female")."\";");
  }

  if($showuserpostsinthread==1) eval ("\$posts['userposts'] = \"".$tpl->get("thread_userposts")."\";");
  else $posts['userposts']="";

  eval ("\$search = \"".$tpl->get("thread_search")."\";");
  eval ("\$homie = \"".$tpl->get("thread_homie")."\";");
  if($posts['showemail']==1) eval ("\$email = \"".$tpl->get("thread_email")."\";");
  elseif($posts['usercanemail']==1) eval ("\$email = \"".$tpl->get("thread_formmail")."\";");
  if($posts['homepage']) eval ("\$homepage = \"".$tpl->get("thread_homepage")."\";");
  if($posts['receivepm']==1 && $wbbuserdata['canusepms']==1) eval ("\$pm = \"".$tpl->get("thread_pm")."\";");
  if($posts['icq']) eval ("\$icq = \"".$tpl->get("thread_icq")."\";");
  if($posts['aim']) eval ("\$aim = \"".$tpl->get("thread_aim")."\";");
  if($posts['yim']) eval ("\$yim = \"".$tpl->get("thread_yim")."\";");

  if($posts['avatarid'] && $showavatar==1 && $wbbuserdata['showavatars']==1) {
   $avatarname="images/avatars/avatar-$posts[avatarid].$posts[avatarextension]";
   $avatarwidth=$posts['width'];
   $avatarheight=$posts['height'];
   eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
   eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
    }
   $posts['username'] = ( !empty($_GET['hilightuser']) && intval($_GET['hilightuser']) ==                      
   $posts['userid'] ) ? '' . $posts['username'] . '' : $posts['username'];
     elseif($posts['avatarid'] ==0 && $wbbuserdata['showavatars']==1) {
   $avatarname="images/noavatar.gif";
   $avatarwidth=$posts['width'];
   $avatarheight=$posts['height'];

   eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
   eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
  }
  eval ("\$posts['username'] = \"".$tpl->get("thread_username")."\";");

  if($posts['showsignature']==1 && $wbbuserdata['showsignatures']==1 && $posts['signature']) {
   $posts['signature']=$parse->doparse($posts['signature'],$posts['allowsmilies']*$allowsigsmilies,$allowsightml,$allowsigbbcode,$maxsigimage);
   eval ("\$signature = \"".$tpl->get("thread_signature")."\";");
  }
 }
 else {
  eval ("\$posts[ranktitle] = \"".$tpl->get("anonymous")."\";");
 }

   $result2 = $db->query("SELECT ratingcount, ratingpoints FROM bb".$n."_users WHERE userid = '".$posts[userid]."'");
   $row2 = $db->fetch_array($result2);
   $rating = userrating($row2['ratingcount'], $row2['ratingpoints'], $posts[userid]);
 eval ("\$postbit .= \"".$tpl->get("thread_postbit")."\";");
 $count++;
}

if($wbbuserdata['issupermod']==1 || $modpermissions['userid']) eval ("\$modoptions = \"".$tpl->get("thread_modoptions")."\";");
elseif($wbbuserdata['userid'] && $wbbuserdata['userid']==$thread['starterid'] && ($wbbuserdata['cancloseowntopic']==1 || $wbbuserdata['candelowntopic']==1 || $wbbuserdata['caneditowntopic']==1)) eval ("\$modoptions = \"".$tpl->get("thread_useroptions")."\";");

if($thread['pollid']) {
 if($wbbuserdata['issupermod']==1 || $modpermissions['userid']==1) eval ("\$mod_poll_edit = \"".$tpl->get("mod_poll_edit")."\";");

 unset($votecheck);
 $poll=$db->query_first("SELECT * FROM bb".$n."_polls WHERE pollid='$thread[pollid]'");
 if($poll['timeout']==0) $timeout=time()+1;
 else $timeout=$poll['starttime']+$poll['timeout']*86400;
 if($_REQUEST['preresult']!=1 && $wbbuserdata['canvotepoll'] && $timeout>=time()) {
  if($wbbuserdata['userid']) $votecheck=$db->query_first("SELECT id AS pollid FROM bb".$n."_votes WHERE id='$thread[pollid]' AND votemode=1 AND userid='$wbbuserdata[userid]'");
  else $votecheck=$db->query_first("SELECT id AS pollid FROM bb".$n."_votes WHERE id='$thread[pollid]' AND votemode=1 AND ipaddress='$REMOTE_ADDR'");
 }

 if($_REQUEST['preresult']==1 || $votecheck['pollid'] || !$wbbuserdata['canvotepoll'] || $timeout<time()) { // already voted; show result
  $votes=0;
  unset($polloption);
  $totalvotes=0;
  //list($totalvotes)=$db->query_first("SELECT SUM(votes) FROM bb".$n."_polloptions WHERE pollid='$thread[pollid]'");
  $result=$db->query("SELECT * FROM bb".$n."_polloptions WHERE pollid='$thread[pollid]' ORDER BY votes DESC");
  while($row=$db->fetch_array($result)) {
   $totalvotes+=$row['votes'];
   $polloptions[]=$row;
  }

  $i=1;
  while(list($key,$row)=each($polloptions)) {
   $row['polloption']=$parse->doparse($row['polloption'],$board['allowsmilies'],$board['allowhtml'],$board['allowbbcode'],$board['allowimages']);
   if($totalvotes) {
    $percent_float = $row['votes']*100/$totalvotes;
    $percent = number_format($percent_float, 2);
    $percent_int = floor($percent_float)*3;
    $percent_int += 1;
   }
   else $percent = $percent_int = 0;
   eval ("\$thread_poll_resultbit .= \"".$tpl->get("thread_poll_resultbit")."\";");
   if($i==5) $i=0;
   $i++;
  }

  eval ("\$thread_poll = \"".$tpl->get("thread_poll_result")."\";");
 }
 else {
  if($poll['choicecount']>1) $inputtype="checkbox";
  else $inputtype="radio";

  $result=$db->query("SELECT * FROM bb".$n."_polloptions WHERE pollid='$thread[pollid]' ORDER BY showorder ASC");
  while($row=$db->fetch_array($result)) {
   $row['polloption']=$parse->doparse($row['polloption'],$board['allowsmilies'],$board['allowhtml'],$board['allowbbcode'],$board['allowimages']);
   eval ("\$thread_pollbit .= \"".$tpl->get("thread_pollbit")."\";");
  }

  eval ("\$thread_poll = \"".$tpl->get("thread_poll")."\";");
 }
}

if($thread['voted']) {
 $avarage=number_format($thread['votepoints']/$thread['voted'],2);
 $threads['voted']=$thread['voted'];
 eval ("\$threadrating = \"".$tpl->get("board_threadbit_rating")."\";");
 $threadrating=str_repeat($threadrating, round($avarage));
}
else $threadrating="";

$threadvisit[$threadid]=time();
if($wbbuserdata['usecookies']==1) encode_cookie("threadvisit");

$postids = explode(",",$postids);
for($i=0;$i<count($postids);$i++) $postvisit[$postids[$i]]=1;
if($wbbuserdata['usecookies']==1) encode_cookie("postvisit",0,false);

if($board['closed']==0) eval ("\$newthread = \"".$tpl->get("board_newthread")."\";");
$addreply_link="threadid=$threadid";
if($thread['closed']!=0) eval ("\$addreply = \"".$tpl->get("thread_closed")."\";");
elseif($board['closed']==0) eval ("\$addreply = \"".$tpl->get("thread_addreply")."\";");
if( $activ_similar_threads_view )
{
   $bad_words_list = explode("\n",$badsearchwords);
   while(list($key,$val) = @each($bad_words_list) ) $bad_words_array[trim($val)] = true;
   
   $topic_words = explode(" ",$thread['topic']);
   for($i=0; $i < count($topic_words); $i++)
   {
       if($bad_words_array[$topic_words[$i]])
       {
          
          $topic_words[$i] = "";
       }
   }
   $topic_words = implode(" ",$topic_words);
   
   $result = $db->query("SELECT threadid FROM bb".$n."_threads WHERE threadid != " . $thread['threadid'] . " AND MATCH (topic) AGAINST ('". addslashes($topic_words) ."') ORDER BY lastposttime DESC");
   
   while( $row = $db->fetch_array($result) )
   {
        $similar_topic_row[] = $row;
   }

   if( count($similar_topic_row) > 0 )
   {
      $similar_topic_viewbit = "";

      for($i = 0; $i < count($similar_topic_row); $i++)
      {
          $sql = "SELECT t.*, b.boardid, b.title, b.allowicons, b.hotthread_reply, b.hotthread_view, i.iconpath, i.icontitle, p.boardpermission, p.startpermission, p.replypermission
                  FROM bb".$n."_boards b, bb".$n."_permissions p, bb".$n."_threads t
                  LEFT JOIN bb".$n."_icons i USING(iconid)
                  WHERE t.threadid = " . $similar_topic_row[$i]['threadid'] . "
                  AND t.boardid = b.boardid
                  AND t.closed != 3
                  AND b.boardid = p.boardid
                  AND p.groupid = " . $wbbuserdata['groupid'] . "
                  $visible
                  GROUP BY t.threadid";
          $result = $db->query($sql);

          while( $similar_topic = $db->fetch_array($result) )
          {
          
               if( empty($similar_topic['boardpermission']) || empty($similar_topic['startpermission']) || empty($similar_topic['replypermission']) )
               {
                  continue;
               }
               
               $topic_name = $similar_topic['topic'];
               $topic_id = $similar_topic['threadid'];
               $topic_prefix = $similar_topic['prefix'];
               $topic_iconid = $similar_topic['iconid'];
               $topic_starter_id = $similar_topic['starterid'];
               $topic_starter = $similar_topic['starter'];
               $topic_lastposttime = $similar_topic['lastposttime'];
               $topic_lastpost_date = formatdate($dateformat,$similar_topic['lastposttime'],1);

               $topic_lastpost_time = formatdate($timeformat,$similar_topic['lastposttime']);
               $topic_lastposter_id = $similar_topic['lastposterid'];
               $topic_lastposter = $similar_topic['lastposter'];
               $topic_reply_count = $similar_topic['replycount'];
               $topic_closed = $similar_topic['closed'];
               $topic_views = $similar_topic['views'];
               $topic_important = $similar_topic['important'];
               $topic_visible = $similar_topic['visible'];
               $topic_voted = $similar_topic['voted'];
               $topic_vote_points = $similar_topic['votepoints'];
               $topic_poll_id = $similar_topic['pollid'];
               $topic_board_id = $similar_topic['boardid'];
               $topic_board_name = $similar_topic['title'];
               $topic_board_allow_icon = $similar_topic['allowicons'];
               $topic_board_hotthread_reply = $similar_topic['hotthread_reply'];
               $topic_board_hotthread_view = $similar_topic['hotthread_view'];
               $topic_icon_path = $similar_topic['iconpath'];
               $topic_icon_title = $similar_topic['icontitle'];

               $topic_icon = ($topic_iconid && $topic_board_allow_icon) ? makeimgtag($topic_icon_path,$topic_icon_title) : '';
                  
               if( $topic_voted )
              {

                   $topic_avarage=number_format($topic_vote_points/$topic_voted,2);

                   eval ("\$topic_threadrating = \"" . $tpl->get("similar_topic_threadbit_rating") . "\";");

                   $topic_threadrating=str_repeat($topic_threadrating, round($topic_avarage));

              } 

              else $topic_threadrating="&nbsp;";
                 
              $topic_board_hotthread_reply = ( $topic_board_hotthread_reply == 0 ) ? $default_hotthread_reply : $topic_board_hotthread_reply;
              $topic_board_hotthread_view = ( $topic_board_hotthread_view == 0 ) ? $default_hotthread_view : $topic_board_hotthread_view;
                  
              if( $topic_important == 2 ) $topic_folder_icon="announce";

              else $topic_folder_icon=ifelse($wbbuserdata['lastvisit']<$topic_lastposttime && $threadvisit[$topic_id]<$topic_lastposttime,"new").ifelse($topic_reply_count >= $topic_board_hotthread_reply || $topic_views >= $topic_board_hotthread_view,"hot").ifelse($topic_closed!=0,"lock")."folder";
                  
              if( $topic_important == 2 ) eval("\$topic_prefix = \"" . $tpl->get("similar_topic_announce") . "\";");
              else if( $topic_important == 1 ) eval("\$topic_prefix = \"" . $tpl->get("similar_topic_important") . "\";");
              else if( $topic_poll_id != 0 ) eval("\$topic_prefix = \"" . $tpl->get("similar_topic_poll") . "\";");
                  
              eval("\$topic_starter = \"" . $tpl->get("similar_topic_starter") . "\";");
                  
              if( $topic_reply_count + 1 > $postsperpage && $showmultipages != 0 )
              {
                  $topic_multipage = "";
                  $topic_multipages = "";
                  $similar_multipages_lastpage = "";
                  $topic_xpages=ceil(($topic_reply_count + 1) / $postsperpage);

                  if( $topic_xpages > $showmultipages )
                  {

                     eval ("\$similar_topic_multipages_lastpage = \"" . $tpl->get("similar_topic_multipages_lastpage") . "\";");

                     $topic_xpages=$showmultipages;

                  }
                     

                  for($i = 1; $i <= $topic_xpages; $i++)
                  {

                      $topic_multipage .= " ".makehreftag("thread.php?threadid=$topic_id&page=$i&sid=$session[hash]",$i);

                  }
                     

                  eval ("\$topic_multipages = \"" . $tpl->get("similar_topic_multipages") . "\";");

               }
                   
               eval("\$similar_topic_viewbit .= \"" . $tpl->get("similar_topic_threadbit") . "\";");
          }
      }
      
      if( !empty($similar_topic_viewbit) )
      {
         eval("\$similar_topic = \"" . $tpl->get("similar_topic") . "\";");
      }
   }
}

if(strlen($thread['topic'])>60) $thread['topic']=parse::textwrap($thread['topic'],60);
eval("\$tpl->output(\"".$tpl->get("thread")."\");");
?>
 
MrMind
das hier:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
  if($posts['avatarid'] && $showavatar==1 && $wbbuserdata['showavatars']==1) {
   $avatarname="images/avatars/avatar-$posts[avatarid].$posts[avatarextension]";
   $avatarwidth=$posts['width'];
   $avatarheight=$posts['height'];
   eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
   eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
    }
   $posts['username'] = ( !empty($_GET['hilightuser']) && intval($_GET['hilightuser']) ==                      
   $posts['userid'] ) ? '' . $posts['username'] . '' : $posts['username'];
     elseif($posts['avatarid'] ==0 && $wbbuserdata['showavatars']==1) {
   $avatarname="images/noavatar.gif";
   $avatarwidth=$posts['width'];
   $avatarheight=$posts['height'];

   eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
   eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
  }


sollte so aussehen:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
  if($posts['avatarid'] && $showavatar==1 && $wbbuserdata['showavatars']==1) {
   $avatarname="images/avatars/avatar-$posts[avatarid].$posts[avatarextension]";
   $avatarwidth=$posts['width'];
   $avatarheight=$posts['height'];
   eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
   eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
    }elseif($posts['avatarid'] ==0 && $wbbuserdata['showavatars']==1) {
   $avatarname="images/noavatar.gif";
   $avatarwidth=$posts['width'];
   $avatarheight=$posts['height'];

   eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
   eval ("\$useravatar = \"".$tpl->get("thread_useravatar")."\";");
  }
$posts['username'] = ( !empty($_GET['hilightuser']) && intval($_GET['hilightuser']) ==                    $posts['userid'] ) ? '' . $posts['username'] . '' : $posts['username'];



Das ist weil du den No-Avatar-Hack drin hast Augenzwinkern

Mfg
MrMind
hutzi
bei mir ist da nichts "rot" nach der Suche

Doch ne andere Stelle wählen?

code:
1:
2:
while($row=$db->fetch_array($result)) $savepostids.=','.$row[postid];
  $search_where = ( !empty($searchstring) ) ? " AND searchstring='$searchstring' " : " AND searchuserid=$userids ";
MrMind
Alles richtig eingebaut @hutzi

Was suchst du und was findet er??? und wie sieht deine URL aus???

Mfg
MrMind
hutzi
Zitat:
Original von MrMind
Alles richtig eingebaut @hutzi

Was suchst du und was findet er??? und wie sieht deine URL aus???

Mfg
MrMind


meine URL = einfach auf meine Sig klicken großes Grinsen

Was ich such(t)e ?
z.B. das Wort "Movie" - er fand auch Themen und in denen finde ich auch das Wort "Movie", nur eben nicht in Rot.
MrMind
Ok das scheint wohl jetzt überall das Problem zu sein, wo einen anderen Style drin haben *gg*

Hast du eine .style Datei auf deinem Server im acp-Ordner???

Mfg
MrMind
hutzi
ich nutze seit je her den Standard Style - nur andere Farben angepasst großes Grinsen

sowas ? = bb1.style
MrMind
Da müsste eigentlich folgendes drinnen sein:

code:
1:
~~~<hilight>~~~<font color="red"><b>~~~</hilight>~~~


Oder so ähnlich guck mal (in der zweiten Zeile).

Mfg
MrMind
hutzi
Zitat:
Original von MrMind
Da müsste eigentlich folgendes drinnen sein:

code:
1:
~~~<hilight>~~~<font color="red"><b>~~~</hilight>~~~


Oder so ähnlich guck mal (in der zweiten Zeile).

Mfg
MrMind


ja, wäre da so drinnen.
Da fällt mir aber ein, das mir mein Kumpel, damals als ich nochn voller Noob war, in den CSS Feld unten in den Designpacks nen Menge Code reingeschrieben hat. Da könnte natürlich widerrum etwas anderes vermerkt sein
Soll ich mal posten? - komm ich dann ins Fernsehn ? großes Grinsen
MrMind
Zitat:
Original von hutzi
Soll ich mal posten?


Ja

Zitat:
Original von hutzi
komm ich dann ins Fernsehn ? großes Grinsen


Nein


Augenzwinkern

Mfg
MrMind
hutzi
code:
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:
BODY { SCROLLBAR-BASE-COLOR: #0B6295; SCROLLBAR-ARROW-COLOR: #FFFFFF; }
SELECT {
 FONT-SIZE: 12px;
 FONT-FAMILY: Tahoma,Helvetica;
 COLOR: #000000;
 BACKGROUND-COLOR: #CFCFCF;
}

TEXTAREA {
 FONT-SIZE: 12px;
 FONT-FAMILY: Tahoma,Helvetica;
 COLOR: #000000;
 BACKGROUND-COLOR: #CFCFCF;
}

.input {
 FONT-SIZE: 12px;
 FONT-FAMILY: Tahoma,Helvetica;
 COLOR: #000000;
 BACKGROUND-COLOR: #CFCFCF;
 
 border-top-width : 3px;
 border-right-width : 3px;
 border-bottom-width : 3px;
 border-left-width : 3px;
 text-indent : 2px;
}
.topnavi {
	padding-right: 5px;
	padding-bottom: 18px;
	padding-left: 5px;
}

#bg A:link, #bg A:visited, #bg A:active { COLOR: darkorange; TEXT-DECORATION: underline; }
#bg A:hover { COLOR: #FFFFFF; TEXT-DECORATION: none; }

#tablea A:link, #tablea A:visited, #tablea A:active { COLOR: #000000; TEXT-DECORATION: underline; }
#tablea A:hover { COLOR: #000000; TEXT-DECORATION: none; }

#tableb A:link, #tableb A:visited, #tableb A:active { COLOR: #000000; TEXT-DECORATION: underline; }
#tableb A:hover { COLOR: #000000; TEXT-DECORATION: none; }

#tablecat A:link, #tablecat A:visited, #tablecat A:active { COLOR: #ffffff; TEXT-DECORATION: underline; }
#tablecat A:hover { COLOR: #ffffff; TEXT-DECORATION: none; }

#tabletitle A:link, #tabletitle A:visited, #tabletitle A:active { COLOR: darkorange; TEXT-DECORATION: none; }
#tabletitle A:hover { COLOR: #FFFFFF; TEXT-DECORATION: underline; }

#tabletitle { background-image: url(style_blue/cellpic.gif); }
.clsCursor {  cursor: hand}

#tablecat { background-image: url(style_blue/catpic.gif); }
.clsCursor {  cursor: hand}

#box {
border-left: 1px #FFFFFF solid; 
border-top: 1px #FFFFFF solid; 
border-right: 2px #FFFFFF solid; 
border-bottom: 2px #FFFFFF solid;
 }

.highlight {
 color: #B90000;
 font-weight: bold;
}

.option {
font-family: Tahoma;
font-size: 10px;
color: #000000;
background-color: #FFFFFF;
border: 1px #000000 solid;
}
A:hover {POSITION: relative; TOP: 1px; LEFT: 1px; text-decoration: none; color: ffffff; font-style: normal;}


das
code:
1:
2:
3:
4:
5:
.highlight {
 color: #B90000;
 font-weight: bold;
}

habe ich vorhin erst zusätzlich reingeschrieben, brachte aber auch nyx
MrMind
Dann such mal in der class_parse.php nach <hilight> und ersetze es durch: <span class="highlight"> und das </hilight> ersetzt du durch </span>.

Dann sollte es auch gehen (diese beiden Tags sollten in der getHilight() stecken.

Mfg
MrMind
hutzi
dann kommt:

code:
1:
2:
3:
Parse error: parse error, unexpected T_STRING in /home/www/web8/html/forum/acp/lib/class_parse.php on line 131

Fatal error: Cannot instantiate non-existent class: parse in /home/www/web8/html/forum/portal_config.php on line 4


Ursprungscodeschnipsel aus der class_parse:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function getHilight($hilightstring,$post)
 {
    $search_word = explode(' ',$hilightstring);
    while( list(,$val) = @each($search_word) )
    {
       if( strtoupper($val) == 'AND' || strtoupper($val) ==  'OR' || strtoupper($val) == 'NOT' ) continue;
       
       $word = addcslashes($val, '.|$=<>^');

       $word = str_replace("*","[0-9a-z]*",$word);
       $word = str_replace("_","[0-9a-z]{1}",$word);

       $search = "/(^|\s|\]|>|\")($word)(([,\.]{1}[\s[\"<$]+)|\s|\[|\"|<|$)/i";
       $replace = "\\1<hilight>\\2</hilight>\\3";

       $post = preg_replace($search,$replace,$post);  
    }

    return $post;
 }
MrMind
Ersetz das mal mit dem hier:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function getHilight($hilightstring,$post)
 {
    $search_word = explode(' ',$hilightstring);
    while( list(,$val) = @each($search_word) )
    {
       if( strtoupper($val) == 'AND' || strtoupper($val) ==  'OR' || strtoupper($val) == 'NOT' ) continue;
       
       $word = addcslashes($val, '.|$=<>^');

       $word = str_replace("*","[0-9a-z]*",$word);
       $word = str_replace("_","[0-9a-z]{1}",$word);

       $search = "/(^|\s|\]|>|\")($word)(([,\.]{1}[\s[\"<$]+)|\s|\[|\"|<|$)/i";
       $replace = "\\1<span class=\"highlight\">\\2</span>\\3";

       $post = preg_replace($search,$replace,$post);  
    }

    return $post;
 }


Mfg
MrMind
hutzi
1) Mann, bist Du schnell zum helfen. Was fürn Support = 1A

2) Geht großes Grinsen großes Grinsen großes Grinsen

3) gesuchte Wörter sind nun rot + fett

4) Danke, Danke, Danke

5) Wie lautet deine Kontonummer *g*
Thorsten_2004
also irgentwie habe ich beide cods nich im class_parse
keine arnug wieso nicht