Exemple #1
0
    }
} 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') . ' &raquo; ' . $xoopsModuleConfig['forum_title']);
    include 'footer.php';
    //include '../../footer.php';
}
Exemple #2
0
     // 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()) {
         break;
     }
     $quote = "[quote=" . $post->uname() . "]" . $post->getVar('post_text', 'e') . "[/quote]\n\n";
 }
 $form->addElement(new RMFormEditor(__('Post', 'bxpress'), 'msg', '90%', '300px', $rmc_config['editor_type'] == 'tiny' ? $post->getVar('post_text') : $post->getVar('post_text', 'e')), true);
 $form->addElement(new RMFormHidden('op', 'post'));
 $form->addElement(new RMFormHidden('id', $id));
 $ele = new RMFormButtonGroup();
 $ele->addButton('sbt', __('Save Changes', 'bxpress'), 'submit');
 $ele->addButton('cancel', _CANCEL, 'button', 'onclick="window.location = \'topic.php?pid=' . $post->id() . '#p' . $post->id() . '\'";');
 $form->addElement($ele);
 // Adjuntar Archivos
 if ($forum->attachments() && $forum->isAllowed($xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS, 'attach')) {
     $forma = new RMForm('<a name="attachments"></a>' . __('Attached Files', 'bxpress'), 'frmAttach', 'edit.php');
     $forma->addElement(new RMFormSubTitle(sprintf(__('You can upload new files to this post. You have a limit of <strong>%s</strong> attachment per post.', 'bxpress'), $xoopsModuleConfig['attachlimit']), 1, 'even'));
     if ($post->totalAttachments() < $xoopsModuleConfig['attachlimit']) {
         $ele = new RMFormFile(__('Attach File:', 'bxpress'), 'attach', 45, $xoopsModuleConfig['maxfilesize'] * 1024);
         $ele->setDescription(sprintf(__('Allowed File Types: %s', 'bxpress'), implode(',', $forum->extensions())));
Exemple #3
0
 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
 if (!$xoopsModuleConfig['html']) {
     if ($type == 'tiny' || $type == 'html') {
         $type = 'simple';
     }
 }
 $form->addElement(new RMFormEditor(__('Post', 'bxpress'), 'msg', 'auto', '400px', isset($quote) ? $quote : ''), true);
 // Adjuntar Archivos
 if ($forum->attachments() && $forum->isAllowed($xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS, 'attach')) {
     $ele = new RMFormFile(__('Attach file', 'bxpress'), 'attach', 45, $xoopsModuleConfig['maxfilesize'] * 1024);
     $ele->setDescription(sprintf(__('Allowed file types: %s', 'bxpress'), implode(',', $forum->extensions())));
     $form->addElement($ele);
     $form->setExtra('enctype="multipart/form-data"');
Exemple #4
0
     $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);
     $user = new RMUser($post->uid);
     if ($post->isNew()) {
         break;
     }
     $quote = "[quote author=" . str_replace(" ", "+", $user->name != '' ? $user->name : $user->uname) . "]" . $post->getVar('post_text', 'n') . "[/quote]\n\n";
 }
 $type = $rmc_config['editor_type'];
 // Verificamos el tipo de editor
 if (!$xoopsModuleConfig['html']) {
     if ($type == 'tiny' || $type == 'html') {
         $type = 'simple';
     }
 }
 $form->addElement(new RMFormEditor(__('Post', 'bxpress'), 'msg', 'auto', '400px', isset($quote) ? $quote : ''), true);
 // Adjuntar Archivos
 if ($forum->attachments() && $forum->isAllowed($xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS, 'attach')) {
     $ele = new RMFormFile(__('Attach file', 'bxpress'), 'attach', 45, $xoopsModuleConfig['maxfilesize'] * 1024);
     $ele->setDescription(sprintf(__('Allowed file types: %s', 'bxpress'), implode(',', $forum->extensions())));
     $form->addElement($ele);
     $form->setExtra('enctype="multipart/form-data"');