Aehnliche Themen [mod by Flavius]

mrbasket
edit: problem gelöst!

MEIN TIPP: Mischt die beiden Hacks! Der hier basiert eh auf Relleks und Relleks hat nochmal ne Beta zu ner Erweiterung rausgebracht!

So läuft der hack bei mir!

Also nehmt die templates aus diesem hack und bearbeitet auch das thead.tpl wie in der anleitung! Allerdings die thread.php bearbeitet ihr so:

Zitat:
Original von rellek
Wer am Beta-Test der neuen Version teilnehmen möchte, der ersetzt bitte den längeren Abschnitt zwischen den beiden
code:
1:
/* Ähnliche Themen */

und
code:
1:
/* Ähnliche Themen Ende */


mit:
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:
/* Ähnlich Themen */
function GetAccessableForums() {
	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_view_board']) || $boardpermissions[$row['boardid']]['can_view_board'] != 0) && (!isset($boardpermissions[$row['boardid']]['can_enter_board']) || $boardpermissions[$row['boardid']]['can_enter_board'] != 0) && (!isset($boardpermissions[$row['boardid']]['can_read_thread']) || $boardpermissions[$row['boardid']]['can_read_thread'] != 0)) $boardids .= ",".$row['boardid'];
		}	
	}
	return $boardids;
}

/* Unset Used Vars To Avoid Hacking Attempts */
unset($similar_thread_bit);
unset($like_string);

