ich habe offline was probiert, wollte eben mal Blog Modul nutzen da ist mir aufgefallen das sich die Kommentare gar nicht löschen lassen. Kommt jedes mal "Du hast nicht die nötigen Rechte.". Finde da auch auf die schnelle kein Fehler
Jemand eine idee eventuell?
<?php defined ('main') or die ('no direct access'); $title = $allgAr['title'].' :: Userblog'; $hmenu = 'Userblog'; $design = new design ( $title , $hmenu ); $design->header(); if ( $menu->get(2) != 'new' ) { if ( $menu->get(2) > 0 && strlen($menu->get(2)) > 0 && db_num_rows(db_query("SELECT * FROM prefix_user WHERE id=" . $menu->get(2))) == 1) { if ( !isset($_POST['submit']) && !isset($_GET['del']) ) { switch ( $menu->get(3) ) { default : if ( $menu->get(2) == $_SESSION['authid'] ) { $tpl = new tpl ('user/blog'); $tpl->out(0); } if ( !isset($_GET['id']) ) { $limit = 3; // Limit $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1 ); $MPL = db_make_sites ($page , "WHERE uid = ".$menu->get(2) , $limit , 'index.php?user-blog-'.$menu->get(2) , 'user_blog' ); $anfang = ($page - 1) * $limit; $abf = "SELECT * FROM prefix_user_blog WHERE uid=" . $menu->get(2) . " ORDER by id DESC LIMIT ".$anfang.",".$limit; $erg = db_query($abf); $abf2 = "SELECT * FROM prefix_user WHERE id=" . $menu->get(2); $erg2 = db_query($abf2); $row2 = db_fetch_assoc($erg2); $tpl = new tpl ('user/blog'); if ( db_num_rows($erg) > 0 ) { $rows = db_num_rows($erg); $query = "SELECT * FROM prefix_online where uid = " . $menu->get(2); $result = db_query($query); if (db_num_rows($result) > 0) { $status = '<img src="include/images/icons/online.gif" /> Online'; } else { $status = '<img src="include/images/icons/offline.gif" /> Offline'; } while ( $row = db_fetch_assoc($erg) ) { $koms = db_num_rows(db_query("SELECT id FROM prefix_user_blog_koms WHERE bid=" . $menu->get(2) . " AND pid=" . $row['id'])); $tpl->set('name', $row2['name']); $tpl->set('homepage', $row2['homepage']); $tpl->set('avatar', $row2['avatar']); $tpl->set('email', $row2['email']); $tpl->set('id', $menu->get(2)); $tpl->set('title', $row['title']); $tpl->set('txt', $row['txt']); $tpl->set('time', $row['time']); $tpl->set('eid', $row['id']); $tpl->set('status', $status); $tpl->set('koms', $koms); $tpl->out(1); } $tpl->set('SITELINK', $MPL); $tpl->out(2); } else { echo 'Keine Einträge vorhanden'; } } if ( isset($_GET['id']) ) { $tpl = new tpl ('user/blog'); $koms = db_num_rows(db_query("SELECT id FROM prefix_user_blog_koms WHERE bid=" . $menu->get(2) . " AND pid=" . $_GET['id'])); $query = "SELECT * FROM prefix_online where uid = " . $menu->get(2); $result = db_query($query); if (db_num_rows($result) > 0) { $status = '<img src="include/images/icons/online.gif" /> Online'; } else { $status = '<img src="include/images/icons/offline.gif" /> Offline'; } $abf = "SELECT * FROM prefix_user_blog WHERE id=" . $_GET['id']; $erg = db_query($abf); $row = db_fetch_assoc($erg); $abf2 = "SELECT * FROM prefix_user WHERE id=" . $menu->get(2); $erg2 = db_query($abf2); $row2 = db_fetch_assoc($erg2); $tpl->set('name', $row2['name']); $tpl->set('homepage', $row2['homepage']); $tpl->set('avatar', $row2['avatar']); $tpl->set('email', $row2['email']); $tpl->set('id', $menu->get(2)); $tpl->set('title', $row['title']); $tpl->set('txt', $row['txt']); $tpl->set('time', $row['time']); $tpl->set('status', $status); $tpl->set('koms', $koms); $tpl->out(1); if ( loggedin() ) { $tpl->out(3); } $abf3 = "SELECT * FROM prefix_user_blog_koms WHERE bid=" . $menu->get(2) . " AND pid=" . $_GET['id']; $erg3 = db_query($abf3); echo '<br /> <table width="100%" class="border"> <tr> <td>'; while ( $row3 = db_fetch_assoc($erg3) ) { $name = db_result(db_query("SELECT name FROM prefix_user WHERE id=" . $row3['uid'])); if ( $menu->get(2) == $_SESSION['authid'] ) { $del = '<a href="index.php?user-blog-' . $menu->get(2) . '&id=' . $_GET['id'] . '&del=' . $row3['id'] . '"><img src="include/images/icons/del.gif" /></a> '; } else { $del = ''; } $tpl->set('del', $del); $tpl->set('kom', $row3['txt']); $tpl->set('user', $name); $tpl->out(4); } echo '</td> </tr> </table>'; } break; } } elseif ( isset($_POST['submit'])) { db_query("INSERT INTO prefix_user_blog_koms (`bid`,`uid`,`pid`,`txt`) VALUES (" . $menu->get(2) . "," . $_SESSION['authid'] . "," . $_GET['id'] . ",'" . $_POST['txt'] . "')"); wd('index.php?user-blog-' . $menu->get(2) . '-koms&id=' . $_GET['id'],'Erfolgreich kommentiert.'); } elseif ( isset ($_GET['del']) && isset($_GET['id'])) { $check = db_num_rows(db_query("SELECT uid FROM prefix_user_blog WHERE id=" . db_result(db_query("SELECT bid FROM prefix_user_blog_koms WHERE pid=" . $_GET['id'])))); if ( $menu->get(2) == $_SESSION['authid'] && $check == $_SESSION['authid'] ) { db_query("DELETE FROM prefix_user_blog_koms WHERE id=" . $_GET['del'] . " LIMIT 1"); wd('index.php?user-blog-' . $_SESSION['authid'] . '&id=' . $_GET['id'], 'Erfolgreich gelöscht.'); } else { wd('index.php','Du hast nicht die nötigen Rechte.'); } } } else { wd('index.php','Dieser Blog / User existiert nicht.'); } } else { if ( !isset($_POST['new']) ) { $tpl = new tpl('user/blog'); $tpl->out(5); } else { if ( !empty($_POST['title']) && !empty($_POST['txt']) ) { $time = date("d") . '-' . date("m") . '-' . date("Y"); db_query("INSERT INTO prefix_user_blog (`uid`,`title`,`txt`,`time`) VALUES (" . $_SESSION['authid'] . ",'" . $_POST['title'] . "','" . bbcode($_POST['txt']) . "','" . $time . "')"); wd('index.php?user-blog-' . $_SESSION['authid'], 'Erfolgreich eingetragen.'); } else { wd('index.php?user-blog-new','Bitte fülle alle Felder aus'); } } } $design->footer(); ?>