Hallo
ich suche solch ein FAQ Modul wie es auf dieser Seite vorhanden ist. Oder alternativ ein Wiki Modul.
Thx
verwendete ilchClan Version: 1.1
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
<?php defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); include( "include/includes/configs/faqsys.php"); $design = new design ( 'Admins Area', 'Admins Area', 2); $design->header(); if ($menu->get(1) == 'editcats'){ $sql = "select * from $faqcats order by id"; $result = db_query($sql); $numrows = db_num_rows($result); echo "<title>Hinzufügen/Beabreite kategorien</title>"; for($x=0;$x<$numrows;$x++){ $resrow = db_fetch_row($result); $catid = $resrow[0]; $cattext = $resrow[1]; $cattext = stripslashes($cattext); $cattext = htmlspecialchars($cattext); echo "<form name='form1' method='post' action='$adminfile'>$catid: <input type='text' name='cattext' value=\"$cattext\" maxlength='255' size='40'><input type='hidden' name='catid' value='$catid'><input type='submit' value='speichern'> [<a href='".$adminfile."-D$catid'>löschen</a>]</form>"; } echo "<form name='form1' method='post' action='$adminfile'>Neue Kategorie: <input type='text' name='newcat' maxlength='255' size='40'><input type='submit' value='hinzufügen'></form>"; }elseif ((isset($_POST['catid']) AND !empty($_POST['catid'])) && (isset($_POST['cattext']) AND !empty($_POST['cattext']))){ $cattext = $_POST['cattext']; $catid = $_POST['catid']; $cattext = addslashes($cattext); $sql = "update $faqcats set cat='$cattext' where id='$catid'"; $result = db_query($sql) ; wd ($adminfile, 'Erfolgreich geändert' , 3); }elseif(isset($_POST['newcat']) AND !empty($_POST['newcat'])){ $newcat = $_POST['newcat']; $newcat = addslashes($newcat); $sql = "insert into $faqcats (`cat`) values ('$newcat')"; $result = db_query($sql) or die(mysql_error()); wd ($adminfile, 'Erfolgreich eingefügt' , 3); }elseif($menu->getA(1) === 'D'){ $deletecat = $menu->getE(1); $sql = "delete from $faqcats where id='$deletecat'"; $result = db_query($sql); $sql = "delete from $table where catid='$deletecat'"; $result = db_query($sql); wd ($adminfile, 'Erfolgreich gelöscht' , 3); }elseif($menu->getA(1) === 'n'){ $newentry = $menu->getE(1); echo "<title>Füge neuen FAQ Eintrag hinzu</title>"; echo "<form name='form1' method='post' action='$adminfile'> Frage:<br> <input type='text' name='question' maxlength='255' size='40'> <br> Antwort:<br> <textarea name='answer' cols='100' rows='50' wrap='VIRTUAL'></textarea> <br> <input type='hidden' name='catid' value='$newentry'> <input type='hidden' name='addentry' value='1'> <input type='submit' value='Neuer Eintrag'> </form>"; }elseif(isset($_POST['addentry']) && isset($_POST['question']) && isset($_POST['answer'])&& isset($_POST['catid'])){ $addentry = $_POST['addentry']; $question = $_POST['question']; $answer = $_POST['answer']; $catid = $_POST['catid']; $question = addslashes($question); $answer = addslashes ($answer); $sql = "insert into $table values('', '$catid', '$question', '$answer', now())"; $result = db_query($sql); wd ($adminfile, 'Erfolgreich eingefügt' , 3); }elseif($menu->getA(1) === 'd'){ $deleteentry = $menu->getE(1); $sql = "delete from $table where id='$deleteentry'"; $result = db_query($sql); wd ($adminfile, 'Erfolgreich gelöscht' , 3); }elseif($menu->getA(1) === 'e'){ $editentry = $menu->getE(1); $sql = "select question,answer from $table where id='$editentry'"; $result = db_query($sql); $resrow = db_fetch_row($result); $question = htmlspecialchars($resrow[0]); $answer = htmlspecialchars ($resrow[1]); echo "<title>Bearbeite FAQ Eintrag</title>"; echo "<form name='form1' method='post' action='$adminfile'> Frage:<br> <input type='text' name='question' maxlength='255' size='40' value=\"$question\"> <br> Antwort:<br> <textarea name='answer' cols='100' rows='50' wrap='VIRTUAL'>".stripslashes($answer)."</textarea> <br> <input type='hidden' name='faqid' value='$editentry'> <input type='hidden' name='saveentry' value='1'> <input type='submit' value='Speichere änderung'> </form>"; }elseif(isset($_POST['saveentry']) && isset($_POST['question']) && isset($_POST['answer']) && isset($_POST['faqid'])){ $saveentry = $_POST['saveentry']; $question = $_POST['question']; $answer = $_POST['answer']; $faqid = $_POST['faqid']; $question = addslashes($question); $answer = bbcode($answer); $answer = addslashes($answer); $sql = "update $table set question='$question', answer='$answer' where id='$faqid'"; $result = db_query($sql) ; wd ($adminfile, 'Erfolgreich geändert' , 3); }else{ $erg = db_query("select * from $faqcats order by id"); $cats = ''; while($row = db_fetch_assoc($erg)){$cats .= '<option value="'.$row['id'].'">'.$row['cat'].'</option>';} ?> <script type="text/javascript"> <!-- function chooseCat(){ var cat_value = document.getElementById('takeCat').value; if (cat_value > 0){ document.location.href='admin.php?faqsys-n' + cat_value; return true } alert('Bitte eine Kategorie auswählen'); } //--> </script><noscript>Ihr Browser unterstützt kein JavaScript!</noscript> <table cellpadding="0" cellspacing="0" border="0"> <tr><td><img src="include/images/icons/admin/news.png" /> </td><td width="30"></td><td valign="bottom"><h1>FAQ</h1> </td></tr><tr><td colspan="3"><hr></td></tr> <tr class="Chead"><td> <a href="admin.php?faqsys-editcats">Kategorie anlegen</a> </td><td></td><td><select name="cat" id="takeCat"><option value="0">Bitte wählen</option><?php echo $cats; ?></select> <a href="javascript: chooseCat()">Neuer Eintrag</a> </td></tr> </table> <?php } $design->footer(); ?>
Geschlossen | ||
Zurück zu Module und Modifikationen |