$ttopic = str_replace("."," ",$threadtopic);
$ttopic = str_replace("!"," ",$ttopic);
$ttopic = str_replace("?"," ",$ttopic);
$ttopic = str_replace("/"," ",$ttopic);
$ttopic = str_replace("§"," ",$ttopic);
$ttopic = str_replace("$"," ",$ttopic);
$ttopic = str_replace("%"," ",$ttopic);
$ttopic = str_replace("&"," ",$ttopic);
$ttopic = str_replace("("," ",$ttopic);
$ttopic = str_replace(")"," ",$ttopic);
$ttopic = str_replace("="," ",$ttopic);
$ttopic = str_replace("\\"," ",$ttopic);
$ttopic = str_replace("?"," ",$ttopic);
$ttopic = str_replace("-"," ",$ttopic);
$ttopic = str_replace("*"," ",$ttopic);
$ttopic = str_replace("+"," ",$ttopic);
$ttopic = str_replace("#"," ",$ttopic);
$ttopic = str_replace("_"," ",$ttopic);
$ttopic = str_replace(","," ",$ttopic);
$ttopic = str_replace(":"," ",$ttopic);
$ttopic = str_replace(";"," ",$ttopic);
$ttopic = str_replace("<"," ",$ttopic);
$ttopic = str_replace(">"," ",$ttopic);
$ttopic = str_replace("|"," ",$ttopic);
$ttopic = str_replace("~"," ",$ttopic);
$ttopic = str_replace("'"," ",$ttopic);
$ttopic = str_replace('"',' ',$ttopic);
$ttopic = explode(" ",$ttopic);
$badwordlist = explode("\n",$badsearchwords);
$y = count($ttopic);
if($y>1) {
  foreach($ttopic as $tt) {
  	if(!in_array($tt, $badwordlist)) {
  		if(strlen($tt)>=$minwordlength && strlen($tt)<=$maxwordlength) $x++;
  		if($x>1 && (strlen($tt)>=$minwordlength && strlen($tt)<=$maxwordlength)) $like_string .= " OR t.topic LIKE ";
  		if(strlen($tt)>=$minwordlength && strlen($tt)<=$maxwordlength) $like_string .= "'%".$tt."%'";
  }
}
} else $like_string = "'%$threadtopic%'";
if($like_string) {
	$similar = $db->query("SELECT
                      t.threadid, t.boardid, x.title, x.boardid, t.prefix, t.topic, t.starttime, t.starterid, t.starter, t.lastposttime, t.lastposterid, t.lastposter, t.replycount, t.views, t.attachments, t.closed, t.important, t.pollid
                      FROM bb".$n."_threads t, bb".$n."_boards x
                      LEFT JOIN bb".$n."_boards b ON (t.boardid=b.boardid)
                      WHERE t.visible='1'
                      AND t.closed <> 3
                      AND t.threadid <> $threadid
                      AND b.password=''
                      AND t.boardid=x.boardid
                      AND t.boardid IN (0".GetAccessableForums().")
                      AND (t.topic LIKE ".$like_string.")
                      ORDER BY t.lastposttime DESC
                      LIMIT 0, 5;");
	}
if($like_string && $db->num_rows($similar)) {
	$i = "0";
	while ($row = $db->fetch_array($similar)) {
		$i++;
		$tdclass = getone($i, "tablea", "tableb");
		$started = formatdate($wbbuserdata['dateformat'], $row['starttime'],1);
		$started .= " <span class=\"time\">".formatdate($wbbuserdata['timeformat'], $row['starttime'])."</span>";
		$lastreply = formatdate($wbbuserdata['dateformat'], $row['lastposttime'],1);
		$lastreply .= " <span class=\"time\">".formatdate($wbbuserdata['timeformat'], $row['lastposttime'])."</span>";
		if ($row['replycount'] >= 1000) $row['replycount'] = number_format($row['replycount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
		if ($row['views'] >= 1000) $row['views'] = number_format($row['views'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
		if (strlen($row['topic']) > 60) $row['topic'] = substr($row['topic'], 0, 54).' [...]';
		$row['topic'] = htmlconverter($row['topic']);
		eval("\$similar_thread_bit .= \"".$tpl->get("thread_similarthread_bit")."\";");
	}
	eval("\$similar_thread = \"".$tpl->get("thread_similarthread")."\";");
}
/* Ähnliche Themen Ende */


Auftretende Bugs bitte melden !
Wasserlasser
Danke, durch den Mix funktioniert das nun wunderbar.

gruss
rolf.s
Hallo - habe auch alles zum Laufen gebracht: RELLEK und ACP. (Auf SQL 5)

Leider verzerrt es mir mein Forum - keine Ahnung wie ich das lösen kann.

Wäre schön wenn mir jemand helfen könnte - ist sicher nur ne Kleinigkeit:-)


Merci... ROLF
FT-Team
Leider werden bei uns die ähnlichen Themen nicht angezeigt.

Den Fehler dafür können wir einfach nicht finden.
Auch haben wir alle verschiedenen Variationen durchgetestet und die Intallation mit der Anleitung verglichen. Ohne Erfolg.

Die Einstellungsmöglichkeit im ACP ist korrekt vorhanden.

Wir schicken mal die geänderten Dateien als txt mit. Vielleicht findet jemand den Fehler, den wir übersehen haben.

MfG
FT-Team
hat niemand eine Idee?
Oder gibt es noch irgendwo einen ähnlichen Hack?

MfG
scaey
Zitat:
Original von Snoopy25
Ich habe es alles eingebaut und dann wenn ich thread öffne kommt das hier:

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
SQL-DATABASE ERROR

Database error in WoltLab Burning Board (2.3.6): Invalid SQLSELECT t.threadidt.boardidx.titlex.boardidt.prefixt.topict.starttimet.starteridt.startert.lastposttimet.lastposteridt.lastpostert.replycountt.viewst.attachmentst.closedt.importantt.pollid FROM bb1_threads tbb1_boards x LEFT JOIN bb1_boards b ON (t.boardid=b.boardidWHERE t.visible='1' AND t.closed <> AND t.threadid <> AND b.password='' AND t.boardid=x.boardid AND t.boardid IN (0,4,1,17,9,10,11,8,2,12,13,15,14,16,42,32,3,33,5,37,26,31,29,30,34,35,36,38,39,40,27,41,18,19,20,21,22,24,25) AND t.topic LIKE '%Wie habt ihr uns gefunden?%' ORDER BY t.lastposttime DESC LIMIT 0, ;
mysql errorYou have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql error number1064
mysql version4.1.13
php version4.4.0
Date17.11.2006 06:19
Script: /thread.php?postid=6
Refererhttp://extreme-gfx.ath.cx/index.php


Na toll und was nu!

Edit: habe mir das Hack raus genommen da es mein ganzes Forum zerstört hatte Versagt



hab den selben fehler, wie bekomm ich den hack aus der db kann ihn dort net finden!

bitte um hilfe.
dringend


huch, hab nun was gefunden, so funz der hack mit mysql5 und dem wbb 2.3.6 pl2

http://board.rellek.org/hnliche-themen-t5106p5.html
Gangbang
Funzt perfekt, Danke für den Hack.
pegelzwo
Hi!

*EDIT*
Für alle, die auch das Addon "FAQ-Manager" von Ghostmaster installiert haben, können die ähnlichen Themen nun auch mit den FAQ's verknüpfen.

Hätte da jemand Interesse dran, dann würde ich ne kurze Anleitung schreiben?!

Es gibt dann (falls gefunden) einen zusätzliche Tabelle unterhalb des Themas, in der dann die gefundenen ähnlichen FAQ_Einträge angezeigt werden...

Demo: Siehe Anhang

LG Martin
Morgy
Zitat:
Original von The-Storm
Bekannte Fehler:
- der Hack ist MySQL 5 INkompatibel


Ich kann den Hack also nicht mit 5.0.45-Dotdeb_0.dotdeb.1-log (Server Version;5.0.45 MySQL-Client-Version) benutzen? verwirrt
Agi
Zitat:
Original von Morgy
Zitat:
Original von The-Storm
Bekannte Fehler:
- der Hack ist MySQL 5 INkompatibel


Ich kann den Hack also nicht mit 5.0.45-Dotdeb_0.dotdeb.1-log (Server Version;5.0.45 MySQL-Client-Version) benutzen? verwirrt


Soweit ich weiß, nein. Aber auf myWBB oder so wurde irgendwann mal eine MySQL5 Lösung gepostet im dortigen Hackthread, bin mir aber nicht sicher ...
Morgy
Zitat:
Original von Agi
Soweit ich weiß, nein. Aber auf myWBB oder so wurde irgendwann mal eine MySQL5 Lösung gepostet im dortigen Hackthread, bin mir aber nicht sicher ...


Die Lösung für rellek's Hack habe ich gefunden: Klick mich!

Aber.. gilt das auch für diesen Hack?! Augen rollen
Agi
Zitat:
Original von Morgy
Zitat:
Original von Agi
Soweit ich weiß, nein. Aber auf myWBB oder so wurde irgendwann mal eine MySQL5 Lösung gepostet im dortigen Hackthread, bin mir aber nicht sicher ...


Die Lösung für rellek's Hack habe ich gefunden: Klick mich!

Aber.. gilt das auch für diesen Hack?! Augen rollen


Eher nicht; sonst nimm einfach relleks Hack, der macht genau das Gleiche und dort gibts ne passende Lösung.