Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: Integration with Ice Gallery?
Pages: [1]   Go Down
  Print  
Author Topic: Integration with Ice Gallery?  (Read 3585 times)
0 Members and 1 Guest are viewing this topic.
Igather
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« on: December 19, 2010, 18:20:45 »

Hi!

I am just trying the ice gallery component, which seems really nice:

http://www.icegallery.info/

On the Jcomments release notes (here) it is said:

Integration with third-party extensions

The following plugins to provide integration with third-party extensions are added:

...
Ice Gallery
...


So my question, I can't find any plugin which integrates Ice Gallery? Nor has the ice gallery an option to integrate an another comment system?

I know there is mentioned also that there is the possibility to import the comments from ice gallery,but as I quoted before, there should also be a possibility to use Jcomments in Ice Gallery instead the gallery own comment system.

Or did I understand something wrong?

Thank you for any answers!
Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #1 on: December 20, 2010, 18:30:15 »

I mean that JComments distributive has special plugin for support ICE Gallery (it allows building correct links to ICE Gallery images and getting image title). But I didn't make any step-by-step manual for ICE Gallery integration. In my mind this is quite easy and users can do this themselves.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Igather
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #2 on: December 20, 2010, 21:18:10 »

Thank you very much!

Did I understand you right, there is a special plugin already integrated in the newest version of JComments?

So, it is possible to use JComments instead of the Ice Gallery comment system?

I have  never modified JComments or similar comment systems, but other Joomla Components, maybe you have a help link or documentation where to start?
Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #3 on: December 20, 2010, 22:31:51 »

I've no free time to install ICE Gallery and test but this must work...

Open file /components/com_ice/view.php and replace code:

Code: (php)
  // Display comments-form for input of comments, if comments are allowed of course...
   // The Edit-Monitor registers the user input and does not allow him/ her to add a comment again
   // that session.

// ======================================= Comments ================================
   if ($icenv->cfg['commentsOn']) {
$ice->createCheckAllScript(); ?>
<script language="Javasript" type="text/javascript">
<!--
function submitForm(theTask,cmtid){
document.MM_returnValue = true;
if (theTask=='clear') {
document.commentmgr.elements['textfilter'].value = '';
document.commentmgr.elements['creatorfilter'].value = '';
if (document.commentmgr.elements['publishfilter']) document.commentmgr.elements['publishfilter'].value = 0;
if (document.commentmgr.elements['previewfilter']) document.commentmgr.elements['previewfilter'].value = 0;
document.commentmgr.elements['task'].value = '';
} else {
if (theTask=='writecmt') MM_validateForm('uname','','R','comment','','R');
document.commentmgr.elements['task'].value = theTask;
document.commentmgr.elements['cmtid'].value = cmtid;
}
if (document.MM_returnValue) document.commentmgr.submit();
return false;
}
function newPage(page){
document.commentmgr.elements['CmtPageNo'].value = page;
document.commentmgr.submit();
return false;
}
//-->
</script>
<form name="commentmgr" action="<?php echo $icenv->sefRelToAbs($url_prefix);?>" method="post">
<input type="hidden" name="task" value="" />
<input type="hidden" name="cmtid" value="0" />
<?php
$creatorfilter $icenv->getParam($_REQUEST,'creatorfilter');
$textfilter $icenv->getParam($_REQUEST,'textfilter');
$publishfilter $icenv->getParam($_REQUEST,'publishfilter');
$previewfilter $icenv->getParam($_REQUEST,'previewfilter');
$empty = &new comment(); $edit false;
$filters = array($creatorfilter,$textfilter,$publishfilter,0,$previewfilter);
$empty->display($m_img->_id,false,$edit,$filters,0,$cmtpg,$pglen,$icenv->cfg['cmtperpage']);
  
?>

<input type="hidden" name="CmtPageNo" value="<?php echo $cmtpg;?>" />
<input type="image" src="<?php echo $icenv->live."/components/com_ice/images/spacer.gif"?>" />
</form>
   <?php
   }
with
Code: (php)
  if ($icenv->cfg['commentsOn']) {
$comments = JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($m_img->_id, 'com_ice', $m_img->_name);
}
   }

