/**
  * @see	TrackbackAdapter::receive()
  */
 public function ping($objectID, $trackbackURL)
 {
     require_once WCF_DIR . 'lib/data/contest/ViewableContest.class.php';
     $entry = new ViewableContest($objectID);
     if (!$entry->contestID) {
         throw new IllegalLinkException();
     }
     $trackback = new Trackback('easy coding contest', $entry->getOwner()->getName());
     $trackback->ping($trackbackURL, PAGE_URL . '/index.php?page=Contest&contestID=' . $objectID, $entry->subject, $entry->getExcerpt());
 }
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // save invitations
     if ($this->entry->isOwner()) {
         require_once WCF_DIR . 'lib/form/ContestJuryInviteForm.class.php';
         new ContestJuryInviteForm($this->entry);
     }
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestJuryEditForm.class.php';
         new ContestJuryEditForm($this->entry);
     } else {
         if ($this->entry->isJuryable()) {
             require_once WCF_DIR . 'lib/form/ContestJuryAddForm.class.php';
             new ContestJuryAddForm($this->entry);
         }
     }
     if ($this->entry->state != 'closed') {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.jury.closed.info') . '</p>');
         // init todo list
         require_once WCF_DIR . 'lib/data/contest/jury/todo/ContestJuryTodoList.class.php';
         $this->todoList = new ContestJuryTodoList();
         $this->todoList->sqlConditions .= 'contest_jury.contestID = ' . $this->contestID;
         $this->todoList->readObjects();
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'isJury' => $this->isJury, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'jurys' => $this->juryList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
Exemplo n.º 3
0
 /**
  * Creates a preview of a contest entry.
  *
  * @param 	string		$message
  * @param 	boolean		$enableSmilies
  * @param 	boolean		$enableHtml
  * @param 	boolean		$enableBBCodes
  * @return	string
  */
 public static function createPreview($message, $enableSmilies = 1, $enableHtml = 0, $enableBBCodes = 1)
 {
     $row = array('contestID' => 0, 'message' => $message, 'enableSmilies' => $enableSmilies, 'enableHtml' => $enableHtml, 'enableBBCodes' => $enableBBCodes, 'messagePreview' => true);
     require_once WCF_DIR . 'lib/data/contest/ViewableContest.class.php';
     $entry = new ViewableContest(null, $row);
     return $entry->getFormattedMessage();
 }
 /**
  * @see ViewableContest::getFormattedMessage()
  */
 public function getFormattedMessage()
 {
     return SearchResultTextParser::parse(parent::getFormattedMessage());
 }
 /**
  * @see ViewableContest::getFormattedMessage()
  */
 public function getFormattedMessage()
 {
     // replace relative urls
     $text = preg_replace('~(?<=href="|src=")(?![a-z0-9]+://)~i', PAGE_URL . '/', parent::getFormattedMessage());
     return StringUtil::escapeCDATA($text);
 }