include/admin/faqsys.php
Hier ein Screenshot wo was geändert werden muss
Hier meine faqsys.php
<?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='40' rows='5' 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='40' rows='5' 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 = 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();
?>
include/admin/tickets.php
Hier ein Screenshot wo was geändert werden muss
Hier meine tickets.php
<?php
#########################################
# Support Ticket System by legalsauger #
# Version 1.3 #
# © by Bitworld-Gaming.de #
#########################################
defined('main') or die('no direct access');
defined('admin') or die('only admin access');
require_once('include/includes/func/ticketfunc.php');
$limit = $allgAr['siteticketsa'];
$page = ($menu->getA(2) == 'p' ? $menu->getE(2) : 1);
$anfang = ($page - 1) * $limit;
switch($menu->get(1)) {
default:
$design = new design('Admins Area','Admins Area',2);
$design->header();
$tickets = '';
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tickets WHERE status = 0 ORDER BY time DESC");
if (db_num_rows($abf) != 0) {
while ($row = db_fetch_assoc($abf)) {
$tickets .= '<tr class="'.$class.'">
<td>'.$row['id'].'</td>
<td><a href="admin.php?tickets-reply-'.$row['id'].'">'.$row['name'].'</a></td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center"><a href="javascript:delone('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
}
} else {
$tickets = '<tr class="Cmite"><td colspan="5">Aktuell gibt es keine unbearbeiteten Tickets!</td></tr>';
}
$mytickets = '';
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tickets WHERE status = 1 AND aid = ".$_SESSION['authid']." ORDER BY time DESC");
if (db_num_rows($abf) != 0) {
while ($row = db_fetch_assoc($abf)) {
$mytickets .= '<tr class="'.$class.'">
<td>'.$row['id'].'</td>
<td><a href="admin.php?tickets-reply-'.$row['id'].'">'.$row['name'].'</a></td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center"><a href="javascript:delone('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
}
} else {
$mytickets = '<tr class="Cmite"><td colspan="5">Aktuell hast du keine Tickets in Bearbeitung!</td></tr>';
}
$row = array();
$row['tickets'] = $tickets;
$row['mytickets'] = $mytickets;
$row['ot'] = db_count_query("SELECT COUNT(*) FROM prefix_tickets WHERE aid = ".$_SESSION['authid']);
$row['nt'] = db_count_query("SELECT COUNT(*) FROM prefix_tickets WHERE status = 0");
$row['bt'] = db_count_query("SELECT COUNT(*) FROM prefix_tickets WHERE status = 1");
$row['gt'] = db_count_query("SELECT COUNT(*) FROM prefix_tickets WHERE status = 2");
$row['ti'] = db_count_query("SELECT COUNT(*) FROM prefix_tickets");
$row['pi'] = db_count_query("SELECT COUNT(*) FROM prefix_tposts");
$tpl = new tpl('tickets/tickets',1);
$tpl->set_ar_out($row,0);
$design->footer();
break;
case 'reply':
$design = new design('Admins Area','Admins Area',2);
$design->header();
$id = $menu->get(2);
$limit = $allgAr['replyticket'];
$page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1);
$mpl = db_make_sites($page,'WHERE tid = '.$id,$limit,'?tickets-reply-'.$id,'tposts');
$anfang = ($page - 1) * $limit;
$rep = '';
$count = 1;
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tposts WHERE tid = ".$id." ORDER BY time ASC LIMIT ".$anfang.",".$limit);
while ($row = db_fetch_assoc($abf)) {
if ($row['file'] != '') {
$text = bbcode($row['text']).'<br><br>Dateianhang: <a href="include/downs/files/'.$row['file'].'"><i>'.$row['file'].'</i></a> <a href="javascript:delfile('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></a>';
} else {
$text = bbcode($row['text']);
}
$rep .= '<tr class="'.$class.'" valign="top">
<td>'.$count.'.</td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td>'.$text.'</td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center"><a href="admin.php?tickets-reply-'.$id.'-edit-'.$row['id'].'"><img src="include/images/icons/edit.gif" alt="edit" title="edit"></td>
<td align="center"><a href="javascript:delrep('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></a></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
$count++;
}
$abf = db_query("SELECT aid,status FROM prefix_tickets WHERE id = ".$id);
$row = db_fetch_assoc($abf);
$name = $row['name'];
$abs = true;
$form = '';
if ($row['status'] == 0) {
$options = '<option value="1">Bearbeitung übernehmen</option>
<option value="2">Bearbeitung abschließen</option>';
} elseif ($row['status'] == 2) {
$options = '<option value="1">Bearbeitung wieder aufnehmen</option>';
} elseif ($row['status'] == 1 AND $row['aid'] == $_SESSION['authid']) {
$options = '<option value="0">Bearbeitung abgeben</option>
<option value="2">Bearbeitung abschließen</option>';
} else {
$abs = false;
}
if ($abs == true) {
$form = '<form action="admin.php?tickets-status" method="post">
<select name="status">'.$options.'</select>
<input type="hidden" name="id" value="'.$id.'">
<input type="submit" value="Absenden">
</form>
<br><br>';
}
if ($menu->get(3) == 'edit') {
$tid = $menu->get(4);
$abf = db_query("SELECT text FROM prefix_tposts WHERE id = ".$tid);
$row = db_fetch_assoc($abf);
$edit = '<body onload="document.edit.text.focus()"><b>Ändern:</b><br><br>
<form action="admin.php?tickets-sendreply-edit" method="post" name="edit" enctype="multipart/form-data">
<textarea cols="50" rows="10" name="text">'.htmlspecialchars($row['text']).'</textarea><br><br>
<b>Anhang:</b> <input name="file" type="file" size="25"><br><small> Erlaubte Dateitypen: jpg,png,zip,rar</small><br><br>
<input type="hidden" name="id" value="'.$id.'">
<input type="hidden" name="tid" value="'.$tid.'">
<input type="submit" value="Absenden">
</form>';
} else {
$edit = '<b>Antwort:</b><br><br>
<form action="admin.php?tickets-sendreply" method="post" enctype="multipart/form-data">
<textarea cols="50" rows="10" name="text"></textarea><br><br>
<b>Anhang:</b> <input name="file" type="file" size="25"><br><small> Erlaubte Dateitypen: jpg,png,zip,rar</small><br><br>
<input type="hidden" name="id" value="'.$id.'">
<input type="submit" value="Absenden">
</form>';
}
$tpl = new tpl('tickets/areply_ticket',1);
$tpl->set('status',getstatus($id));
$tpl->set('form',$form);
$tpl->set('name',$name);
$tpl->set('rep',$rep);
$tpl->set('edit',$edit);
$tpl->set('MPL',$mpl);
$tpl->out(0);
$design->footer();
break;
case 'sendreply':
$id = escape($_POST['id'],'integer');
$text = escape($_POST['text'],'textarea');
$file = false;
$fehler = 'Fehler:\n';
if ($text) {
if (!empty($_FILES['file']['tmp_name'])) {
$file = true;
if (is_writeable('include/downs/files')) {
$end = array('jpg','png','zip','rar');
if (in_array(get_file_ext($_FILES['file']['name']),$end)) {
$fname = genkey(5).'_'.$_FILES['file']['name'];
if (move_uploaded_file($_FILES['file']['tmp_name'],'include/downs/files/'.$fname)) {
$fehler = false;
} else {
$fehler = 'Die Datei konnte nicht verschoben werden!';
}
} else {
$fehler = 'Bitte beachte die erlaubten Dateiendungen!';
}
} else {
$fehler = 'Der Zielordner hat nicht die nötigen chmod Rechte!';
}
}
if ($fehler == false OR $file == false) {
if ($menu->get(2) == 'edit') {
$tid = escape($_POST['tid'],'integer');
if ($file) {
db_query("UPDATE prefix_tposts SET text = '".$text."',file = '".$fname."' WHERE id = ".$tid);
} else {
db_query("UPDATE prefix_tposts SET text = '".$text."' WHERE id = ".$tid);
}
echo '<script type="text/javascript">alert("Erfolgreich geändert!");document.location.href="admin.php?tickets-reply-'.$id.'";</script>';
} else {
$abf = db_query("SELECT uid FROM prefix_tickets WHERE id = ".$id);
$row = db_fetch_assoc($abf);
if ($row['uid'] != 0) {
sendpm($_SESSION['authid'],$row['uid'],'Antwort auf ein Support Ticket','Der Admin [b]'.$_SESSION['authname'].'[/b] hat auf [url=http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/index.php?ticket-reply-'.$id.']dieses[/url] Ticket geantwortet.');
}
if ($file) {
db_query("INSERT INTO prefix_tposts (uid,tid,tuid,time,text,file) VALUES (".$_SESSION['authid'].",".$id.",".$_SESSION['authid'].",NOW(),'".$text."','".$fname."')");
} else {
db_query("INSERT INTO prefix_tposts (uid,tid,tuid,time,text) VALUES (".$_SESSION['authid'].",".$id.",".$_SESSION['authid'].",NOW(),'".$text."')");
}
db_query("UPDATE prefix_tickets SET aid = ".$_SESSION['authid'].",status = 1 WHERE id = ".$id);
echo '<script type="text/javascript">alert("Der User wurde über deinen Beitrag benachrichtigt!");document.location.href="admin.php?tickets-reply-'.$id.'";</script>';
}
} else {
echo '<script type="text/javascript">alert("'.$fehler.'");document.location.href="admin.php?tickets-reply-'.$id.'";</script>';
}
} else {
echo '<script type="text/javascript">alert("Du musst einen Text eingeben!");document.location.href="admin.php?tickets-reply-'.$id.'";</script>';
}
break;
case 'delrep':
$id = $menu->get(2);
$abf = db_query("SELECT tid FROM prefix_tposts WHERE id = ".$id);
$row = db_fetch_assoc($abf);
del_file($id,0);
db_query("DELETE FROM prefix_tposts WHERE id = ".$id);
echo '<script type="text/javascript">alert("Beitrag wurde erfolgreich gelöscht!");document.location.href="admin.php?tickets-reply-'.$row['tid'].'";</script>';
break;
case 'delfile':
del_file($menu->get(2),0);
echo '<script type="text/javascript">alert("Datei wurde erfolgreich gelöscht!");document.location.href="admin.php?tickets-reply-'.$menu->get(3).'";</script>';
break;
case 'my':
$design = new design('Admins Area','Admins Area',2);
$design->header();
$mpl = db_make_sites($page,'WHERE aid = '.$_SESSION['authid'],$limit,'?tickets-my','tickets');
$tickets = '';
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tickets WHERE aid = ".$_SESSION['authid']." ORDER BY time DESC LIMIT ".$anfang.",".$limit);
if (db_num_rows($abf) != 0) {
while ($row = db_fetch_assoc($abf)) {
$tposts = db_count_query("SELECT COUNT(*) FROM prefix_tposts WHERE tid = ".$row['id']);
$tickets .= '<tr class="'.$class.'">
<td>'.$row['id'].'</td>
<td><a href="admin.php?tickets-reply-'.$row['id'].'">'.$row['name'].'</a></td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center">'.getstatus($row['id']).'</td>
<td align="center">'.$tposts.'</td>
<td align="center"><a href="javascript:delone('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
}
} else {
$tickets = '<tr class="Cmite"><td colspan="7">Du hast noch keine Tickets bearbeitet!</td></tr>';
}
$tpl = new tpl('tickets/my_tickets',1);
$tpl->set('tickets',$tickets);
$tpl->set('MPL',$mpl);
$tpl->out(0);
$design->footer();
break;
case 'done':
$design = new design('Admins Area','Admins Area',2);
$design->header();
$mpl = db_make_sites($page,'WHERE status = 2',$limit,'?tickets-done','tickets');
$tickets = '';
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tickets WHERE status = 2 ORDER BY time DESC LIMIT ".$anfang.",".$limit);
if (db_num_rows($abf) != 0) {
while ($row = db_fetch_assoc($abf)) {
$tposts = db_count_query("SELECT COUNT(*) FROM prefix_tposts WHERE tid = ".$row['id']);
$tickets .= '<tr class="'.$class.'">
<td>'.$row['id'].'</td>
<td><a href="admin.php?tickets-reply-'.$row['id'].'">'.$row['name'].'</a></td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center">'.getstatus($row['id']).'</td>
<td align="center">'.$tposts.'</td>
<td align="center"><a href="javascript:delone('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
}
} else {
$tickets = '<tr class="Cmite"><td colspan="7">Es gibt keine geschlossenen Tickets!</td></tr>';
}
$tpl = new tpl('tickets/done_tickets',1);
$tpl->set('tickets',$tickets);
$tpl->set('MPL',$mpl);
$tpl->out(0);
$design->footer();
break;
case 'all':
$design = new design('Admins Area','Admins Area',2);
$design->header();
$mpl = db_make_sites($page,'',$limit,'?tickets-all','tickets');
$tickets = '';
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tickets ORDER BY time DESC LIMIT ".$anfang.",".$limit);
if (db_num_rows($abf) != 0) {
while ($row = db_fetch_assoc($abf)) {
$tposts = db_count_query("SELECT COUNT(*) FROM prefix_tposts WHERE tid = ".$row['id']);
$tickets .= '<tr class="'.$class.'">
<td>'.$row['id'].'</td>
<td><a href="admin.php?tickets-reply-'.$row['id'].'">'.$row['name'].'</a></td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center">'.getstatus($row['id']).'</td>
<td align="center">'.$tposts.'</td>
<td align="center"><a href="javascript:delone('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
}
} else {
$tickets = '<tr class="Cmite"><td colspan="7">Aktuell gibt es keine Tickets!</td></tr>';
}
$tpl = new tpl('tickets/all_tickets',1);
$tpl->set('tickets',$tickets);
$tpl->set('MPL',$mpl);
$tpl->out(0);
$design->footer();
break;
case 'delone':
$id = $menu->get(2);
del_file(0,$id);
db_query("DELETE FROM prefix_tickets WHERE id = ".$id);
db_query("DELETE FROM prefix_tposts WHERE tid = ".$id);
echo '<script type="text/javascript">alert("Ticket wurde erfolgreich gelöscht!");document.location.href="admin.php?tickets-'.$menu->get(3).'";</script>';
break;
case 'delallnew':
$abf = db_query("SELECT id FROM prefix_tickets WHERE status = 0");
while ($row = db_fetch_assoc($abf)) {
del_file(0,$row['id']);
db_query("DELETE FROM prefix_tposts WHERE tid = ".$row['id']);
}
db_query("DELETE FROM prefix_tickets WHERE status = 0");
echo '<script type="text/javascript">alert("Alle unbearbeiteten Tickets wurden erfolgreich gelöscht!");document.location.href="admin.php?tickets";</script>';
break;
case 'delallmy':
$abf = db_query("SELECT id FROM prefix_tickets WHERE aid = ".$_SESSION['authid']);
while ($row = db_fetch_assoc($abf)) {
del_file(0,$row['id']);
db_query("DELETE FROM prefix_tposts WHERE tid = ".$row['id']);
}
db_query("DELETE FROM prefix_tickets WHERE aid = ".$_SESSION['authid']);
echo '<script type="text/javascript">alert("Alle von dir bearbeiteten Tickets wurden erfolgreich gelöscht!");document.location.href="admin.php?tickets";</script>';
break;
case 'dellalldone':
$abf = db_query("SELECT id FROM prefix_tickets WHERE status = 2");
while ($row = db_fetch_assoc($abf)) {
del_file(0,$row['id']);
db_query("DELETE FROM prefix_tposts WHERE tid = ".$row['id']);
}
db_query("DELETE FROM prefix_tickets WHERE status = 2");
echo '<script type="text/javascript">alert("Alle geschlossenen Tickets wurden erfolgreich gelöscht!");document.location.href="admin.php?tickets";</script>';
break;
case 'delall':
$abf = db_query("SELECT id FROM prefix_tickets");
while ($row = db_fetch_assoc($abf)) {
del_file(0,$row['id']);
db_query("DELETE FROM prefix_tposts WHERE tid = ".$row['id']);
}
db_query("DELETE FROM prefix_tickets");
echo '<script type="text/javascript">alert("Alle Tickets wurden erfolgreich gelöscht!");document.location.href="admin.php?tickets";</script>';
break;
case 'status':
$status = escape($_POST['status'],'integer');
$id = escape($_POST['id'],'integer');
$abf = db_query("SELECT aid,status,uid FROM prefix_tickets WHERE id = ".$id);
$row = db_fetch_assoc($abf);
if ($status == 1) {
db_query("UPDATE prefix_tickets SET aid = ".$_SESSION['authid'].",status = 1 WHERE id = ".$id);
} elseif ($status == 2) {
db_query("UPDATE prefix_tickets SET aid = ".$_SESSION['authid'].",status = 2,ctime = NOW() WHERE id = ".$id);
} elseif ($status == 0) {
db_query("UPDATE prefix_tickets SET aid = 0,status = 0");
}
if ($row['uid'] != 0) {
sendpm($_SESSION['authid'],$row['uid'],'Statusänderung','Der Admin [b]'.$_SESSION['authname'].'[/b] hat den Status von [url=http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/index.php?ticket-reply-'.$id.']diesem[/url] Ticket geändert.');
}
echo '<script type="text/javascript">alert("Der Status wurde erfolgreich geändert!");document.location.href="admin.php?tickets-reply-'.$id.'";</script>';
break;
case 'search':
$design = new design('Admins Area','Admins Area',2);
$design->header();
$text = escape($_POST['search'],'string');
$type = escape($_POST['type'],'string');
$in = escape($_POST['in'],'string');
if ($in == 'all') {
$and = '';
} elseif($in == 'aid') {
$and = ' AND aid = '.$_SESSION['authid'];
} elseif($in == '0') {
$and = ' AND status = 0';
} elseif($in == '2') {
$and = ' AND status = 2';
}
$tickets = '';
$class = 'Cmite';
$abf = db_query("SELECT * FROM prefix_tickets WHERE ".$type." LIKE '%".$text."%'".$and." ORDER BY time DESC");
if (db_num_rows($abf) != 0) {
while ($row = db_fetch_assoc($abf)) {
$tposts = db_count_query("SELECT COUNT(*) FROM prefix_tposts WHERE tid = ".$row['id']);
$tickets .= '<tr class="'.$class.'">
<td>'.$row['id'].'</td>
<td><a href="admin.php?tickets-reply-'.$row['id'].'">'.$row['name'].'</a></td>
<td><a href="index.php?user-details-'.$row['uid'].'">'.get_n($row['uid']).'</a></td>
<td align="center">'.dateformat($row['time']).'</td>
<td align="center">'.getstatus($row['id']).'</td>
<td align="center">'.$tposts.'</td>
<td align="center"><a href="javascript:delone('.$row['id'].')"><img src="include/images/icons/del.gif" alt="löschen" title="löschen"></td>
</tr>';
if ($class == 'Cmite') {
$class = 'Cnorm';
} else {
$class = 'Cmite';
}
}
} else {
$tickets = '<tr class="Cmite"><td colspan="7">Keine passenden Tickets gefunden!</td></tr>';
}
$tpl = new tpl('tickets/search_result',1);
$tpl->set_out('tickets',$tickets,0);
$design->footer();
break;
}
?>
include/includes/class/bbcode.php
Hier ein Screenshot wo was geändert werden muss
hier meine bbcode.php
[code]<?php
# Copyright by Thomas Bowe [Funjoy]
# Support bbcode@phpline.de
# link www.phpline.de
/* Module - Information
* -------------------------------------------------------
* Hier könnt ihr eure Module includieren lassen.
* Wenn Ihr selber Module zum Highlight programmiert
* denkt daran das ihr auch noch das Parsen hier definieren müsst.
* und in der bbcode_config.php Datei müsstet ihr die Option auch noch einstellen.
* um ein Beispiel zu haben schaut euch die Funktion _htmlblock() am besten mal an.
* und in Zeile 308 und Zeile 490 habt ihr ein Beispiel wie ihr die Parsebefehle schreiben könnt.
*/
//> Bitte denkt daran das, dass Modul html.php immer unter dem Modul css.php sein muss.
//> Modul [css.php]
if(file_exists("include/includes/class/highlight/css.php")) {
require_once("include/includes/class/highlight/css.php");
}
//> Modul [html.php]
if(file_exists("include/includes/class/highlight/html.php")) {
require_once("include/includes/class/highlight/html.php");
}
class bbcode {
//> Tags die geparsed werden dürfen.
var $permitted = array();
//> Verschlüsselte codeblocks.
var $codecblocks = array();
//> Badwords!
var $badwords = array();
//> Informationen für die Klasse!
var $info = array();
//> Patter befehle!
var $pattern = array();
//> Replace strings!
var $replace = array();
//> Smilies die in Grafik umgewandelt werden sollen.
var $smileys = array();
//> Cache für Quotes Header!
var $ayCacheQuoteOpen = array();
//> Cache fürQuotes Footer!
var $ayCacheQuoteClose = array();
//> Cache für Quotes Header!
var $ayCacheKtextOpen = array();
//> Cache fürQuotes Footer!
var $ayCacheKtextClose = array();
//> Codeblock verschlüsseln und wieder ausgeben.
function encode_codec($string,$tag,$file=NULL) {
$string = str_replace('\"', '"', $string);
$file = ($file == NULL) ? "":"=".$file;
$crypt = md5(count($this->codecblocks));
$this->codecblocks[$crypt.":".$tag] = $string;
return "[".$tag.$file."]".$crypt."[/".$tag."]";
}
//> Codeblock entschlüsseln und parsen!
function _codeblock($codecid,$file=NULL,$firstline=1) {
$string = $this->codecblocks[$codecid.':code'];
$string = htmlentities($string);
$string = str_replace("\t", ' ', $string);
$string = str_replace(' ', ' ', $string);
$string = str_replace(' ', ' ', $string);
$string = nl2br($string);
return $this->_addcodecontainer($string, 'Code', $file, $firstline);
}
//> htmlblock entschlüsseln und parsen!
function _htmlblock($codecid,$file=NULL,$firstline=1) {
$string = $this->codecblocks[$codecid.':html'];
$string = htmlentities($string);
//> Highlight Modul Funktion checken ob sie existerit.
if(function_exists("highlight_html")) {
$string = highlight_html($string,$this->info['BlockCodeFarbe']);
}
$string = str_replace("\t", ' ', $string);
$string = str_replace(' ', ' ', $string);
$string = str_replace(' ', ' ', $string);
$string = nl2br($string);
return $this->_addcodecontainer($string, 'HTML', $file, $firstline);
}
//> cssblock entschlüsseln und parsen!
function _cssblock($codecid,$file=NULL,$firstline=1) {
$string = $this->codecblocks[$codecid.':css'];
$string = htmlentities($string);
//> Highlight Modul Funktion checken ob sie existerit.
if(function_exists("highlight_css")) {
$string = highlight_css($string);
}
$string = str_replace("\t", ' ', $string);
$string = str_replace(' ', ' ', $string);
$string = str_replace(' ', ' ', $string);
$string = nl2br($string);
return $this->_addcodecontainer($string, 'CSS', $file, $firstline);
}
//> phpblock entschlüsseln und parsen!
function _phpblock($codecid, $file = null, $firstline = 1) {
$string = $this->codecblocks[$codecid . ':php'];
if (strpos($string, '<?php') === false) {
$string = "<?php\n{$string}\n?>";
$remove = true;
} else {
$remove = false;
}
ob_start();
highlight_string($string);
$php = ob_get_contents();
ob_end_clean();
if ($remove) {
$php = str_replace(array('<?php<br />', '<br /></span><span style="color: #0000BB">?></span>'), '', $php);
}
return $this->_addcodecontainer($php, 'Php', $file, $firstline);
}
function _addcodecontainer($code, $type, $file=null, $firstline=1) {
//> Datei pfad mit angegeben?
$file = ($file == NULL) ? "":" von Datei <em>".$this->_shortwords($file)."</em>";
//> Zeilen zählen.
$linescount = substr_count($code, "\n") + $firstline + 1;
if ($type == 'Php') {
$linescount = substr_count($code, "\r") + $firstline + 1;
}
$line = '';
for($no=$firstline;$no < $linescount;$no++) {
$line .= $no.":<br />";
}
//> Hier könnt ihr den Header und Footer für HTML editieren.
$breite = trim($this->info['BlockTabelleBreite']);
$breite = (strpos($breite, '%') !== false) ? '450px' : $breite.'px';
$header = "<div style=\"overflow: auto; width: {$breite};\">"
."<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"BORDER: 1px SOLID ".$this->info['BlockRandFarbe'].";\" width=\"100%\">"
."<tr><td colspan=\"3\" style=\"font-family:Arial, Helvetica, sans-serif;font-size:12px; font-weight:bold; color:".$this->info['BlockSchriftfarbe'].";background-color:".$this->info['BlockHintergrundfarbe'].";\"> ".$type.$file."</td></tr>"
."<tr bgcolor=\"".$this->info['BlockHintergrundfarbeIT']."\"><td style=\"width:20px; color:".$this->info['BlockSchriftfarbe'].";padding-left:2px;padding-right:2px;border-right:1px solid ".$this->info['BlockHintergrundfarbe'].";font-family:Arial, Helvetica, sans-serif;\" align=\"right\" valign=\"top\"><code style=\"width:20px;\">"
.$line
."</code></td><td width=\"5\"> </td><td valign=\"top\" style=\"background-color:".$this->info['BlockHintergrundfarbe']."; color:".$this->info['BlockSchriftfarbe'].";\" nowrap width=\"95%\"><code>";
$footer = "</code></td></tr></table></div>";
return $header.$code.$footer;
}
//> Smilies aus dem Array auslesen.
function _smileys($string) {
if(!is_null($this->smileys) && is_array($this->smileys)) {
if($this->permitted['smileys'] == true) {
$smileystart = '#@'.uniqid('').'@#';
$smileymid = '|#@|'.uniqid('').'|@#|';
$smileyend = '#@'.uniqid('').'@#';
foreach ($this->smileys as $icon => $info) {
list($emo, $url) = explode('#@#-_-_-#@#', $info);
$string = str_replace($icon, $smileystart.$icon.$smileyend, $string);
}
$string = str_replace($smileyend.$smileystart, $smileymid, $string);
$string = preg_replace('%(\S)' . $smileystart . '(.*)' . $smileyend . '%iU', '$1$2', $string);
$string = preg_replace('%(^|\s)(' . $smileystart . ')(.*)(' . $smileyend . ')%iUe', '\'$1\'.\'$2\'.str_replace(\''.$smileymid.'\',\''.$smileyend.$smileystart.'\',\'$3\').\'$4\'', $string);
$string = str_replace($smileymid, '', $string);
foreach ($this->smileys as $icon => $info) {
list($emo, $url) = explode('#@#-_-_-#@#', $info);
$string = str_replace($smileystart.$icon.$smileyend, '<img src="include/images/smiles/'.$url.'" border="0" alt="'.$icon.'" title="'.$emo.'" />', $string);
}
$string = str_replace(array($smileyend, $smileystart), '', $string);
}
return $string;
} else {
return $string;
}
}
// //> Smilies aus dem Array auslesen.
// function _smileys($string) {
// if(!is_null($this->smileys) && is_array($this->smileys)) {
// if($this->permitted['smileys'] == true) {
// foreach ($this->smileys as $icon => $info) {
// list($emo, $url) = explode('#@#-_-_-#@#', $info);
// $string = str_replace($icon,'<img src="include/images/smiles/'.$url.'" border="0" alt="'.$emo.'" title="'.$emo.'" />',$string);
// }
// }
// return $string;
// } else {
// return $string;
// }
// }
//> Badwords Filtern.
function _badwords($string) {
//> Badwords aus der Datenbank laden!
$cfgBBCodeSql = db_query("SELECT fcBadPatter, fcBadReplace FROM prefix_bbcode_badword");
while ($row = db_fetch_object($cfgBBCodeSql) ) {
$pattern[] = '%' . preg_quote($row->fcBadPatter,'%') . '%iU';
$replace[] = $row->fcBadReplace;
}
if(isset($pattern)) {
$string = preg_replace($pattern,$replace,$string);
}
return $string;
}
//> Liste formatieren.
function _list($codecid) {
$string = $this->codecblocks[$codecid.':list'];
$array = explode("[*]",$string);
for($no=1;$no<=(count($array)-1);$no++) {
$li .= "<li>".$this->parse($array[$no])."</li>";
}
return "<ul>".$li."</ul>";
}
//> Auf Maximale Schriftgröße überprüfen.
function _size($size, $string) {
$max = $this->info['SizeMax'];
return '<span style="font-size:' . ($size > $max ? $max : $size) . 'px">' . stripcslashes($string) . '</span>';
}
//> Bilder auf Verkleinern via Javascript überprüfen.
function _img($string, $float='') {
if ($float == 'none' OR $float == 'left' OR $float == 'right') {
$float = 'style="float:'.$float.'; margin: 5px;" ';
} else {
$float = '';
}
$image = '<img src="'.$string.'" alt="" title="" border="0" class="bbcode_image" '.$float.'/>';
return $image;
}
//> Screenshots darstellen.
function _screenshot($string,$float='none') {
if ($float == 'none' OR $float == 'left' OR $float == 'right') {
$float = 'style="float:'.$float.'; margin: 5px;" ';
} else {
$float = '';
}
$image = '<a href="'.$string.'" target="_blank"><img src="'.$string.'" alt="" title="" border="0" width="'.$this->info['ScreenMaxBreite'].'" height="'.$this->info['ScreenMaxHoehe'].'" '.$float.'/></a>';
return $image;
}
//> Urls Filtern um XSS vorzubeugen
function _filterurl($url) {
return str_replace(
array('<','>','(',')','#'),
array('<','>','(',')','#'),
$url
);
}
//> Links darstellen und ggf. kürzen
function _shorturl($string,$caption=null) {
if ($caption == null) { $caption = $string; }
$string = trim($string);
$caption = trim($this->_smileys($caption));
$server = '
'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
if (preg_match('%^((http|ftp|https)://)|^/%i',$string) == 0) { $string = '
'.$string; }
if (substr($string,0,1) == '/' OR strpos($string,$server) !== false) {
$target = '_self';
} else {
$target = '_blank';
}
$count = strlen($caption);
if($count >= $this->info['UrlMaxLaenge']) {
$string = "<a href=\"".$string."\" target=\"".$target."\">".$this->_shortcaptions($caption)."</a>";
} else {
$string = "<a href=\"".$string."\" target=\"".$target."\">".$caption."</a>";
}
return $string;
}
//> Linkbeschreibung kürzen
function _shortcaptions($string) {
$words = explode(" ",$string);
foreach($words as $word)
if(strlen($word) > $this->info['WortMaxLaenge'] && !preg_match('%(\[(img|shot)\](.*)\[/(img|shot)\])%i',$word)) {
$maxd2 = sprintf("%00d",($this->info['WortMaxLaenge']/2));
$string = str_replace($word,substr($word,0,$maxd2)."...".substr($word,-$maxd2),$string);
}
return $string;
}
//> Hilfsfunktion für _shortwords
function _checkpatterns($patterns, $word) {
if (!is_array($patterns)) {
return true;
}
foreach ($patterns as $p) {
if (preg_match($p, $word) == 1) {
return false;
}
}
return true;
}
//> Zu lange Wörter kürzen.
function _shortwords($string) {
//> Zeichenkette in einzelne Array elemente zerlegen.
$lines = explode("\n",$string);
//> Patter Befehle die nicht gekürzt werden dürfen !!!
$pattern = array("%^(www)(.[-a-zA-Z0-9@:;\%_\+.~#?&//=]+?)%i",
"%^(http|https|ftp)://{1}[-a-zA-Z0-9@:;\%_\+.~#?&//=]+?%i",
"%(\[(url|img(=(left|right))?|shot(=(left|right))?)\](.*)\[/(url|img|shot)\])|(\[url=(.*)\])%i",
"%\[(code|html|css|php|countdown)(=[^]]+)].*\[/(code|html|css|php|countdown)]%i",
"%(\[flash)?]((http|https|ftp)://[a-z-0-9@:\%_\+.~#\?&/=,;]+)\[/flash]%i",
"%\
%");
foreach($lines as $line) {
$words = explode(" ",$line);
foreach($words as $word)
if(strlen($word) > $this->info['WortMaxLaenge'] && $this->_checkpatterns($pattern, $word)) {
//Auskommentiert also Variante mit 'zulanges...Wort' zu gunsten von 'zulanges allesdazwischen Wort' (ohne ...)
//$maxd2 = sprintf("%00d",($this->info['WortMaxLaenge']/2));
$string = wordwrap($string, $this->info['WortMaxLaenge']);
}
}
return $string;
}
//> Geöffnete Ktext- Tags Nummerieren.
function _addKtextOpen($Titel=Null) {
$this->ayCacheKtextOpen[count($this->ayCacheKtextOpen)+1] = true;
$intCountKtext = count($this->ayCacheKtextOpen);
$string = "[ktext:".$intCountKtext."=".$Titel."]";
return $string;
}
//> Geschlossene Ktext- Tags Nummerieren.
function _addKtextClose() {
$this->ayCacheKtextClose[count($this->ayCacheKtextClose)+1] = true;
$intCountKtext = count($this->ayCacheKtextClose);
return "[/ktext:".$intCountKtext."]";
}
//> Ktext- Tags umwandeln..
function _ktext($string) {
$Random = rand(1,10000000);
//> Html- Muster für geöffnete Tags mit Titel.
$HeaderTitel = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"".$this->info['KtextTabelleBreite']."\" align=\"center\">"
."<tr><td><a href=\"javascript:Klapptext('__ID__')\">"
."<img src=\"include/images/icons/plus.gif\" id=\"image___ID__\" border=0 alt=\"Aus/Ein-klappen\" title=\"Aus/Ein-klappen\"> ";
$FooterTitel = "</a></td></tr>"
."<tr><td><div id=\"layer___ID__\" style=\"display:none;border:1px ".$this->info['KtextRandFormat']." ".$this->info['KtextRandFarbe'].";\">";
//> Html- Muster für geschlossene Tags.
$KtextClose = "</div></td></tr></table>\n";
//> Geöffnete Tags umwandeln.
for($c=1;$c <= count($this->ayCacheKtextOpen);$c++) {
if(count($this->ayCacheKtextClose) == count($this->ayCacheKtextOpen)) {
//> Format: [ktext=xxx]
$this->ktext_pattern[] = "%\[ktext:".$c."=([^]]*)\]%siU";
$this->ktext_replace[] = str_replace("__ID__",$c."@".$Random,$HeaderTitel)."\$1".str_replace("__ID__",$c."@".$Random,$FooterTitel);
//> Format: [/ktext]
$this->ktext_pattern[] = "%\[/ktext:".$c."\]%siU";
$this->ktext_replace[] = $KtextClose;
} else {
//> Format: [ktext=xxx]xxx[/ktext]
$this->ktext_pattern[] = "%\[ktext:([0-9]*)=([^]](.*)\[/ktext:([0-9]*)\]%siU";
$this->ktext_replace[] = str_replace("__ID__","\$1@".$Random,$HeaderTitel)."\$2".str_replace("__ID__","\$1@".$Random,$FooterTitel)."\$3".$KtextClose;
}
}
//> Nicht gefundene Paare wieder darstellen.
//> Format: [ktext=xxx]
$this->ktext_pattern[] = "%\[ktext:([0-9]*)=([^[/]*)\]%siU";
$this->ktext_replace[] = "[ktext=\$1]";
//> Format: [/ktext]
$this->ktext_pattern[] = "%\[/ktext:([0-9]*)\]%siU";
$this->ktext_replace[] = "[/ktext]";
//> String parsen
$string = preg_replace($this->ktext_pattern,$this->ktext_replace,$string);
return $string;
}
//> Geöffnete Quote- Tags Nummerieren.
function _addQuoteOpen($User=Null) {
$this->ayCacheQuoteOpen[count($this->ayCacheQuoteOpen)+1] = $User;
$intCountQuote = count($this->ayCacheQuoteOpen);
if($User != NULL) {
$string = "[quote:".$intCountQuote."=".$User."]";
} else {
$string = "[quote:".$intCountQuote."]";
}
return $string;
}
//> Geschlossene Quote- Tags Nummerieren.
function _addQuoteClose() {
$this->ayCacheQuoteClose[count($this->ayCacheQuoteClose)+1] = true;
$intCountQuote = count($this->ayCacheQuoteClose);
return "[/quote:".$intCountQuote."]";
}
//> Quote- Tags umwandeln.
function _quote($string) {
//> überprüfen ob Bod gesetzt ist.
if(strtolower($this->info['QuoteSchriftformatIT']) == "bold") {
$Schriftformat = "font-weight:bold;";
} else {
$Schriftformat = "font-style:".$this->info['QuoteSchriftformatIT'].";";
}
//> Html- Muster für geöffnete Quote- Tags.
$Header = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" style=\"BORDER: 1px SOLID ".$this->info['QuoteRandFarbe'].";\" width=\"".$this->info['QuoteTabelleBreite']."\" align=\"center\">"
."<tr><td style=\"font-family:Arial, Helvetica, sans-serif;FONT-SIZE:13px;FONT-WEIGHT:BOLD;COLOR:".$this->info['QuoteSchriftfarbe'].";BACKGROUND-COLOR:".$this->info['QuoteHintergrundfarbe'].";\"> Zitat</td></tr>"
."<tr bgcolor=\"".$this->info['QuoteHintergrundfarbeIT']."\"><td><table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"98%\"><tr><td style=\"".$Schriftformat."FONT-SIZE:10px;COLOR:".$this->info['QuoteSchriftfarbeIT'].";\">";
//> Html- Muster für geöffnete Quote- Tags mit User.
$HeaderUser = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" style=\"BORDER: 1px SOLID ".$this->info['QuoteRandFarbe'].";\" width=\"".$this->info['QuoteTabelleBreite']."\" align=\"center\">"
."<tr><td style=\"font-family:Arial, Helvetica, sans-serif;FONT-SIZE:13px;FONT-WEIGHT:BOLD;COLOR:".$this->info['QuoteSchriftfarbe'].";BACKGROUND-COLOR:".$this->info['QuoteHintergrundfarbe'].";\"> Zitat von ";
$FooterUser = "</td></tr><tr bgcolor=\"".$this->info['QuoteHintergrundfarbeIT']."\"><td><table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"98%\"><tr><td style=\"".$Schriftformat."FONT-SIZE:10px;COLOR:".$this->info['QuoteSchriftfarbeIT'].";\">";
//> Html- Muster für geschlossene Quote- Tags.
$QuoteClose = "</td></tr></table></td></tr></table>";
//> Geöffnete Tags umwandeln.
for($c=1;$c <= count($this->ayCacheQuoteOpen);$c++) {
if(count($this->ayCacheQuoteClose) == count($this->ayCacheQuoteOpen)) {
//> Format:
Zitat geschrieben von
xxx
$this->quote_pattern[] = "%\[quote:".$c."=([^[/]*)\]%siU";
$this->quote_replace[] = $HeaderUser."\$1".$FooterUser;
//> Format:
Zitat
$this->quote_pattern[] = "%\[quote:".$c."\]%siU";
$this->quote_replace[] = $Header;
//> Format:
$this->quote_pattern[] = "%\[/quote:".$c."\]%siU";
$this->quote_replace[] = $QuoteClose;
} else {
//> Format:
Zitat geschrieben von
xxxxxx
$this->quote_pattern[] = "%\[quote:([0-9]*)=([^[/]*)\[/quote:([0-9]*)\]%siU";
$this->quote_replace[] = $HeaderUser."\$2".$FooterUser."\$3".$QuoteClose;
//> Format: [quote]xxx
$this->quote_pattern[] = "%\[quote:([0-9]*)\](.*)\[/quote:\\1\]%siU";
$this->quote_replace[] = $Header."\$2".$QuoteClose;
}
}
//> Nicht gefundene Paare wieder darstellen.
//> Format:
Zitat geschrieben von
xxx
$this->quote_pattern[] = "%\[quote:([0-9]*)=([^[/]*)\]%siU";
$this->quote_replace[] = "[quote=\$2]";
//> Format:
Zitat
$this->quote_pattern[] = "%\[quote:([0-9])\]%siU";
$this->quote_replace[] = "[quote]";
//> Format:
$this->quote_pattern[] = "%\[/quote:([0-9])\]%siU";
$this->quote_replace[] = "
";
//> String parsen
$string = preg_replace($this->quote_pattern,$this->quote_replace,$string);
return $string;
}
//> Video intergration.
function _video($typ,$id) {
$typ = strtolower($typ);
if($typ == "google") {
$str = "<embed style=\"width:".$this->info['GoogleBreite']."px; height:".$this->info['GoogleHoehe']."px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=".$id."\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"".$this->info['GoogleHintergrundfarbe']."\" scale=\"noScale\" salign=\"TL\" FlashVars=\"playerMode=embedded\"/>";
}
if($typ == "youtube") {
$str = "<object width=\"".$this->info['YoutubeBreite']."\" height=\"".$this->info['YoutubeHoehe']."\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$id."\"></param><embed src=\"http://www.youtube.com/v/".$id."\" type=\"application/x-shockwave-flash\" width=\"".$this->info['YoutubeBreite']."\" height=\"".$this->info['YoutubeHoehe']."\" bgcolor=\"".$this->info['YoutubeHintergrundfarbe']."\"></embed></object>";
}
if($typ == "myvideo") {
$str = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"".$this->info['MyvideoBreite']."\" height=\"".$this->info['MyvideoHoehe']."\"><param name=\"movie\" value=\"http://www.myvideo.de/movie/".$id."\"></param><embed src=\"http://www.myvideo.de/movie/".$id."\" width=\"".$this->info['MyvideoBreite']."\" height=\"".$this->info['MyvideoHoehe']."\" type=\"application/x-shockwave-flash\"></embed></object>";
}
if($typ == "gametrailers") {
$str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="'.$this->info['YoutubeBreite'].'" height="'.$this->info['YoutubeHoehe'].'"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid='.$id.'"/> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid='.$id.'" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'.$this->info['YoutubeBreite'].'" height="'.$this->info['YoutubeHoehe'].'"></embed> </object>';
}
return $str;
}
//> Countdown berechnen.
function _countdown($date,$time=NULL) {
$date = explode(".",$date);
if ($time != NULL) {
$timechk = explode(':',$time);
if ($timechk[0] <= 23 && $timechk[1] <= 59 && $timechk[2] <= 59) $timechk = TRUE;
else $timechk = FALSE;
}
else $timechk = TRUE;
//> Html Design.
$Header = "<div style=\"width:".$this->info['CountdownTabelleBreite'].";padding:5px;font-family:Verdana;font-size:".$this->info['CountdownSchriftsize']."px;".$Font."color:".$this->info['CountdownSchriftfarbe'].";border:2px dotted ".$this->info['CountdownRandFarbe'].";text-align:center\">";
$Footer = "</div>";
//> Überprüfen ob die angaben stimmen.
if($date[0] <= 31 && $date[1] <= 12 && $date[2] /*>= date("Y")*/ && checkdate($date[1],$date[0],$date[2]) && $timechk) {
if(isset($time)) {
$time = explode(":",$time);
$intStd = $time[0];
$intMin = $time[1];
$intSek = $time[2];
} else {
$intStd = 0;
$intMin = 0;
$intSek = 0;
}
$Timestamp = @mktime($intStd, $intMin, $intSek, $date[1], $date[0], $date[2]);
$Diff = $Timestamp - time();
$Font =($this->info['CountdownSchriftformat'] == "bold") ? "font-wight:bold;":"font-style:".$this->info['CountdownSchriftformat'].";";
if($Diff > 1) {
$Tage = sprintf("%00d",($Diff / 86400));
$Stunden = sprintf("%00d",(($Diff - ($Tage * 86400)) / 3600));
$Minuten = sprintf("%00d",(($Diff - (($Tage * 86400)+($Stunden*3600))) / 60));
$Sekunden = ($Diff - (($Tage * 86400)+($Stunden*3600)+($Minuten*60)));
//> Bei höheren Wert wie 1 als Mehrzahl ausgeben.
$mzTg = ($Tage == 1) ? "":"e";
$mzStd = ($Stunden == 1) ? "":"n";
$mzMin = ($Minuten == 1) ? "":"n";
$mzSek = ($Sekunden == 1) ? "":"n";
//> Datum zusamstellen.
$str = $Header.$Tage." Tag".$mzTg.", ".$Stunden." Stunde".$mzStd.", ".$Minuten." Minute".$mzMin." und ".$Sekunden." Sekunde".$mzSek.$Footer;
} else {
//> Datum zusamstellen wenn Datum unmittelbar bevor steht.
$str = $Header.(is_array($time) ? implode(':',$time) : $time).' '.implode('.',$date)." !!!".$Footer;
}
} else {
/*if($time == NULL) {
$str = "[countdown]".implode('.',$date)."[/countdown]";
} else {
$str = "[countdown=".$time."]".implode('.',$date)."[/countdown]";
}*/
$str = $Header."Der Countdown ist falsch definiert".$Footer;
}
return $str;
}
function _ws($ws) {
return $ws;
}
//> Flash verwerten
function _flash($url, $options){
$width = $this->info['FlashBreite'];
$height = $this->info['FlashHoehe'];
if (!empty($options)) {
$options = explode(' ', $options);
foreach ($options as $option){
$tmp = 0;
list($name, $value) = explode('=', $option);
if ($name == 'width') {
$tmp = substr($value, 2, -2);
if ($tmp < $width) {
$width = $tmp;
}
} elseif ($name == 'height') {
$tmp = substr($value, 2, -2);
if ($tmp < $height) {
$height = $tmp;
}
}
}
}
return '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$width.'" height="'.$height.'"'.
'codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=7,0,0,0" class="bbcode_flash">'.
'<param name="movie" value="' . $url . '">'.
'<param name="quality" value="high">'.
'<param name="scale" value="exactfit">'.
'<param name="menu" value="true">'.
'<param name="bgcolor" value="'.$this->info['FlashHintergrundfarbe'].'"> '.
'<embed src="' . $url . '" quality="high" scale="exactfit" menu="false" '.
'bgcolor="'.$this->info['FlashHintergrundfarbe'].'" width="'.$width.'" height="'.$height.'" swLiveConnect="false" '.
'type="application/x-shockwave-flash" '.
'pluginspage="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">'.
'</embed>'.
'</object>';
}
function parse($string) {
//> Die Blocks werden codiert um sie vor dem restlichen parsen zu schützen.
if($this->permitted['php'] == true) {
$string = preg_replace("%\[php\](.+)\[\/php\]%esiU","\$this->encode_codec('\$1','php')",$string);
$string = preg_replace("%\[php=(.*)\](.+)\[\/php\]%esiU","\$this->encode_codec('\$2','php','\$1')",$string);
}
if($this->permitted['html'] == true) {
$string = preg_replace("%\[html\](.+)\[\/html\]%esiU","\$this->encode_codec('\$1','html')",$string);
$string = preg_replace("%\[html=(.*)\](.+)\[\/html\]%esiU","\$this->encode_codec('\$2','html','\$1')",$string);
}
if($this->permitted['css'] == true) {
$string = preg_replace("%\[css\](.+)\[\/css\]%esiU","\$this->encode_codec('\$1','css')",$string);
$string = preg_replace("%\[css=(.*)\](.+)\[\/css\]%esiU","\$this->encode_codec('\$2','css','\$1')",$string);
}
if($this->permitted['code'] == true) {
$string = preg_replace("%\[code\](.+)\[\/code\]%esiU","\$this->encode_codec('\$1','code')",$string);
$string = preg_replace("%\[code=(.*)\](.+)\[\/code\]%esiU","\$this->encode_codec('\$2','code','\$1')",$string);
}
if($this->permitted['list'] == true) {
$string = preg_replace("%\[list\](.+)\[\/list\]%esiU","\$this->encode_codec('\$1','list')",$string);
}
//> Badwors Filtern.
$string = $this->_badwords($string);
//> BB Code der den Codeblock nicht betrifft.
//> Überprüfen ob die wörter nicht die maximal länge überschrieten.
$string = $this->_shortwords($string);
$string = htmlentities($string);
$string = nl2br($string);
if($this->permitted['url'] == true) {
if($this->permitted['autourl'] == true) {
//> Format: www.xxx.de
$this->pattern[] = "%(( |\n|^)(www.[a-zA-Z\-0-9@:\%_\+.~#?&//=,;]+?))%eUi";
$this->replace[] = "\$this->_ws('\$2').\$this->_shorturl('\$3')";
//> Format:
externer Link
$this->pattern[] = "%(( |\n|^)((http|https|ftp)://{1}[a-zA-Z\-0-9@:\%_\+.~#?&//=,;]+?))%eUi";
$this->replace[] = "\$this->_ws('\$2').\$this->_shorturl('\$3')";
//> Format xxx@xxx.de
$this->pattern[] = "%(\s|^)([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})%i";
$this->replace[] = "<a href=\"mailto:$2\">$2</a>";
}
//> Format: [url=xxx]xxx[/url]
$this->pattern[] = "%\[url=([^\]]*)\](.+)\[\/url\]%eUis";
$this->replace[] = "\$this->_shorturl('\$1','\$2')";
//> Format: [url]xxx[/url]
$this->pattern[] = "%\[url\](.+)\[\/url\]%esiU";
$this->replace[] = "\$this->_shorturl('\$1')";
}
//> Darf BB Code [MAIL] dekodiert werden?
if($this->permitted['email'] == true) {
//> Format: [mail]xxx@xxx.de[/mail]
$this->pattern[] = "%\[mail\]([_\.0-9a-z-]+\@([0-9a-z\-]+)\.[a-z]{2,3})\[\/mail\]%Uis";
$this->replace[] = "<a href=\"mailto:$1\">$1</a>";
//> Format: [mail=xxx@xxx.de]xxx[/mail]
$this->pattern[] = "%\[mail=([_\.0-9a-z-]+\@([0-9a-z\-]+)\.[a-z]{2,3})\](.+)\[\/mail\]%Uis";
$this->replace[] = "<a href=\"mailto:$1\">$3</a>";
}
//> Darf BB Code
dekodiert werden?
if($this->permitted['b'] == true) {
//> Format: [b]xxx
$this->pattern[] = "%\[b\](.+)\[\/b\]%Uis";
$this->replace[] = "<b>\$1</b>";
}
//> Darf BB Code
dekodiert werden?
if($this->permitted['i'] == true) {
//> Format: [i]xxx
$this->pattern[] = "%\[i\](.+)\[\/i\]%Uis";
$this->replace[] = "<i>\$1</i>";
}
//> Darf BB Code
dekodiert werden?
if($this->permitted['u'] == true) {
//> Format: [u]xxx
$this->pattern[] = "%\[u\](.+)\[\/u\]%Uis";
$this->replace[] = "<u>\$1</u>";
}
//> Darf BB Code
dekodiert werden?
if($this->permitted['s'] == true) {
//> Format: [s]xxx
$this->pattern[] = "%\[s\](.+)\[\/s\]%Uis";
$this->replace[] = "<strike>\$1</strike>";
}
###############################################
//> Darf BB Code [LEFT] dekodiert werden?
if($this->permitted['left'] == true) {
//> Format: [left]xxx[/left]
$this->pattern[] = "%\[left\](.+)\[\/left\]%Uis";
$this->replace[] = "<div align=\"left\">\$1</div>";
}
//> Darf BB Code [CENTER] dekodiert werden?
if($this->permitted['center'] == true) {
//> Format: [center]xxx[/center]
$this->pattern[] = "%\[center\](.+)\[\/center\]%Uis";
$this->replace[] = "<div align=\"center\">\$1</div>";
}
//> Darf BB Code [RIGHT] dekodiert werden?
if($this->permitted['right'] == true) {
//> Format: [right]xxx[/right]
$this->pattern[] = "%\[right\](.+)\[\/right\]%Uis";
$this->replace[] = "<div align=\"right\">\$1</div>";
}
###############################################
//> Darf BB Code [EMPH] dekodiert werden?
if($this->permitted['emph'] == true) {
//> Format: [emph]xxx[/emph]
$this->pattern[] = "%\[emph\](.+)\[\/emph