![]() |
| |||||||
| Registrieren | Galerie | Hilfe | Kalender | Spielhalle | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
| hacks von rellek Alles zum wBB von rellek. |
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| ||||
Ähnliche Themen von rellek (01.01.2005, 17:42) Name: Ähnliche Themen Version: 1.0 Für wBB-Version: 2.3 Getestet mit: 2.3 Beta 3 Beschreibung: Mit diesem Hack werden zu jedem Thema 5 ähnliche Themen gesucht. Dazu wird die MySQL-Bedingung LIKE verwendet, d.h. wenn die Anzeige "komisch" oder unsauber funktioniert, dann ist MySQL schuld. Dieser Hack ist im Gegensatz zu den meisten anderen Hacks, die ähnliches leisten, sehr sparsam gecodet. Es für die Abfrage nur ein zusätzlicher SQL- Query nötig, ein weiterer kommt hinzu, wenn der Permission-Cache nicht gesetzt ist, um die Foren ausfindig zu machen, in denen gesucht wird. Foren, zu denen man keine Berechtigung hat, werden, genauso wie passwortgeschützte Foren, von der Suche nach ähnlichen Themen ausgeschlossen, sodass niemand etwas sieht, was er nicht sehen darf. MySQL5-Probleme? Hier klicken: Ähnliche Themen Ähnliche Themen = Top 5 letzte aktivie Themen? Hier: http://board.rellek.org/325960-post121.html Demo: Im Anhang Copyright: (c) 2005 by rellek Disclaimer: Keine Haftung für irgendwelche Schäden am Board. Fehler sind natürlich nicht ausgeschlossen --- Bekannte Fehler: - Updates und Bugfixes: -
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! Geändert von rellek (28.03.2009 um 21:17 Uhr) |
| |||
AW: Ähnliche Themen von David (03.01.2005, 14:48)
Hallo, ich habe soeben den Hack "Ähnliche Themen" gemäß Anleitung ( ) installiert, also 1) Sprachdatei importiert 2) Thread.php geändert und wieder auf den Server geladen 3) thread.tpl geändert 4) Templates importiert und gecached Obwohl die Installation recht simpel ist, hab ich dennoch folgendes Problem: Bei der Anzeige der Threads erfolgt keine Ausgabe von "ähnlichen Themen". Ich habe einmal bewußt Threads mit den Namen Test A, Test B und Test C angelegt. Somit müßten mir ja (eigentlich) diese Themen angezeigt werden. Warum die Tabelle gar nicht angezeigt wird, ist mir ein Rätsel... es sei denn, die Ergebnisse lt. MYSQL wären 0 und es würde dann bewusst auf eine Anzeige verzichtet ? Wo könnte hier der Fehler liegen.. ?! Gruß David P.S. die Thread-Bewertung hab ich generell deaktiert.. Es funktioniert aber auch nicht nach dem Einschalten.... |
| ||||
AW: Ähnliche Themen von rellek (03.01.2005, 15:00)
Wenn keine ähnlichen Themen gefunden wurden, wird die ähnliche Themen-Tabelle nicht angezeigt. Um zu testen, ob das soweit funktioniert, solltest du 2 Threads, am besten mit dem gleichen Topic, erstellen...
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von David (03.01.2005, 15:07)
Hallo, das hatte ich schon getan... 3 Threads erstellt mit den Topics Test A, Test B und Test C Ich hatte den Hack so verstanden, das er mir die jeweils anderen dann anzeigt, wenn es eine "ähnliche Beschreibung" im Topic gibt... .. und das wäre ja bei den 3 genannten Thread jeweils der Begriff TEST, oder müßen die IMMER 100% identisch sein.. ? (wobei das in der realität kaum vorkommen dürfte? ! ) ...aber ich probiere weiter |
| ||||
AW: Ähnliche Themen von rellek (03.01.2005, 15:18)
...naja, was eben ähnlich ist - was mysql als ähnlich ansieht... ich hats bei yourwbb schon angesprochen, vielleicht werd ich für ne spätere version jedes wort auswerten, wenn es im suchwortindex steht.
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von David (03.01.2005, 15:29)
ich habe gerade mal versucht, 2 Threads mit identischem Topic anzulegen... Das funktioniert gar nicht ![]() Hab es in einem 2.3er und in einem 2.2.1er (ohne den Hack) getestet. Beim Anlegen des 2.Threads wird nach dem Button -Neues Thema- der bereits angelegte Thread angezeigt. Dies ist an und für sich löblich , ist mir aber bisher noch nie so aufgefallen ?! ![]() Es gibt hier leider keinen Testthread, um es auch hier mal zu testen... Sind ggfs. noch ACP-Funktionen zu aktivieren ? Gruß David |
| ||||
AW: Ähnliche Themen von rellek (03.01.2005, 15:31)
im ACP ist nichts zu aktivieren, höchstens das flood-control ist zu deaktivieren... wegen forum zum mal testen... moment, bin in 5 min wieder da ![]() Edit: http://board.rellek.org/board.php?boardid=172
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von David (03.01.2005, 15:39)
ich habs.... ![]() es funktioniert nur dann, wenn man Threads mit identischen Topics in unterschiedlichen Foren anlegt...dann wird einem auch die Tabelle angezeigt... ![]() So, jetzt noch aus einem "identischen Topic" ein "ähnliches Topic" ... dann wärs perfekt ![]() Gruß David |
| ||||
AW: Ähnliche Themen von rellek (03.01.2005, 15:42)
nene, das klappt auch in gleichen foren - kuck z.b. mal unter dem thread - die threads sind alle im gleichen forum.
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von David (03.01.2005, 15:52)
jepp, hab es hier auch gerade getestet... Dann hängt es wohl mit einem anderen Hack zusammen... Seltsam ist nur, das es auf 2 unterschiedlichen Boards mit unterschiedlichen Versionen so ist... Gemeinsamer Nenner wäre u.a. "wer hat den Thread gelesen" ? ![]() aber ich kämpf mich mal durch ![]() Gruß David P.S. : die beiden Testthreads kann man wieder löschen ![]() P.S.2 : Vielen Dank für die prompten Antworten |
| ||||
AW: Ähnliche Themen von rellek (03.01.2005, 15:55)
@ PS1: die können auch bleiben, wenn jemand zu blöd zum einbauen ist, dann kann ich wenigstens sagen, kuck mal da *g* @ PS2: Is doch kein Thema.
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von David (03.01.2005, 16:16)naja, zu blöd für diesen Hack war ich ja nicht Er funktioniert ja ... Da Woltlab soeben die Final 2.3er freigegeben hat, werde ich es nochmal mit einer jungfräuchlichen newthread.php versuchen ![]() Gruß David |
| ||||
AW: Ähnliche Themen von rellek (04.01.2005, 16:11)
Ich hab noch keinen Weg gefunden, den man ohne Weiteres verantworten kann, um die Foren ausfindig zu machen, zu denen man Zutritt hat.
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von David (04.01.2005, 23:20)Nachdem ich die aktuelle 2.3 Forensoftware installiert hatte, konnte ich anschließend trotzdem NICHT mehrfach einen Beitrag mit identischem Topic in einem Thread erfassen. Ab dem 2.Versuch erfolgte automatisch die Anzeige des bereits erfassten Beitrages... Erst nachdem ich in der newthread.php den nachfolgenden Programmcode ausdokumentiert hatte, funktionierte es. Code:
/* thread already exists? */
// $result = $db->query_first("SELECT threadid FROM bb".$n."_threads WHERE boardid = '".$boardid."' AND starterid='$wbbuserdata[userid]' AND starter='".addslashes($wbbuserdata['username'])."' AND topic='".addslashes($topic)."' AND starttime>='".(time() - $dpvtime)."'", 1);
// if ($result['threadid']) {
// header("Location: thread.php?threadid=".$result['threadid'].$SID_ARG_2ND_UN);
// exit();
// }
![]() Gruß David |
| ||||
AW: Ähnliche Themen von rellek (05.01.2005, 06:46)
das kannste auch ausstellen ohne auskommentieren ... acp -> flood control glaube
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| ||||
AW: Ähnliche Themen von rellek (06.01.2005, 16:17)
Wer am Beta-Test der neuen Version teilnehmen möchte, der ersetzt bitte den längeren Abschnitt zwischen den beiden Code: /* Ähnliche Themen */ Code: /* Ähnliche Themen Ende */ Code: /* Ä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;
}
$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 = explode(" ",$ttopic);
$badwordlist = explode("\n",$badsearchwords);
$y = count($ttopic);
if($y>1) {
foreach($ttopic as $tt) {
$x++;
if(!in_array($tt, $badwordlist)) {
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).' [...]';
eval("\$similar_thread_bit .= \"".$tpl->get("thread_similarthread_bit")."\";");
}
eval("\$similar_thread = \"".$tpl->get("thread_similarthread")."\";");
}
/* Ähnliche Themen Ende */
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von Gucky (07.01.2005, 13:50)
Hi, also wenn ich das austausche bekomm ich nur folgenden Fehler: Liegts an mir??? EDIT: Nööö, nicht an mir sondern an Sonderzeichen im Topic ![]() Bei "normalen" Themen hab ich keinen Fehler |
| ||||
AW: Ähnliche Themen von rellek (07.01.2005, 15:18)
Wie heißt der Topic? Fix dazu kommt gleich.
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| ||||
AW: Ähnliche Themen von rellek (07.01.2005, 15:24)
Ersetzt den langen Abschnitt bitte nochmal mit: Code: /* Ä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;
}
$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 = 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).' [...]';
eval("\$similar_thread_bit .= \"".$tpl->get("thread_similarthread_bit")."\";");
}
eval("\$similar_thread = \"".$tpl->get("thread_similarthread")."\";");
}
/* Ähnliche Themen Ende */
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von Gucky (08.01.2005, 19:37) $wbbuserdata['username'] - funzt bei mir nich *g* Eigentlich wollte ich wissen ob ich den jeweiligen Benutzernamen so in nem Topic ausgeben kann *g* |
| ||||
AW: Ähnliche Themen von rellek (09.01.2005, 07:21)
behebt gleich noch nen paar mehr bugs. Code: /* Ä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 */
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| |||
AW: Ähnliche Themen von poweruser_85 (31.03.2005, 23:27)
Ich habe den Ähnliche Themen hack schonmal in meine Forum installiert gehabt. Jetzt hab ich jedoch auf 2.3.1 upgedated und das jgs-xa Portal installiert. Ich habe den Hack schon mehrmals zu installieren versucht, aber mir wird einfach die Tabelle mit den letzten Themen nich angezeigt. Was kann ich nur falsch gemacht haben? Könnte mir jemand bitte helfen? Thomas PS: Ich häng mal eine Kopie meiner thread.tpl und meiner thread.php an. Vielleicht kann jemand damit was anfangen. |
| ||||
AW: Ähnliche Themen von rellek (01.04.2005, 08:09)
Ich schätze mal, das liegt daran, dass du die Ur-Version installiert hattest. Die fand eh nicht so viel *g* Hab dir mal die aktuelle Beta eingebaut - das Template muss nicht geändert werden.
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
| ||||
AW: Ähnliche Themen von rellek (16.02.2006, 15:36)
Und jetzt darf ich riechen, was in Zeile 1013 (und Umgebung) steht?
__________________ ...gehen Sie bitte weiter, hier gibt es nichts zu sehen | Diskussion über soziale Software? | Pieps, pieps | Horst | Murat | Achmed | Knut II. Code: spartakus:~# init 0 init: Ach leck mich am Netzteil! |
![]() |
| Lesezeichen |
| Stichworte |
| addon, burning board, themen, wbb, wbb 2.3, ähnlich, ähnliche themen |
| Themen-Optionen | |
| Ansicht | |
| |
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [2.1] Ähnliche Themen | rellek | hacks von rellek | 13 | 26.10.2007 10:23 |
| [2.2] Ähnliche Themen | rellek | hacks von rellek | 24 | 11.04.2006 09:48 |
| Themen Ähnliche hmm? | CSchulle | Test- und Spam-Forum | 1 | 06.01.2005 16:09 |