コード例 #1
0
 /**
  * Displays the post queue.
  * This function displays all elements of the postqueue in a list
  * view.
  *
  * @author  Martin Helmich
  * @version 2007-07-21
  * @return  string The postqueue list content
  */
 function display_postQueue()
 {
     $template = $this->cObj->fileResource($this->conf['template.']['postqueue']);
     $template = $this->cObj->getSubpart($template, '###POSTQUEUE_LIST###');
     $template_row = $this->cObj->getSubpart($template, '###POSTQUEUE_ITEM###');
     $marker = array('###LLL_PUBLISH###' => $this->pi_getLL('postqueue.publishtab'), '###LLL_DELETE###' => $this->pi_getLL('postqueue.deletetab'), '###LLL_IGNORE###' => $this->pi_getLL('postqueue.ignoretab'), '###LLL_POSTTEXT###' => $this->pi_getLL('postqueue.posttext'), '###LLL_POSTQUEUE###' => $this->pi_getLL('postqueue.title'), '###LLL_PUBLISHBUTTON###' => $this->pi_getLL('postqueue.publishbutton'), '###LLL_NOITEMS###' => $this->pi_getLL('postqueue.noitems'), '###ACTION###' => $this->parent->escapeURL($this->parent->pi_getPageLink($GLOBALS['TSFE']->id)));
     $template = $this->cObj->substituteMarkerArray($template, $marker);
     $rContent = '';
     $boards = $this->getModeratorBoards();
     if (is_array($boards)) {
         $res = $this->databaseHandle->exec_SELECTquery('q.*', 'tx_mmforum_postqueue q LEFT JOIN tx_mmforum_topics t ON q.post_parent = t.uid', 'q.deleted = 0 AND (t.deleted=0 OR t.uid IS NULL) AND (q.topic_forum IN (' . implode(',', $boards) . ') OR t.forum_id IN (' . implode(',', $boards) . '))', '', 'q.crdate DESC');
     } elseif ($boards === true) {
         $res = $this->databaseHandle->exec_SELECTquery('*', 'tx_mmforum_postqueue', 'deleted=0', '', 'crdate DESC');
     }
     if ($boards !== false) {
         if ($this->databaseHandle->sql_num_rows($res) > 0) {
             $template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_NOITEMS###', '');
         } else {
             $template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_ITEMLIST###', '');
         }
         while ($arr = $this->databaseHandle->sql_fetch_assoc($res)) {
             $rMarker = array('###LLL_WROTE###' => $this->pi_getLL('postqueue.wrote'), '###DATE###' => $this->parent->formatDate($arr['post_time']), '###POST_TEXT###' => $this->tx_mmforum_postparser->main($this->parent, $this->conf, $this->parent->escape($arr['post_text']), 'textparser'), '###UID###' => $arr['uid'], '###POST_POSTER###' => $this->parent->linkToUserProfile($arr['post_user']), '###CHECK_DELETE###' => '', '###CHECK_IGNORE###' => $arr['hidden'] ? 'checked="checked"' : '', '###CHECK_PUBLISH###' => $arr['hidden'] ? '' : 'checked="checked"', '###FORUMPATH###' => $this->getForumLink($arr['topic_forum']));
             if ($arr['topic']) {
                 $rMarker['###TOPIC_LINK###'] = $this->parent->escape($arr['topic_title']) . ' [' . $this->pi_getLL('postqueue.newTopic') . ']';
             } else {
                 $tData = $this->parent->getTopicData($arr['post_parent']);
                 $linkParams[$this->parent->prefixId] = array('action' => 'list_post', 'tid' => $tData['uid']);
                 if ($this->parent->getIsRealURL()) {
                     $linkParams[$this->parent->prefixId]['fid'] = $tData['forum_id'];
                 }
                 $rMarker['###TOPIC_LINK###'] = $this->parent->pi_linkToPage($this->parent->escape($tData['topic_title']), $this->conf['pid_forum'], '', $linkParams);
             }
             $rContent .= $this->cObj->substituteMarkerArray($template_row, $rMarker);
         }
         $template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_ITEM###', $rContent);
     } else {
         $template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_ITEMLIST###', '');
     }
     return $template;
 }