JComments

Integration of JComments to zOOm Media Gallery

zOOm Media Gallery — is excellent gallery component for Joomla. But the built-in comment system has limited possibilities. The offered to your attention integration is inteneded to replace the built-in comment system by JComments.

  1. Open file /components/com_zoom/www/view.php
  2. Find lines:
        if ($zoom->_CONFIG['commentsOn']) {
          $prefix = ZMG_Template_View::createViewBlock(_ZOOM_COMMENTS);
          
          ZMG_Template_View::showCommentsBox($zoom->_CONFIG['viewtype'], $dir_prefix, $key);
          
          if (($zoom->_CONFIG['anonymous_comments']) || (!$zoom->_CONFIG['anonymous_comments'] && !empty($my->username))){
            if ($zoom->_CONFIG['popUpImages']) {
              $cmt_action = $url_prefix;
            } else {
              $cmt_action = sefRelToAbs($url_prefix);
            }
            ZMG_Template_View::showCommentsForm($zoom->_CONFIG['viewtype'], $cmt_action, $dir_prefix, $popup, $key);
          }
          ZMG_Template_View::finishViewBlock($zoom->_CONFIG['comments_state'], $prefix);
        } //END if commentsOn? 
    and replace with:
        if ($zoom->_CONFIG['commentsOn']) {
          global $mosConfig_absolute_path;
          $comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
          if (file_exists($comments)) {
            require_once($comments);
            $obj_id = $zoom->_gallery->_images[$key]->_id;
            $obj_title = $zoom->_gallery->_images[$key]->_name;
            echo JComments::showComments($obj_id, 'com_zoom', $obj_title);
          }
        } //END if commentsOn? 
  3. Open file/components/com_zoom/lib/template/template.gallery.php
  4. Find lines:
                if ($zoom->_CONFIG['commentsOn']) {
                    // Adding comment-notification, eg. show a pic with last comment-author and date as alt-text.
                    if ($mycom = $image->_comments[count($image->_comments)-1]) {
                        $inforow .= "\t\t<img border=\"0\" src=\"".$mosConfig_live_site."/components/com_zoom/www/images/comment.png\" onmouseover=\"return overlib('".$mycom->getName()." (".$mycom->getDate()."):
    ".$mycom->getCommentOrig()."', CAPTION, '"._ZOOM_COMMENTS."');\" onmouseout=\"return nd();\" alt=\"\" />= ".$image->getNumOfComments();
                        
                        if ($zoom->_CONFIG['showHits']) {
                            $inforow .= ", ";
                        }
                    }
                }
    and replace with:
                if ($zoom->_CONFIG['commentsOn']) {
                      global $mosConfig_absolute_path;
                      $comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
                      if (file_exists($comments)) {
                      require_once($comments);
                      $comments = JComments::getCommentsCount($image->_id, 'com_zoom');
                      }
                      if ($comments) {
                        $comment = JComments::getLastComment($image->_id, 'com_zoom');
                        $inforow .= "\t\t<img border=\"0\" src=\"".$mosConfig_live_site."/components/com_zoom/www/images/comment.png\" onmouseover=\"return overlib('".$comment->name." (".$comment->date."):
    ".$comment->comment."', CAPTION, '"._ZOOM_COMMENTS."');\" onmouseout=\"return nd();\" alt=\"\" />= ".$?omments;
                        
                          if ($zoom->_CONFIG['showHits']) {
                              $inforow .= ", ";
                          }
                      }
                }

See also:

 
JoomlaTune