/** * @see DatabaseObjectList::readObjects() */ protected function readThreadIDs() { $sql = "SELECT\t" . $this->sqlSelectRating . "\n\t\t\t\tthread.threadID\n\t\t\tFROM\twcf" . WCF_N . "_tag_to_object tag_to_object,\n\t\t\t\twbb" . WBB_N . "_thread thread\n\t\t\t WHERE\ttag_to_object.tagID = " . $this->tagID . "\n\t\t\t\tAND tag_to_object.taggableID = " . $this->taggable->getTaggableID() . "\n\t\t\t\tAND thread.threadID = tag_to_object.objectID\n\t\t\t\t" . (!empty($this->sqlConditions) ? "AND " . $this->sqlConditions : '') . "\n\t\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); $result = WCF::getDB()->sendQuery($sql, $this->limit, $this->offset); while ($row = WCF::getDB()->fetchArray($result)) { if (!empty($this->threadIDs)) { $this->threadIDs .= ','; } $this->threadIDs .= $row['threadID']; } }
/** * Gets the object ids. */ protected function readObjectIDArray() { $sql = "SELECT\t\tcontest.contestID, contest.attachments\n\t\t\tFROM\t\twcf" . WCF_N . "_tag_to_object tag_to_object,\n\t\t\t\t\twcf" . WCF_N . "_contest contest\n\t\t\tWHERE\t\ttag_to_object.tagID = " . intval($this->tagID) . "\n\t\t\t\t\tAND tag_to_object.taggableID = " . $this->taggable->getTaggableID() . "\n\t\t\t\t\tAND contest.contestID = tag_to_object.objectID\n\t\t\t\t\t" . (!empty($this->sqlConditions) ? "AND " . $this->sqlConditions : '') . "\n\t\t\t\t\tAND (" . Contest::getStateConditions() . ")\n\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); $result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset); while ($row = WCF::getDB()->fetchArray($result)) { $this->objectIDArray[] = $row['contestID']; if ($row['attachments']) { $this->attachmentEntryIDArray[] = $row['contestID']; } } }
/** * @see Page::assignVariables() */ public function assignVariables() { parent::assignVariables(); // display branding require_once WCF_DIR . 'lib/util/ContestUtil.class.php'; ContestUtil::assignVariablesBranding(); $this->sidebar->assignVariables(); WCF::getTPL()->assign(array('entries' => $this->entryList->getObjects(), 'description' => $this->description, 'classes' => $this->entryList->getClasses(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'tags' => $this->entryList->getTags(), 'availableTags' => $this->tags, 'tagID' => $this->tagID, 'juryID' => $this->juryID, 'participantID' => $this->participantID, 'classID' => $this->classID, 'tag' => $this->tag, 'taggableID' => $this->taggable !== null ? $this->taggable->getTaggableID() : 0, 'allowSpidersToIndexThisPage' => true)); }