$q = str_replace('{WHERE}', $where, str_replace('{SELECT}', $s, $q2)); } elseif ($such == 'aeit') { $where = "`c`.`time` >= " . $x . " AND `c`.`erstid` = " . $uid; $gAnz = @db_result(db_query(str_replace('{WHERE}', $where, str_replace('{SELECT}', ' COUNT(DISTINCT `a`.`id`)', $q))), 0); $q = str_replace('{WHERE}', $where, str_replace('{SELECT}', $s, $q)); } $MPL = db_make_sites($page, "", $limit, 'index.php?forum-' . $such . ($such == 'aeit' ? '-' . $uid : ''), "", $gAnz); $tpl = new tpl('forum/search'); $q = db_query($q . " LIMIT " . $anfang . "," . $limit); $class = ''; $tpl->set_out('gAnz', $gAnz, 0); while ($r = db_fetch_assoc($q)) { $class = $class == 'Cmite' ? 'Cnorm' : 'Cmite'; $r['class'] = $class; $r['ctime'] = db_result(db_query("SELECT MAX(`time`) FROM `prefix_posts` WHERE `tid` = " . $r['id']), 0, 0); $r['ord'] = forum_get_ordner($r['ctime'], $r['id'], $r['fid']); $r['link'] = 'forum-showposts-' . $r['id']; if ($menu->get(1) == 'aeit') { $r['author'] = ''; } elseif ($such == 'aubt') { $r['author'] = ' ' . $lang['from'] . ' ' . $r['author']; } else { $r['author'] = ' ' . $lang['newpost'] . ' ' . $lang['from'] . ' ' . $r['author']; $r['postsbefore'] = db_count_query('SELECT COUNT(`id`) FROM `prefix_posts` WHERE `tid` = ' . $r['id'] . ' AND `id` < ' . $r['firstnew']); $r['page'] = ceil(($r['postsbefore'] + 1) / $allgAr['Fpanz']); $r['link'] .= '-p' . $r['page'] . '#' . $r['firstnew']; } $tpl->set_ar_out($r, 1); } $tpl->set_out('MPL', $MPL, 2); if ($such == 'aeit') {
*/ defined('main') or die('no direct access'); $title = $allgAr['title'] . ' :: Forum :: ' . aktForumCats($aktForumRow['kat'], 'title'); $hmenu = $extented_forum_menu . '<a class="smalfont" href="index.php?forum">Forum</a><b> » </b>' . aktForumCats($aktForumRow['kat']) . $extented_forum_menu_sufix; $design = new design($title, $hmenu, 1); $design->header(); $tpl = new tpl('forum/show_cat'); $tpl->out(0); $cid = escape($menu->get(2), 'integer'); $q = "SELECT\r\n `a`.`id`, `a`.`cid`, `a`.`name`, `a`.`besch`,\r\n `a`.`topics`, `a`.`posts`, `b`.`name` as `topic`,\r\n `c`.`id` as `pid`, `c`.`tid`, `b`.`rep`, `c`.`erst`, `c`.`time`,\r\n `a`.`cid`, `k`.`name` as `cname`\r\nFROM `prefix_forums` `a`\r\n LEFT JOIN `prefix_forumcats` `k` ON `k`.`id` = `a`.`cid`\r\n LEFT JOIN `prefix_posts` `c` ON `a`.`last_post_id` = `c`.`id`\r\n LEFT JOIN `prefix_topics` `b` ON `c`.`tid` = `b`.`id`\r\n\r\n LEFT JOIN `prefix_groupusers` `vg` ON `vg`.`uid` = " . $_SESSION['authid'] . " AND `vg`.`gid` = `a`.`view`\r\n LEFT JOIN `prefix_groupusers` `rg` ON `rg`.`uid` = " . $_SESSION['authid'] . " AND `rg`.`gid` = `a`.`reply`\r\n LEFT JOIN `prefix_groupusers` `sg` ON `sg`.`uid` = " . $_SESSION['authid'] . " AND `sg`.`gid` = `a`.`start`\r\n\r\nWHERE ((" . $_SESSION['authright'] . " <= `a`.`view` AND `a`.`view` < 1)\r\n OR (" . $_SESSION['authright'] . " <= `a`.`reply` AND `a`.`reply` < 1)\r\n OR (" . $_SESSION['authright'] . " <= `a`.`start` AND `a`.`start` < 1)\r\n\t OR `vg`.`fid` IS NOT NULL\r\n\t OR `rg`.`fid` IS NOT NULL\r\n\t OR `sg`.`fid` IS NOT NULL\r\n\t OR -9 >= " . $_SESSION['authright'] . ")\r\n AND `k`.`id` = " . $cid . "\r\nORDER BY `k`.`pos`, `a`.`pos`"; $erg1 = db_query($q); $xcid = 0; while ($r = db_fetch_assoc($erg1)) { $r['topicl'] = $r['topic']; $r['topic'] = html_enc_substr($r['topic'], 0, 23); $r['ORD'] = forum_get_ordner($r['time'], $r['id']); $r['mods'] = getmods($r['id']); $r['datum'] = post_date($r['time']); $r['page'] = ceil(($r['rep'] + 1) / $allgAr['Fpanz']); $tpl->set_ar($r); if ($r['cid'] != $xcid) { $tpl->out(1); // Unterkategorien $sql = db_query("SELECT DISTINCT `a`.`name` as `cname`, `a`.`id` as `cid` FROM `prefix_forumcats` `a` LEFT JOIN `prefix_forums` `b` ON `a`.`id` = `b`.`cid` WHERE `a`.`cid` = {$r['cid']} AND `a`.`id` = `b`.`cid` ORDER BY `a`.`pos`, `a`.`name`"); while ($ucat = db_fetch_assoc($sql)) { $tpl->set_ar_out($ucat, 2); } // Unterkategorien - Ende $xcid = $r['cid']; } $tpl->out(3);
if ($forum_rights['start'] == TRUE) { $tpl->set('NEWTOPIC', '<b>[ <a href="index.php?forum-newtopic-' . $fid . '">' . $lang['newtopic'] . '</a> ]</b>'); } else { $tpl->set('NEWTOPIC', ''); } $tpl->set('MPL', $MPL); $tpl->set_out('FID', $fid, 0); $q = "SELECT a.id, a.name, a.rep, a.erst, a.hit, a.art, a.stat, b.time, b.erst as last, b.id as pid\r\n\tFROM prefix_topics a\r\n\tLEFT JOIN prefix_posts b ON a.last_post_id = b.id\r\n\tWHERE a.fid = {$fid}\r\n\tORDER BY a.art DESC, b.time DESC\r\n\tLIMIT " . $anfang . "," . $limit; $erg = db_query($q); if (db_num_rows($erg) > 0) { while ($row = db_fetch_assoc($erg)) { if ($row['stat'] == 0) { $row['ORD'] = 'cord'; } else { #$row['ORD'] = get_ordner($row['time']); $row['ORD'] = forum_get_ordner($row['time'], $row['id'], $fid); } $row['date'] = date('d.m.y - H:i', $row['time']); $row['page'] = ceil(($row['rep'] + 1) / $allgAr['Fpanz']); $row['VORT'] = $row['art'] == 1 ? 'Fest: ' : ''; $tpl->set_ar_out($row, 1); } } else { echo '<tr><td colspan="6" class="Cnorm"><b>keine Einträge vorhanden</b></td></tr>'; } $tpl->out(2); if ($forum_rights['mods'] == TRUE) { $tpl->set('id', $fid); $tpl->out(3); } $design->footer();
/** * Checkt, ob ein Post neu ist * * @param $ftime Die letzte Updatezeit des Topics * @param $id Die Id des Topics * @param $postid die Id des Posts */ function post_is_new($ftime, $topicId, $forumId) { // wir rufen ganz frech forum_get_ordner auf und überprüfen den rückgabewert $result = forum_get_ordner($ftime, $topicId, $forumId) == 'nord' ? true : false; return $result; }