JComments

Integration of JComments to Remository file archive

Remository — is a popular file archive component for Joomla. The offered to your attention integration is inteneded to replace the built-in comment system by JComments.

Integration with Remository 3.53.5

  1. Open file /components/com_remository/v-classes/remositoryFileInfoHTML.php
  2. Find there the line:
        if ($this->repository->Allow_Comments) {
          $commentsdb = remositoryComment::getComments($file->id);
          if ($commentsdb){
            $this->tabcnt = 1;
            $legend = _DOWN_COMMENTS;
            foreach ($commentsdb as $comment) {
              $this->showComment($legend, $comment);
              // Uncomment the next line if you want to restrict to a single comment
              // if ($comment->userid == $this->remUser->id) $hascommented = true;
            }
          }
          else {
            $legend = $this->remUser->isLogged() ? _DOWN_FIRST_COMMENT : _DOWN_FIRST_COMMENT_NL;
            $this->fileOutputBox('', '<strong>'.$legend.'</strong>');
          }
          if ($this->remUser->isLogged() AND empty($hascommented)) $this->commentBox($file);
    //      include_once('components/com_reviews/reviews.class.php');
    //      include_once('components/com_reviews/reviews.html.php');
    //      echo HTML_reviews::listItemCommentsHTML('com_remository',$file->id);
    //      echo HTML_reviews::solicitCommentHTML('com_remository', $file->id, "&func=fileinfo&id=$file->id");
        }
    and replace with following:
        if ($this->repository->Allow_Comments) {
        $commentsAPI = JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
        if (file_exists($commentsAPI)) {
          require_once($commentsAPI);
          echo JComments::showComments($file->id, 'com_remository', $file->filetitle);
          }
        }

Integration with Remository 2.x

  1. Open file /components/com_remository/v-classes/remositoryFileInfoHTML.php
  2. Find there the line:
      $commentsdb = $file->getComments();
      if ($commentsdb){
        $this->tabcnt = 1;
        $legend = _DOWN_COMMENTS;
        foreach ($commentsdb as $comment) $this->showComment($legend, $comment);
      }
      else {
        $legend = $this->remUser->isLogged() ? _DOWN_FIRST_COMMENT : _DOWN_FIRST_COMMENT_NL;
        $this->fileOutputBox('', '<strong>'.$legend.'</strong>');
      }
      if ($this->remUser->isLogged()) $this->commentBox($file);
    and replace them with following:
      global $mosConfig_absolute_path;
      $comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
      if (file_exists($comments)) {
        require_once($comments);
        echo '<div style="clear: both;">';
        echo JComments::showComments($file->id, 'com_remository', $file->filetitle);
        echo '</div>';
      }

See also:

 
JoomlaTune