Ja, in die lexique.php. Bei mir heißt die aber lexikon.php, muss das halt anpassen, die Tabelle heißt bei mir auch phpbb_lexikon also auch anpassen.
Hier mal meine Lexikon.php
Code: Alles auswählen
<?php
/***************************************************************************
* debut : jeudi 22 juillet 2004
* copyright : http://www.experienz.net
* Auteur : eXperienZ.NET
* version : 1.0
* email : nellsy@experienz.net
* module : lexikon
****************************************************************************
* description :
*
* Ajoute un lexikon en MOD sur un forum de type PhpBB.
* La configuration du mod, ainsi que la modification de mot
* se fais via le panneau d'administration.
****************************************************************************
* MOD crée par l'équipe d'eXperienZ.NET
****************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './'; // <--
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// Connection au fichier de la base de données
include("config.php");
// connection a la base de donnees
$connect = mysql_connect($dbhost,$dbuser,$dbpasswd);
// selection de la base
mysql_select_db($dbname, $connect);
// Définition des tables utilisés pour le lexikon
$table = "phpbb_lexikon_config"; // Par défaut phpbb_lexikon_config
$table2 = "phpbb_lexikon"; // Par défaut phpbb_lexikon
$table_session = "phpbb_session"; // Par défaut phpbb_session
//Requête de selection des entrées
$affiche="SELECT * FROM $table ";
$result = mysql_query($affiche);
$val = mysql_fetch_array($result);
//Récupération des variables avant de les afficher
$nom_page=$val['nom_page'];
$explication_page=$val['explication_page'];
if ( isset($HTTP_GET_VARS['lettre']) || isset($HTTP_POST_VARS['lettre']) )
{
$lettre = ( isset($HTTP_POST_VARS['lettre']) ) ? htmlspecialchars($HTTP_POST_VARS['lettre']) : htmlspecialchars($HTTP_GET_VARS['lettre']);
}
else
{
$lettre = '';
}
// erst mal die Variablen "sichern"
if ( isset($HTTP_GET_VARS['suchen']) || isset($HTTP_POST_VARS['suchen']) )
{
$suchwort = ( isset($HTTP_POST_VARS['suchwort']) ) ? htmlspecialchars($HTTP_POST_VARS['suchwort']) : htmlspecialchars($HTTP_GET_VARS['suchwort']);
}
else
{
$suchwort = '';
}
//highlight
/**
* Perform a simple text replace
* This should be used when the string does not contain HTML
* (off by default)
*/
define('STR_HIGHLIGHT_SIMPLE', 1);
/**
* Only match whole words in the string
* (off by default)
*/
define('STR_HIGHLIGHT_WHOLEWD', 2);
/**
* Case sensitive matching
* (off by default)
*/
define('STR_HIGHLIGHT_CASESENS', 4);
/**
* Overwrite links if matched
* This should be used when the replacement string is a link
* (off by default)
*/
define('STR_HIGHLIGHT_STRIPLINKS', 8);
/**
* Highlight a string in text without corrupting HTML tags
*
* @author Aidan Lister <aidan@php.net>
* @version 3.1.0
* @param string $text Haystack - The text to search
* @param array|string $needle Needle - The string to highlight
* @param bool $options Bitwise set of options
* @param array $highlight Replacement string
* @return Text with needle highlighted
*/
function str_highlight($text, $needle, $options = null, $highlight = null)
{
// Default highlighting
if ($highlight === null) {
$highlight = '<strong>\1</strong>';
}
// Select pattern to use
if ($options & STR_HIGHLIGHT_SIMPLE) {
$pattern = '#(%s)#';
} else {
$pattern = '#(?!<.*?)(%s)(?![^<>]*?>)#';
$sl_pattern = '#<a\s(?:.*?)>(%s)</a>#';
}
// Case sensitivity
if ($options ^ STR_HIGHLIGHT_CASESENS) {
$pattern .= 'i';
$sl_pattern .= 'i';
}
$needle = (array) $needle;
foreach ($needle as $needle_s) {
$needle_s = preg_quote($needle_s);
// Escape needle with optional whole word check
if ($options & STR_HIGHLIGHT_WHOLEWD) {
$needle_s = '\b' . $needle_s . '\b';
}
// Strip links
if ($options & STR_HIGHLIGHT_STRIPLINKS) {
$sl_regex = sprintf($sl_pattern, $needle_s);
$text = preg_replace($sl_regex, '\1', $text);
}
$regex = sprintf($pattern, $needle_s);
$text = preg_replace($regex, $highlight, $text);
}
return $text;
}
//ENDE highlight
?>
<style type="text/css">
<!--
body, td, { font:normal 10pt Verdana; color:#000000 }
.lettre { font:bold 10pt Verdana; text-decoration:none }
.lettre:hover { text-decoration:underline }
.lettre2 { font:normal 14pt Verdana; color:#5F6765 }
.lettre3 { font:bold 10pt Verdana; color:#C0C0C0 }
--></STYLE>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left"><span class="nav"><a class="nav" href="index.php">Foren-Übersicht</a>
<a name="Übersicht"></a></span></td>
</tr>
</table>
<table class="forumline" width="100%" cellspacing="0" cellpadding="3" border="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<th class="thHead" height="25" valign="middle"><span class="tableTitle"><!- ***Hier könnt ihr eure Überschrift einfügen, Leute die in html sicher sind können auch Eigenschaften der Überschrfit verändern. Nach diesem Kommentar einfach die Überschrift reinschreiben.***->
Lexikon</span></th>
</tr>
<tr>
<td width="100%" align=left style="font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif">
<table cellspacing=10 cellpadding="12" >
<tr><td align=left>
<b><span class="siteTitle"><? echo $nom_page; ?></span></b><br />
<span class="mainmenu"><? echo $explication_page; ?></span>
</td>
<td>
</td>
<td>
</td>
<td align=left>
<form action="lexikon.php" method="post">
<input type="text" name="suchwort"></input>
<input type="submit" name="suchen" value="suchen"></input>
</form>
</td>
</tr>
</table>
<table cellpadding="12" >
<tr><td style="font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif">
<table cellspacing=10>
<tr><td align=left>
<?
// Recherche les lettres présentes dans le lexique
$res = mysql_query("SELECT DISTINCT ord(titre) FROM $table2");
$temp = " ";
while($val=mysql_fetch_array($res)) $temp.=strtoupper(chr($val[0]));
// Affichage de l'alphabet
for($i=49;$i<50;$i++) {
if($lettre==chr($i))
// Lettre sélectionnée
echo "<font class=lettre2> ".chr($i)." </font>";
elseif(!strpos($temp,chr($i)))
// Lettre sans définition
echo "<font class=lettre3> ".chr($i)." </font>";
else
// Lien
echo "<A class=lettre href='lexikon.php?lettre=".chr($i)."'> ".chr($i)." </A>";
}
// Affichage de l'alphabet
for($i=64;$i<91;$i++) {
if($lettre==chr($i))
// Lettre sélectionnée
echo "<font class=lettre2> ".chr($i)." </font>";
elseif(!strpos($temp,chr($i)))
// Lettre sans définition
echo "<font class=lettre3> ".chr($i)." </font>";
else
// Lien
echo "<A class=lettre href='lexikon.php?lettre=".chr($i)."'> ".chr($i)." </A>";
}
if ( isset($HTTP_GET_VARS['alle']) || isset($HTTP_POST_VARS['alle']))
{
echo"<b>- <font class=lettre2>Alle</a></b>";
}
else
{
echo"<b>- <a class='lettre' href='lexikon.php?alle=1'>Alle</a></b>";
} ?>
<br /><br />
</td></tr>
<?
if($lettre)
// Sélectionne les définitions correspondant à la lettre
$SQL = "SELECT * FROM $table2 WHERE titre LIKE '".$lettre."%' ORDER BY titre";
else
// ou fait un tirage aléatoire sur la page d'accueil
$SQL = "SELECT * FROM $table2 ORDER BY titre";
// jetzt die Tabelle nach dem Suchwort durchsuchen
if(isset($suchwort))
{
$SQL = "SELECT * FROM phpbb_lexikon WHERE titre LIKE '%".$suchwort."%' OR explication LIKE '%".$suchwort."%' ORDER BY titre";
}
// Affiche les définitions entrées dans la table
$res = mysql_query($SQL);
if(!mysql_num_rows($res))
{
echo "<tr><td class=postbody>";
echo "Der Begriff \"<b>".$suchwort."</b>\" konnte in der Datenbank nicht gefunden werden.<br>"
. "</td></tr>";
}
else
while($val=mysql_fetch_array($res)) {
if($suchwort)
{
// wenn das Wort anders als fett hervorgehoben werden soll muß das hier in die variable highlight geschrieben werden, die 1 wird in den Kommentaren zur Funktion erklärt
$highlight = '<span style="color:#FF0000; font-weight:bold;">\1</span>';
$val = str_highlight($val, $suchwort, STR_HIGHLIGHT_SIMPLE, $highlight);
}
echo "<tr><td class=postbody>";
echo "<b>".$val["titre"]."</b><br>"
. "<div align=justify>".$val["explication"]."<br></div>"
. "</td></tr>";
}
?>
</td>
</tr>
</td></tr>
</table>
</table>
</td></tr>
</table>
<!- ***Hier endet der html Teil.*** ->
<?
// Déconnection de la base de données
mysql_close();
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>