Beispiel #1
0
     $userData['type'] = $bbUser->isAdmin() ? 'admin' : ($forum->isModerator($bbUser->uid()) ? 'moderator' : 'user');
 } else {
     $userData = array();
     $userData['id'] = 0;
     $userData['uname'] = $xoopsModuleConfig['anonymous_prefix'] . $post->uname();
     //$userData['rank'] = $xoopsConfig['anonymous'];
     //$userData['rank_image'] = '';
     $userData['registered'] = '';
     $userData['avatar'] = RMEvents::get()->run_event("rmcommon.get.avatar", '', 0);
     $userData['posts'] = sprintf(__('Posts: %u', 'bxpress'), 0);
     $userData['online'] = false;
     $userData['type'] = 'anon';
 }
 // Adjuntos
 $attachs = array();
 foreach ($post->attachments() as $k) {
     $attachs[] = array('title' => $k->name(), 'downs' => $k->downloads(), 'id' => $k->id(), 'ext' => $k->extension(), 'size' => RMUtilities::formatBytesSize($k->size()), 'icon' => $k->getIcon());
 }
 $tf = new RMTimeFormatter(0, __('%T% %d%, %Y%', 'bxpress'));
 // Likes parsing
 if (!is_null($row['liked'])) {
     $likes_ids = explode(",", $row['liked'], 3);
 } else {
     $likes_ids = array();
 }
 $likes = array();
 foreach ($likes_ids as $like) {
     if (!isset($users[$like])) {
         $users[$like] = new XoopsUser($like);
     }
     $like_user = $users[$like];
Beispiel #2
0
 $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())));
         $forma->addElement($ele, true);
         $forma->setExtra('enctype="multipart/form-data"');
     }
     // Lista de Archivos Adjuntos
     $list = new RMFormCheck(__('Cuerrent Attachments', 'bxpress'));
     $list->asTable(1);
     foreach ($post->attachments() as $file) {
         $list->addOption("<img src='" . $file->getIcon() . "' align='absmiddle' /> " . $file->name() . " (" . RMUtilities::formatBytesSize($file->size()) . ")", 'files[]', $file->id());
     }
     $forma->addElement($list);
     $ele = new RMFormButtonGroup();
     if ($post->totalAttachments() < $xoopsModuleConfig['attachlimit']) {
         $ele->addButton('upload', __('Upload File', 'bxpress'), 'submit');
     }
     $ele->addButton('delete', __('Delete File(s)', 'bxpress'), 'button', 'onclick="document.forms[\'frmAttach\'].op.value=\'delete\'; submit();"');
     $ele->addButton('cancel', __('Cancel', 'bxpress'), 'button', 'onclick="window.location = \'topic.php?pid=' . $post->id() . '#p' . $post->id() . '\'";');
     $forma->addElement($ele);
     $forma->addElement(new RMFormHidden('op', 'upload'));
     $forma->addElement(new RMFormHidden('id', $id));
 }
 $tpl->assign('topic_form', $form->render() . "<br />" . $forma->render());
 $tpl->assign('lang_topicreview', __('Topic Review (Newest First)', 'bxpress'));