if (!($result = $xoopsDB->query($sql))) { newbb_message("poll adding to topic error: " . $sql); } include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($xoopsModule->getVar('mid')); } else { newbb_message($poll->getHtmlErrors()); //exit(); } redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); //exit(); } if ($op == "edit") { $poll = new XoopsPoll($_GET['poll_id']); $poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php"); $author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poll->getVar("user_id") . "'>" . newbb_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname']) . "</a>"); $poll_form->addElement($author_label); $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E")); $poll_form->addElement($question_text); $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E")); $poll_form->addElement($desc_tarea); $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s"); if (!$poll->hasExpired()) { $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, $date); $poll_form->addElement($expire_text); } else { $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); $poll_form->addElement($restart_label); } $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight")); $poll_form->addElement($weight_text);
$cancel_button = new XoopsFormButton('', 'cancel', _MD_CANCELPOST, 'button'); $extra = "viewtopic.php?forum={$forum}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}"; $cancel_button->setExtra("onclick='location=\"" . $extra . "\"'"); $button_tray->addElement($submit_button); $button_tray->addElement($cancel_button); $report_form->addElement($button_tray); $report_form->display(); $post_handler =& xoops_getmodulehandler('post', 'newbb'); $forumpost =& $post_handler->get($post_id); $r_subject = $forumpost->getVar('subject', "E"); if ($xoopsModuleConfig['enable_karma'] && $forumpost->getVar('post_karma') > 0) { $r_message = sprintf(_MD_KARMA_REQUIREMENT, "***", $forumpost->getVar('post_karma')) . "</div>"; } elseif ($xoopsModuleConfig['allow_require_reply'] && $forumpost->getVar('require_reply')) { $r_message = _MD_REPLY_REQUIREMENT; } else { $r_message = $forumpost->getVar('post_text'); } $r_date = formatTimestamp($forumpost->getVar('post_time')); if ($forumpost->getVar('uid')) { $r_name = newbb_getUnameFromId($forumpost->getVar('uid'), $xoopsModuleConfig['show_realname']); } else { $poster_name = $forumpost->getVar('poster_name'); $r_name = empty($poster_name) ? $xoopsConfig['anonymous'] : $myts->htmlSpecialChars($poster_name); } $r_content = _MD_SUBJECTC . " " . $r_subject . "<br />"; $r_content .= _MD_BY . " " . $r_name . " " . _MD_ON . " " . $r_date . "<br /><br />"; $r_content .= $r_message; echo "<br /><table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>" . $r_subject . "</td></tr>"; echo "<tr><td><br />" . $r_content . "<br /></td></tr></table>"; include XOOPS_ROOT_PATH . '/footer.php'; }
$dosmiley = empty($_POST['dosmiley']) ? 0 : 1; $dohtml = empty($_POST['dohtml']) ? 0 : 1; $doxcode = empty($_POST['doxcode']) ? 0 : 1; $dobr = empty($_POST['dobr']) ? 0 : 1; $p_message = $_POST['message']; $p_message = $myts->previewTarea($p_message, $dohtml, $dosmiley, $doxcode, 1, $dobr); $p_date = formatTimestamp(time()); if ($post_obj->isNew()) { if (is_object($xoopsUser)) { $p_name = $xoopsUser->getVar("uname"); if (!empty($xoopsModuleConfig['show_realname']) && $xoopsUser->getVar("name")) { $p_name = $xoopsUser->getVar("name"); } } } elseif ($post_obj->getVar('uid')) { $p_name = newbb_getUnameFromId($post_obj->getVar('uid'), $xoopsModuleConfig['show_realname']); } if (empty($p_name)) { $p_name = empty($_POST['poster_name']) ? htmlspecialchars($xoopsConfig['anonymous']) : htmlSpecialChars($myts->stripSlashesGPC($_POST['poster_name'])); } $post_preview = array("subject" => $p_subject, "meta" => _MD_BY . " " . $p_name . " " . _MD_ON . " " . $p_date, "content" => $p_message); $xoopsTpl->assign_by_ref("post_preview", $post_preview); } if (!empty($_POST['contents_upload']) || !empty($_POST['contents_preview']) || !empty($_GET['contents_preview']) || !empty($_POST['editor'])) { $editor = empty($_POST['editor']) ? "" : $_POST['editor']; $dosmiley = empty($_POST['dosmiley']) ? 0 : 1; $dohtml = empty($_POST['dohtml']) ? 0 : 1; $doxcode = empty($_POST['doxcode']) ? 0 : 1; $dobr = empty($_POST['dobr']) ? 0 : 1; $subject = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['subject'])); $message = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['message']));
$uservotes = $xoopsDB->getRowsNum($result2); $useravgrating = 0; while (list($rating2) = $xoopsDB->fetchRow($result2)) { $useravgrating = $useravgrating + $rating2; } if ($useravgrating > 0) { $useravgrating = $useravgrating / $uservotes; $useravgrating = number_format($useravgrating, 2); } xoops_cp_header(); loadModuleAdminMenu(10, _AM_NEWBB_VOTE_RATINGINFOMATION); echo "\r\n <fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_VOTE_DISPLAYVOTES . "</legend>\n\r\n <div style='padding: 8px;'>\n\r\n <div><strong>" . _AM_NEWBB_VOTE_USERAVG . ": </strong>{$useravgrating}</div>\n\r\n <div><strong>" . _AM_NEWBB_VOTE_TOTALRATE . ": </strong>{$uservotes}</div>\n\r\n <div style='padding: 8px;'>\n\r\n <ul><li>" . newbb_displayImage('admin_delete', _DELETE) . " " . _AM_NEWBB_VOTE_DELETEDSC . "</li></ul>\r\n <div>\n\r\n </fieldset>\n\r\n <br />\n\r\n\r\n <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n\r\n <tr>\n\r\n <th align='center'>" . _AM_NEWBB_VOTE_ID . "</th>\n\r\n <th align='center'>" . _AM_NEWBB_VOTE_USER . "</th>\n\r\n <th align='center'>" . _AM_NEWBB_VOTE_IP . "</th>\n\r\n <th align='center'>" . _AM_NEWBB_VOTE_FILETITLE . "</th>\n\r\n <th align='center'>" . _AM_NEWBB_VOTE_RATING . "</th>\n\r\n <th align='center'>" . _AM_NEWBB_VOTE_DATE . "</th>\n\r\n <th align='center'>" . _AM_NEWBB_ACTION . "</th></tr>\n"; if ($votes == 0) { echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . "</td></tr>"; } while (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $xoopsDB->fetchRow($results)) { $sql = "SELECT topic_title FROM " . $xoopsDB->prefix('bb_topics') . " WHERE topic_id=" . $topic_id . ""; $down_array = $xoopsDB->fetchArray($xoopsDB->query($sql)); $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); $ratinguname = newbb_getUnameFromId($ratinguser, $xoopsModuleConfig['show_realname']); echo "\r\n <tr>\n\r\n <td class='head' align='center'>{$ratingid}</td>\n\r\n <td class='even' align='center'>{$ratinguname}</td>\n\r\n <td class='even' align='center'>{$ratinghostname}</td>\n\r\n <td class='even' align='left'><a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}' rel='external'>" . $myts->htmlSpecialChars($down_array['topic_title']) . "</a></td>\n\r\n <td class='even' align='center'>{$rating}</td>\n\r\n <td class='even' align='center'>{$formatted_date}</td>\n\r\n <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id={$topic_id}&rid={$ratingid}'>" . newbb_displayImage('admin_delete', _DELETE) . "</a></strong></td>\n\r\n </tr>\n"; } echo "</table>"; //Include page navigation include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $page = $votes > 20 ? _AM_NEWBB_MINDEX_PAGE : ''; $pagenav = new XoopsPageNav($page, 20, $start, 'start'); echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; break; } xoops_cp_footer();
function getAllTopics(&$forum, $criteria = null) { global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsUser, $viewall_forums; require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.render.php"; require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.session.php"; require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.time.php"; require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.read.php"; require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.topic.php"; $criteria_vars = array("startdate", "start", "sort", "order", "type", "status", "excerpt"); foreach ($criteria_vars as $var) { ${$var} = $criteria[$var]; } $topic_lastread = newbb_getcookie('LT', true); if (is_object($forum)) { $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); $hot_threshold = $forum->getVar('hot_threshold'); } else { $hot_threshold = 10; if (is_array($forum) && count($forum) > 0) { $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; } elseif (!empty($forum)) { $criteria_forum = ' AND t.forum_id =' . intval($forum); } else { $criteria_forum = ''; } } $criteria_post = $startdate ? ' p.post_time > ' . $startdate : " 1 = 1 "; $criteria_topic = empty($type) ? '' : " AND t.type_id={$type}"; $criteria_extra = ''; $criteria_approve = ' AND t.approved = 1'; $post_on = ' p.post_id = t.topic_last_post_id'; $leftjoin = ' LEFT JOIN ' . $this->db->prefix('bb_posts') . ' p ON p.post_id = t.topic_last_post_id'; $sort_array = array(); switch ($status) { case 'digest': $criteria_extra = ' AND t.topic_digest = 1'; break; case 'unreplied': $criteria_extra = ' AND t.topic_replies < 1'; break; case 'unread': if (empty($xoopsModuleConfig["read_mode"])) { } elseif ($xoopsModuleConfig["read_mode"] == 2) { $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; } elseif ($xoopsModuleConfig["read_mode"] == 1) { $topics = array(); $topic_lastread = newbb_getcookie('LT', true); if (count($topic_lastread) > 0) { foreach ($topic_lastread as $id => $time) { if ($time > $time_criterion) { $topics[] = $id; } } } if (count($topics) > 0) { $criteria_extra = ' AND t.topic_id NOT IN (' . implode(",", $topics) . ')'; } if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) { $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); } } break; case 'pending': $post_on = ' p.topic_id = t.topic_id'; $criteria_post .= ' AND p.pid = 0'; $criteria_approve = ' AND t.approved = 0'; break; case 'deleted': $criteria_approve = ' AND t.approved = -1'; break; case 'all': // For viewall.php; do not display sticky topics at first // For viewall.php; do not display sticky topics at first case 'active': // same as "all" break; default: if ($startdate > 0) { $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; } $sort_array[] = 't.topic_sticky DESC'; break; } $select = 't.*, ' . ' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; $from = $this->db->prefix("bb_topics") . ' t ' . $leftjoin; $where = $criteria_post . $criteria_topic . $criteria_forum . $criteria_extra . $criteria_approve; if ($excerpt) { $select .= ', p.post_karma, p.require_reply, pt.post_text'; $from .= ' LEFT JOIN ' . $this->db->prefix('bb_posts_text') . ' pt ON pt.post_id = t.topic_last_post_id'; } if ($sort == "u.uname") { $sort = "t.topic_poster"; } $sort_array[] = trim($sort . ' ' . $order); $sortby = implode(", ", array_filter($sort_array)); if (empty($sortby)) { $sortby = 't.topic_last_post_id DESC'; } $sql = 'SELECT ' . $select . ' FROM ' . $from . ' WHERE ' . $where . ' ORDER BY ' . $sortby; if (!($result = $this->db->query($sql, $xoopsModuleConfig['topics_per_page'], $start))) { redirect_header('index.php', 2, _MD_ERROROCCURED); exit; } $sticky = 0; $topics = array(); $posters = array(); $reads = array(); $types = array(); $type_handler =& xoops_getmodulehandler('type', 'newbb'); $typen = $type_handler->getByForum($forum->getVar('forum_id')); while ($myrow = $this->db->fetchArray($result)) { if ($myrow['topic_sticky']) { $sticky++; } // ------------------------------------------------------ // topic_icon: priority: sticky -> digest -> regular if ($myrow['topic_haspoll']) { if ($myrow['topic_sticky']) { $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY) . '<br />' . newbb_displayImage('poll', _MD_TOPICHASPOLL); } else { $topic_icon = newbb_displayImage('poll', _MD_TOPICHASPOLL); } } elseif ($myrow['topic_sticky']) { $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY); } elseif (!empty($myrow['icon'])) { $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />'; } else { $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; } // ------------------------------------------------------ // rating_img $rating = number_format($myrow['rating'] / 2, 0); $rating_img = newbb_displayImage($rating < 1 ? 'blank' : 'rate' . $rating); // ------------------------------------------------------ // topic_page_jump $topic_page_jump = ''; $topic_page_jump_icon = ''; $totalpages = ceil(($myrow['topic_replies'] + 1) / $xoopsModuleConfig['posts_per_page']); if ($totalpages > 1) { $topic_page_jump .= ' '; $append = false; for ($i = 1; $i <= $totalpages; $i++) { if ($i > 3 && $i < $totalpages) { if (!$append) { $topic_page_jump .= "..."; $append = true; } } else { $topic_page_jump .= '[<a href="viewtopic.php?topic_id=' . $myrow['topic_id'] . '&start=' . ($i - 1) * $xoopsModuleConfig['posts_per_page'] . '">' . $i . '</a>]'; $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&start=" . ($i - 1) * $xoopsModuleConfig['posts_per_page'] . "'>" . newbb_displayImage('document', _MD_NEWBB_GOTOLASTPOST) . "</a>"; } } } else { $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "'>" . newbb_displayImage('document', _MD_NEWBB_GOTOLASTPOST) . "</a>"; } // ------------------------------------------------------ // => topic array if (!empty($viewall_forums[$myrow['forum_id']])) { $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewall_forums[$myrow['forum_id']]['forum_name'] . '</a>'; } else { $forum_link = ''; } $topic_title = $myts->htmlSpecialChars($myrow['topic_title']); if ($myrow['topic_digest']) { $topic_title = "<span class='digest'>" . $topic_title . "</span>"; } if ($excerpt == 0) { $topic_excerpt = ""; } elseif (($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($forum)) { $topic_excerpt = ""; } else { $topic_excerpt = xoops_substr(newbb_html2text($myts->displayTarea($myrow['post_text'])), 0, $excerpt); $topic_excerpt = str_replace("[", "[", $myts->htmlSpecialChars($topic_excerpt)); } /* users */ $posters[$myrow['topic_poster']] = 1; $posters[$myrow['uid']] = 1; // reads if (!empty($xoopsModuleConfig["read_mode"])) { $reads[$myrow['topic_id']] = $xoopsModuleConfig["read_mode"] == 1 ? $myrow['last_post_time'] : $myrow["topic_last_post_id"]; } $topic_poster = newbb_getUnameFromId($myrow['topic_poster'], $xoopsModuleConfig['show_realname'], true); $topic_last_poster = newbb_getUnameFromId($myrow['uid'], $xoopsModuleConfig['show_realname'], true); $topic_isRead = newbb_isRead("topic", $reads); $topic_prefix = !empty($typen[$myrow['type_id']]) ? getTopicTitle("", $typen[$myrow['type_id']]["type_name"], $typen[$myrow['type_id']]["type_color"]) : ""; // ------------------------------------------------------ // topic_folder: priority: newhot -> hot/new -> regular if ($myrow['topic_status'] == 1) { $topic_folder = 'topic_locked'; $topic_folder_text = _MD_TOPICLOCKED; } else { if ($myrow['topic_digest']) { $topic_folder = 'topic_digest'; $topic_folder_text = _MD_TOPICDIGEST; } elseif ($myrow['topic_replies'] >= $hot_threshold) { $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_hot_new' : 'topic_hot'; $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_MORETHAN : _MD_MORETHAN2; } else { $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_new' : 'topic'; $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_NEWPOSTS : _MD_NONEWPOSTS; } } $topics[$myrow['topic_id']] = array('topic_id' => $myrow['topic_id'], 'topic_icon' => $topic_icon, 'type_id' => $myrow['type_id'], 'type_text' => $topic_prefix, 'topic_title' => $topic_title, 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], 'rating_img' => $rating_img, 'topic_page_jump' => $topic_page_jump, 'topic_page_jump_icon' => $topic_page_jump_icon, 'topic_replies' => $myrow['topic_replies'], 'topic_poster_uid' => $myrow['topic_poster'], 'topic_poster_name' => $myts->htmlSpecialChars($myrow['poster_name'] ? $myrow['poster_name'] : $xoopsConfig['anonymous']), 'topic_views' => $myrow['topic_views'], 'topic_time' => newbb_formatTimestamp($myrow['topic_time']), 'topic_last_posttime' => newbb_formatTimestamp($myrow['last_post_time']), 'topic_last_poster_uid' => $myrow['uid'], 'topic_last_poster_name' => $myts->htmlSpecialChars($myrow['last_poster_name'] ? $myrow['last_poster_name'] : $xoopsConfig['anonymous']), 'topic_forum_link' => $forum_link, 'topic_excerpt' => $topic_excerpt, 'stick' => empty($myrow['topic_sticky']), "topic_poster" => $topic_poster, "topic_last_poster" => $topic_last_poster, "topic_folder" => newbb_displayImage($topic_folder, $topic_folder_text)); } if (count($topics) > 0) { $sql = " SELECT DISTINCT topic_id FROM " . $this->db->prefix("bb_posts") . " WHERE attachment != ''" . " AND topic_id IN (" . implode(',', array_keys($topics)) . ")"; if ($result = $this->db->query($sql)) { while (list($topic_id) = $this->db->fetchRow($result)) { $topics[$topic_id]['attachment'] = ' ' . newbb_displayImage('attachment', _MD_TOPICSHASATT); } } } return array($topics, $sticky); }
foreach ($reports as $report) { $post_link = "<a href=\"" . XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/viewtopic.php?post_id=" . $report['post_id'] . "&topic_id=" . $report['topic_id'] . "&forum=" . $report['forum_id'] . "&viewmode=thread\" target=\"checkreport\">" . $myts->htmlSpecialChars($report['subject']) . "</a>"; $checkbox = '<input type="checkbox" name="report_id[' . $report['report_id'] . ']" value="1" checked="checked" />'; if ($item == 'process') { $memo = '<input type="text" name="report_memo[' . $report['report_id'] . ']" maxlength="255" size="80" />'; } else { $memo = $myts->htmlSpecialChars($report['report_memo']); } echo "<tr class='odd' align='left'>"; echo "<td>" . _AM_NEWBB_REPORTPOST . ': ' . $post_link . "</td>"; echo "<td align='center'>" . $report['report_id'] . "</td>"; echo "</tr>"; echo "<tr class='odd' align='left'>"; echo "<td>" . _AM_NEWBB_REPORTTEXT . ': ' . $myts->htmlSpecialChars($report['report_text']) . "</td>"; $uid = intval($report['reporter_uid']); $reporter_name = newbb_getUnameFromId($uid, $xoopsModuleConfig['show_realname']); $reporter = !empty($uid) ? "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $uid . "'>" . $reporter_name . "</a><br />" : ""; echo "<td align='center'>" . $reporter . long2ip($report['reporter_ip']) . "</td>"; echo "</tr>"; echo "<tr class='odd' align='left'>"; echo "<td>" . _AM_NEWBB_REPORTMEMO . ': ' . $memo . "</td>"; echo "<td align='center' >" . $checkbox . "</td>"; echo "</tr>"; echo "<tr colspan='2'><td height='2'></td></tr>"; } $submit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); echo "<tr colspan='2'><td align='center'>" . $submit->render() . "</td></tr>"; $hidden =& new XoopsFormHidden('op', 'save'); echo $hidden->render(); $hidden =& new XoopsFormHidden('item', $item); echo $hidden->render() . "</form>";
$category_handler =& xoops_getmodulehandler("category"); $category_obj =& $category_handler->get($forum_obj->getVar("cat_id"), array("cat_title")); //check banning $moderated_id = is_object($xoopsUser) && $xoopsUser->uid() > 0 ? $xoopsUser->uid() : 0; $moderated_isadmin = is_object($xoopsUser) && $xoopsUser->isAdmin() ? true : false; $moderated_ip = $_SERVER['REMOTE_ADDR']; $moderated_forum = $forum_obj->getVar('forum_id'); $moderate_handler =& xoops_getmodulehandler('moderate', 'newbb'); if ($moderate_handler->verifyUser($moderated_id, $moderated_ip, $moderated_forum) && !$moderated_isadmin) { $criteria = new CriteriaCompo(); $criteria->add(new criteria('uid', $moderated_id, '=')); $criteria->setSort('mod_end'); $criteria->setOrder('DESC'); $mod = $moderate_handler->getObjects($criteria, false, false); $tage = ($mod[0]['mod_end'] - $mod[0]['mod_start']) / 60 / 60 / 24; $msg = $myts->displayTarea(sprintf(_MD_SUSPEND_TEXT, newbb_getUnameFromId($moderated_id), intval($tage), $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1); xoops_error($msg, _MD_SUSPEND_NOACCESS); include XOOPS_ROOT_PATH . '/footer.php'; exit; } $xoopsTpl->assign('category', array("id" => $forum_obj->getVar("cat_id"), "title" => $category_obj->getVar('cat_title'))); $xoopsTpl->assign("parentforum", $forum_handler->getParents($forum_obj)); $xoopsTpl->assign(array('forum_id' => $forum_obj->getVar('forum_id'), 'forum_name' => $forum_obj->getVar('forum_name'))); if (!is_object($topic_obj)) { $topic_obj = $topic_handler->create(); } $editby = false; if ($topic_obj->isNew()) { $form_title = _MD_POSTNEW; } elseif ($post_obj->isNew()) { if (empty($post_parent_obj)) {