Open file /components/com_ice/classes/image.class.php
Replace code:
Code: (php)
function getNumOfComments($list=true) {
global $icenv;
if ($list) return count($this->_comments);
$publ = $icenv->ident->_admin?'':' published = 1 AND ';
$icenv->db->setQuery("SELECT count(cmtid) FROM #__ice_comments WHERE$publ imgid = ".$this->_id);
$result = $icenv->db->query();
if ($result!==FALSE) {
$row = mysql_fetch_row($result);
if ($row!==FALSE) return $row[0];
}
return 0;
}
with
Code: (php)
function getNumOfComments($list=true) {
global $icenv;
$icenv->db->setQuery("SELECT count(*) FROM #__jcomments WHERE object_group='ice' and object_id = ".$this->_id);
return $icenv->db->loadResult();
}


Open file /component/com_ice/galleryshow.php
Delete line:
Code: (php)
$image->getComments(false);

Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Igather
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #4 on: December 21, 2010, 02:17:13 »

Thank you very much!

I think its some never version that I have here?

The component is named com_icegallery, the version is: Ice Gallery 0.7 beta 1


In the view.php I could not find the code you posted, there was no such commented text, and I tried to search for the first functions, but they all looked very different from which you found.



The /components/com_icegallery/classes/image.class.php function looks bit different from which you posted:

Code:
function getNumOfComments($list=true) {
if ($list) return count($this->_comments);
$publ = icenv::$ident->_admin?'':' published = 1 AND ';
icenv::$db->setQuery("SELECT count(cmtid) FROM #__ice_comments WHERE$publ imgid = ".$this->_id);
$result = icenv::$db->query();
if ($result!==FALSE) {
$row = mysql_fetch_row($result);
if ($row!==FALSE) return $row[0];
}
return 0;
}

In the galleryshow.php there was no such line
Code:
$image->getComments(false);
, nor in the whole sourcecode of the component, but I found
Code:
getComments(false)

in
\components\com_icegallery\classes\image.class.php
Code:
Line 696: $gallery->getComments(false);
Line 699: $this->getComments(false);
and
\components\com_icegallery\xml4flash.php
Code:
Line 80: $img->getComments(false); $cmt = $img->_comments[0];
Line 124: $gal->getComments(false); $cmt = $gal->_comments[0];


I'd be happy to try your code, I have the newest version installed on xampp!!!
Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #5 on: December 21, 2010, 02:38:13 »

I think its some never version that I have here?
I don't remember what version I have modified (I've downloaded it from joomlacode.org)

Attach here your version or give me link there I can download same version as you've.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Igather
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #6 on: December 21, 2010, 03:40:02 »

Thank you, here you are:

I downloaded it from here:

http://www.icegallery.info/downloads/joomla/0.7beta1/component/

The version I have is "Ice Gallery for new installation"

Logged
Igather
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #7 on: December 21, 2010, 14:32:01 »

I just got answer about the new version of ice gallery! I hope I express it right.

There is a problem, the ice gallery allows comments on albums and pictures

This is the code to call the jcomments:

JComments::showComments($m_img->_id, 'com_ice', $m_img->_name);

With a call like this there is no possibility to differ the album and the img ID, for example both can have the id 1.

A possible solution would be

    JComments::showComments($m_img->_id, 'com_icegallery_media', $m_img->_name);

    for media and

    JComments::showComments($album->_id, 'com_icegallery_albums', $album->_name);

    for albums

But this would need 2 JComment plugins, one for album and another for pictures.

Maybe you have a solution for this?

Thank you and sorry if there are mistakes, I am far from a professional joomla coder, just tried to translate the email!
Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #8 on: December 21, 2010, 15:09:18 »

But this would need 2 JComment plugins, one for album and another for pictures.
You're completely right. This is more correct way.

Maybe you have a solution for this?
Not, yet Wink I'll try to made it.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Igather
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #9 on: December 27, 2010, 03:41:28 »

Thank you very much, cant wait to see it!  Cheesy

If I can help in some way, testing or something, would be happy!
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: Integration with Ice Gallery?
 
Jump to: