while ($r = db_rowobj($c)) { if ($prev_frm != $r->forum_id) { $prev_frm = $r->forum_id; $message_data .= '<tr><th class="SelFS">Forum: <a class="thLnk" href="/egroupware/fudforum/3814588639/index.php?t=' . t_thread_view . '&frm_id=' . $r->forum_id . '&' . _rsid . '"><font class="lg">' . htmlspecialchars($r->name) . '</font></a></th></tr>'; $perms = perms_from_obj($r, $usr->users_opt & 1048576); } if ($prev_th != $r->thread_id) { $thl[] = $r->thread_id; $prev_th = $r->thread_id; $message_data .= '<tr><th class="SelTS"> Topic: <a class="thLnk" href="/egroupware/fudforum/3814588639/index.php?t=' . d_thread_view . '&goto=' . $r->id . '&' . _rsid . '">' . $r->thr_subject . '</a></th></tr>'; } if (_uid && $r->last_view < $r->post_stamp && $r->post_stamp > $usr->last_read && !isset($mark_read[$r->thread_id])) { $mark_read[$r->thread_id] = $r->id; } $usr->md = $r->md; $message_data .= tmpl_drawmsg($r, $usr, $perms, false, $n, ''); } un_register_fps(); unset($c); } else { $message_data = ''; } if (_uid && isset($mark_read)) { ses_putvar((int) $usr->sid, $mark_read); } if (isset($thl)) { q('UPDATE phpgw_fud_thread SET views=views+1 WHERE id IN(' . implode(',', $thl) . ')'); } if (!$message_data) { if (isset($_GET['unread'])) { $message_data = '<tr><th align=middle>There are no unread messages matching your query.</th></tr>';
LEFT JOIN phpgw_fud_level l ON u.level_id=l.id LEFT JOIN phpgw_fud_poll p ON m.poll_id=p.id LEFT JOIN phpgw_fud_poll_opt_track pot ON pot.poll_id=p.id AND pot.user_id=' . _uid . ' ORDER BY mr.id'); $perms = perms_from_obj($r, $usr->users_opt & 1048576); $MOD = 1; $reported_message = ''; $n = 0; $_GET['start'] = 0; $usr->md = 1; while ($obj = db_rowobj($r)) { $user_login = $obj->report_user_id ? '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $obj->report_user_id . '&' . _rsid . '">' . $obj->report_user_login . '</a>' : '' . $GLOBALS['ANON_NICK']; if (empty($prev_thread_id) || $prev_thread_id != $obj->thread_id) { $prev_thread_id = $obj->thread_id; } $message = tmpl_drawmsg($obj, $usr, $perms, false, $n, null); $reported_message .= '<tr class="RowStyleC"><td> <table border=0 cellspacing=0 cellpadding=3 width="100%"> <tr> <td align=left nowrap valign=top> <font class="SmallText"> <b>Riferito da:</b> ' . $user_login . '<br /> <b>Il:</b> ' . strftime("%a, %d %B %Y %H:%M", $obj->report_stamp) . ' </font> </td> <td align=center width="100%" valign=top> <font class="SmallText"><b>Motivazione</b><br /></font> <table border=1 cellspacing=1 cellpadding=0><tr><td align="left"> ' . $obj->report_reason . ' </td></tr></table> </td> <td nowrap>[<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=reported&' . _rsid . '&del=' . $obj->report_id . '">Cancella report</a>]</td>
} $c = uq('SELECT m.*, t.thread_opt, t.root_msg_id, t.last_post_id, t.forum_id, u.id AS user_id, u.alias AS login, u.users_opt, u.last_visit AS time_sec, p.max_votes, p.expiry_date, p.creation_date, p.name AS poll_name, p.total_votes FROM phpgw_fud_msg m INNER JOIN phpgw_fud_thread t ON m.thread_id=t.id LEFT JOIN phpgw_fud_users u ON m.poster_id=u.id LEFT JOIN phpgw_fud_poll p ON m.poll_id=p.id WHERE m.thread_id=' . $th_id . ' AND m.apr=1 ORDER BY id ' . $msg_order_by . ' LIMIT ' . qry_limit($count, $start)); $message_data = ''; $m_count = 0; while ($obj = db_rowobj($c)) { $message_data .= tmpl_drawmsg($obj, $usr, $perms, true, $m_count, ''); $mid = $obj->id; } un_register_fps(); $minimsg_pager = tmpl_create_pager($start, $count, $total, "javascript: document.post_form.minimsg_pager_switch.value='%s'; document.post_form.submit();", null, false, false); $minimsg = '<br /><br /> <table border=0 width="100%" cellspacing=0 cellpadding=3 class="dashed"> <tr><td class="miniMH">Thread View</td></tr> <tr><td> <table border="0" cellspacing="1" cellpadding="2" class="ContentTable"> ' . $message_data . ' </table> </td></tr> <tr><td>' . $minimsg_pager . '</td></tr> </table> <input type="hidden" name="minimsg_pager_switch" value="' . $start . '">';
} if ($cur->kiddie_pos < $cur->kiddie_count) { ++$lev; $stack[$stack_cnt++] =& $cur->kiddies[$cur->kiddie_pos]; } else { // unwind the stack if needed unset($stack[--$stack_cnt]); --$lev; } unset($cur); } } $n = 0; $_GET['start'] = ''; $usr->md = $frm->md; $message_data = tmpl_drawmsg($msg_obj, $usr, $perms, false, $n, array($prev_msg, $next_msg)); un_register_fps(); get_prev_next_th_id($frm, $prev_thread_link, $next_thread_link); $pdf_link = $FUD_OPT_2 & 2097152 ? '[ <a href="' . $GLOBALS['WWW_ROOT'] . 'pdf.php?msg=' . $mid . '">Generate printable PDF</a> ]' : ''; $xml_link = $FUD_OPT_2 & 1048576 ? '[ <a href="/egroupware/fudforum/3814588639/index.php?t=help_index&section=boardusage#syndicate">Syndicate this forum (XML)</a> ]' : ''; if ($FUD_OPT_2 & 2) { $page_gen_end = gettimeofday(); $page_gen_time = sprintf('%.5f', $page_gen_end['sec'] - $PAGE_TIME['sec'] + ($page_gen_end['usec'] - $PAGE_TIME['usec']) / 1000000); $page_stats = '<br /><div align="left" class="SmallText">Total time taken to generate the page: ' . $page_gen_time . ' seconds</div>'; } else { $page_stats = ''; } echo $GLOBALS['fud_egw_hdr']; ?> <table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td class="ForumBackground"> <?php
FROM phpgw_fud_msg m INNER JOIN phpgw_fud_thread t ON m.thread_id=t.id INNER JOIN phpgw_fud_forum f ON t.forum_id=f.id LEFT JOIN phpgw_fud_users u ON m.poster_id=u.id LEFT JOIN phpgw_fud_level l ON u.level_id=l.id LEFT JOIN phpgw_fud_poll p ON m.poll_id=p.id LEFT JOIN phpgw_fud_poll_opt_track pot ON pot.poll_id=p.id AND pot.user_id=' . _uid . ' WHERE m.thread_id=' . $_GET['th'] . ' AND m.apr=1 ORDER BY m.id ASC LIMIT ' . qry_limit($count, $_GET['start'])); $obj2 = $message_data = ''; $usr->md = $frm->md; $m_num = 0; while ($obj = db_rowobj($result)) { $message_data .= tmpl_drawmsg($obj, $usr, $perms, false, $m_num, array($_GET['start'], $count)); $obj2 = $obj; } unset($result); un_register_fps(); if (!isset($_GET['prevloaded'])) { th_inc_view_count($frm->id); if (_uid && $obj2) { if ($frm->last_forum_view < $obj2->post_stamp) { user_register_forum_view($frm->forum_id); } if ($frm->last_view < $obj2->post_stamp) { user_register_thread_view($frm->id, $obj2->post_stamp, $obj2->id); } } }