Ejemplo n.º 1
0
     //date_default_timezone_set ( "Europe/Berlin");
     $now = time();
     // current unixtime
     $posttime = mktime($hour, $minute, 0, $month, $day, $year);
     // unixtime from post date
     $isUserEditable = true;
     // get editTime in minutes from global parameters
     $editTime = $params->get('editTime', '30');
     if ($now - $posttime > $editTime * 60) {
         $isUserEditable = false;
     }
     $editForever = $params->get('editForever', '1');
     if ($editForever == 1) {
         $isUserEditable = true;
     }
     if ($logUser->isModerator() || $logUser->getId() == $CofiUser->getId() && $isUserEditable == true) {
         echo "<div class='cofiPostMenuItem'>";
         echo "<div class='cofiPostMenuIcon'>";
         echo "<img src='" . $_root . "components/com_discussions/assets/threads/edit.png' />";
         echo "</div>";
         echo "<div class='cofiPostMenuText'>";
         echo "<div class='cofiPostMenuLinks'>";
         $menuLinkEditTMP = "index.php?option=com_discussions&view=posting&task=edit&catid=" . $this->categorySlug . "&thread=" . $this->thread . "&parent=" . $posting->id . "&id=" . $posting->id;
         $menuLinkEdit = JRoute::_($menuLinkEditTMP);
         echo "<a href='" . $menuLinkEdit . "'>" . JText::_('COFI_EDIT') . "</a>";
         echo "</div>";
         echo "</div>";
         echo "</div>";
     }
 } else {
     echo "<div class='cofiPostMenuItem'>";