} else { redirect_header('topic.php?pid=' . $id, 1, ($wtopic ? __('The topic could not be deleted!', 'bxpress') : __('The post could not be deleted!', 'bxpress')) . '<br />' . ($wtopic ? $topic->errors() : $post->errors())); } } else { include 'header.php'; //include '../../header.php'; $myts =& MyTextSanitizer::getInstance(); $hiddens['ok'] = 1; $hiddens['id'] = $id; $buttons['sbt']['value'] = __('Delete', 'bxpress'); $buttons['sbt']['type'] = 'submit'; $buttons['cancel']['value'] = __('Cancel', 'bxpress'); $buttons['cancel']['type'] = 'button'; $buttons['cancel']['extra'] = 'onclick="window.location=\'topic.php?pid=' . $id . '#p' . $id . '\';"'; $text = __('Dou you really wish to delete specified post?', 'bxpress'); if ($id == bXFunctions::getFirstId($topic->id())) { $text .= "<br /><br /><span class='bbwarning'>" . __('<strong>Warning:</strong> This is the first post in the topic. By deleting this all posts will be deleted also.', 'bxpress') . "</span>"; } $text .= "<br /><br /><strong>" . $post->uname() . ":</strong><br />"; $text .= substr($post->getVar('post_text', 'e'), 0, 100) . '...'; $form = new RMForm(__('Delete post?', 'bxpress'), 'frmDelete', 'delete.php'); $form->addElement(new RMFormHidden('ok', 1)); $form->addElement(new RMFormHidden('id', $id)); $form->addElement(new RMFormLabel('', $text)); $but = new RMFormButtonGroup(); $but->addButton('sbt', __('Delete!', 'bxpress'), 'submit'); $but->addButton('cancel', __('Cancel', 'bxpress'), 'button', 'onclick="history.go(-1);"'); $form->addElement($but); echo $form->render(); $tpl->assign('xoops_pagetitle', __('Delete Post?', 'bxpress') . ' » ' . $xoopsModuleConfig['forum_title']); include 'footer.php';
include 'header.php'; bXFunctions::makeHeader(); $form = new RMForm($tid > 0 ? __('Reply', 'bxpress') : __('Create New Topic', 'bxpress'), 'frmTopic', 'post.php'); $form->addElement(new RMFormSubTitle(__('Write your post and send it', 'bxpress'), 1, 'even')); if (!$xoopsUser) { $form->addElement(new RMFormText(__('Your name:', 'bxpress'), 'name', 50, 255), true); $form->addElement(new RMFormText(__('Your email:', 'bxpress'), 'email', 50, 255), true, 'email'); } if ($create) { $form->addElement(new RMFormText(__('Topic subject:', 'bxpress'), 'subject', 50, 255, $tid > 0 ? $topic->title() : ''), true); } // Sticky if ($xoopsUser && $xoopsModuleConfig['sticky'] && $create) { $sticky = $xoopsUser->isAdmin() || $forum->isModerator($xoopsUser->uid()) || $xoopsUser->posts() > $xoopsModuleConfig['sticky_posts']; if ($sticky) { if ($create || bXFunctions::getFirstId($topic->id()) == $topic->id()) { $form->addElement(new RMFormYesNo(__('Sticky topic', 'bxpress'), 'sticky', !$create ? $topic->sticky() : 0)); } } } // Si se especifico una acotación entonces la cargamos $idq = isset($_GET['quote']) ? intval($_GET['quote']) : 0; if ($idq > 0) { $post = new bXPost($idq); if ($post->isNew()) { break; } $quote = "[quote=" . $post->uname() . "]" . $post->getVar('post_text', 'n') . "[/quote]\n\n"; } $type = $rmc_config['editor_type']; // Verificamos el tipo de editor
} } else { $sql1 .= " (a.title LIKE '%{$search}%' OR b.post_text LIKE '%{$search}%') "; } } $sql2 .= ($sql1 ? " AND " : '') . " c.approved=1 AND a.id_topic=c.id_topic AND b.post_id=c.id_post AND d.id_forum=c.id_forum "; $sql2 .= $themes ? $themes == 1 ? " AND a.date>" . (time() - $xoopsModuleConfig['time_topics'] * 3600) : ($themes == 2 ? " AND a.replies=0" : '') : ''; $sql2 .= " ORDER BY a.sticky DESC, a.date DESC LIMIT {$start},{$limit}"; } $result = $db->queryF($sql . $sql1 . $sql2); while ($rows = $db->fetchArray($result)) { $date = bXFunctions::formatDate($rows['date']); $lastpost = array(); $firstpost = array(); if (!$search && $themes == 0) { $firstpost = bXFunctions::getFirstId($rows['id_topic']); $last = new bXPost($rows['last_post']); $lastpost['date'] = bXFunctions::formatDate($last->date()); $lastpost['by'] = sprintf(__('By: %s', 'bxpress'), $last->uname()); $lastpost['id'] = $last->id(); if ($xoopsUser) { $lastpost['new'] = $last->date() > $xoopsUser->getVar('last_login') && time() - $last->date() < $xoopsModuleConfig['time_new']; } else { $lastpost['new'] = time() - $last->date() <= $xoopsModuleConfig['time_new']; } } $tpl->append('posts', array('id' => $rows['id_topic'], 'title' => $rows['title'], 'sticky' => $rows['sticky'], 'user' => $rows['poster_name'], 'replies' => $rows['replies'], 'views' => $rows['views'], 'closed' => $rows['status'], 'date' => $date, 'by' => sprintf(__('By: %s', 'bxpress'), $rows['poster_name']), 'forum' => $rows['name'], 'id_post' => $rows['id_post'], 'post_text' => TextCleaner::getInstance()->truncate($rows['post_text'], 100), 'last' => $lastpost, 'firstpost' => $firstpost)); } $tpl->assign('lang_search', __('Search:', 'bxpress')); $tpl->assign('lang_recenttopics', __('Recent topics', 'bxpress')); $tpl->assign('lang_alltopics', __('All topics', 'bxpress'));
die; } } } } else { redirect_header('edit.php?id=' . $post->id() . '#attachments', 2, __('Sorry, you do not have permission to do this action', 'bxpress')); } redirect_header('edit.php?id=' . $post->id() . '#attachments', 1, __('File attached successfully!', 'bxpress') . $errors); break; default: $xoopsOption['template_main'] = "bxpress_postform.html"; $xoopsOption['module_subpage'] = "edit"; include 'header.php'; bXFunctions::makeHeader(); $form = new RMForm(__('Edit Topic', 'bxpress'), 'frmTopic', 'edit.php'); $first_id = bXFunctions::getFirstId($topic->id()); if ($id == $first_id) { $form->addElement(new RMFormText(__('Topic Subject:', 'bxpress'), 'subject', 50, 255, $topic->title()), true); // Sticky if ($xoopsUser && $xoopsModuleConfig['sticky']) { $sticky = $xoopsUser->isAdmin() || $forum->isModerator($xoopsUser->uid()) || $xoopsUser->posts() > $xoopsModuleConfig['sticky_posts'] && $topic->poster() == $xoopsUser->uid(); if ($sticky) { $form->addElement(new RMFormYesNo(__('Sticky Topic', 'bxpress'), 'sticky', $topic->sticky())); } } } // Si se especifico una acotación entonces la cargamos $idq = isset($_GET['quote']) ? intval($_GET['quote']) : 0; if ($idq > 0) { $post = new bXPost($idq); if ($post->isNew()) {