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: JComments Plugin for JoomGallery
Pages: [1] 2   Go Down
  Print  
Author Topic: JComments Plugin for JoomGallery  (Read 21764 times)
0 Members and 1 Guest are viewing this topic.
Chraneco
Newbie
*

Karma: 0
Offline Offline

Posts: 5


« on: August 24, 2010, 18:50:17 »

Hi,

At first let me introduce myself: I'm one of the developers of JoomGallery.

We recently published a new version of our component and also a new version of the JoomJComments module and the plugin JoomJComments.

For this we adapted the plugin which is already included in your JComments package in order to be ready for the new JoomGallery version. It is attached to this post. Please feel free to check it and include it into your next release.

With this plugin and the module JoomJComments which you may download here you will be able to comment on images as well as on categories of JoomGallery.

It would be very kind of you if you mentioned the integration possibility with the help of our module in your integration article, too.

Regards
Chraneco

* com_joomgallery.plugin.php (3.06 KB - downloaded 752 times.)
« Last Edit: August 25, 2010, 19:56:51 by smart » Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #1 on: August 25, 2010, 13:52:50 »

I'm not sure about this code:

Code: (php)
    // Category owner
    if($id == 900000000)
    {
      $id = $id - 900000000;
      $db->setQuery('SELECT owner FROM #__joomgallery_catg WHERE cid = ' . $id);
      $userid = $db->loadResult();
      return intval($userid);
    }

if id is equal to 900000000, then $id = $id = 900000000 will be equal to 0... always...

BTW, why you're decide to use one plugin for images and categories? In this case it more usable to have 2 plugins (as we've made for phocagallery). You could leave com_joomgallery.plugin.php for images and created additional com_joomgallery_categories.plugin.php for cateogories. In this case you will not needed to use any calculations with ID in plugin's code.

Regarding integration manual - I'll be very appreciated if you'll wrote it and send me. I'll pulbish it on our site with links to your site and module.
Logged

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

Karma: 0
Offline Offline

Posts: 5


« Reply #2 on: August 25, 2010, 19:52:43 »

Hi,

you are completely right, the line should be

Code:
if($id > 900000000)

instead of

Code:
if($id == 900000000)

That was a typing error of mine.

I created the module for JComments more than a year ago. I wasn't aware of that there could be more than one plugin for one component because somewhere I read about this.

Now it may be too late to change that without additional effort. We would have to edit the database entries for JoomGallery  in the table of JComments in order to not remove the category comments on the users' sites. Do you see an easy possibility for that in JComments?

You are right that this behavior would be much easier for all of us, so hopefully we are able to find a good solution.

I will write an entry for your integration manual and send it to you via PM.

Regards
Chraneco
« Last Edit: August 25, 2010, 20:09:48 by Chraneco » Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #3 on: August 25, 2010, 19:56:26 »

You could to make simple update query that will update all existing comments. Something like this:

Code: (sql)
update `jos_jcomments`
set object_id = object_id - 900000000, object_group = 'com_joomgallery_category'
where object_id >  900000000 and object_group = 'com_joomgallery';

That's all. It will replace IDs for all comments what left to categories.
Logged

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

Karma: 0
Offline Offline

Posts: 5


« Reply #4 on: August 25, 2010, 20:08:11 »

Hi,

alright, I hoped that there was a possibility to integrate such a query within the migration script of JComments, but I think the users will have to do that manually.

For now the current behavior should work for everyone, we will think about the new one later. It would be very kind of you if you include the above attached plugin into your next release of JComments.

Regards
Chraneco
Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #5 on: August 26, 2010, 01:10:21 »

If you want I could include such script in upcoming JComments version. Also we could made anounce about this change and publish it at our sites. All users who will update JComments or your module would have this script executed.
Logged

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

Karma: 0
Offline Offline

Posts: 5


« Reply #6 on: August 29, 2010, 18:09:19 »

Hi,

it would be very kind of you if you included this update query into your update script, thank you!

Could you please inform us when you are going to release the next version of JComments? This way we will be able to offer the updates of our extensions on the same day.

I have detected another problem: With our module it was also possible to leave comments for the whole category (special case 'id = 999999999'). So you would have to add an additional query like the following afore the other one (or maybe it's possible to integrate it into the other one):

Code: (sql)
update `jos_jcomments`
set object_id = 1, object_group = 'com_joomgallery_gallery'
where object_id = 999999999 and object_group = 'com_joomgallery';

I have created the three necessary plugins for that and attached them to this post as well as a suggestion for the integration manual.

Regards
Chraneco

* com_joomgallery.plugin.php (1.81 KB - downloaded 642 times.)
* com_joomgallery_categories.plugin.php (1.84 KB - downloaded 450 times.)
* com_joomgallery_gallery.plugin.php (1.82 KB - downloaded 500 times.)
* integration_manual.txt (1.22 KB - downloaded 895 times.)
« Last Edit: August 29, 2010, 18:11:38 by Chraneco » Logged
Stefan
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« Reply #7 on: September 03, 2010, 00:19:20 »

Hello

I would like this plugin enable "only" in the details (Pics) - not in the categories! What do I have here?

Thank you

Stefan
Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #8 on: September 14, 2010, 00:47:43 »

@Chraneco: I've implemented such update function:

Code: (php)
    function updateJoomGallery()
    {
        $db = & JFactory::getDBO();

        $query = "SELECT COUNT(*) FROM `#__jcomments` WHERE object_id > 900000000 AND object_group = 'com_joomgallery'";
        $db->setQuery($query);
        $countComments = $db->loadResult();

        if ($countComments > 0) {
            $query = "UPDATE `#__jcomments`"
                    . " SET object_id = 1, object_group = 'com_joomgallery_gallery'"
                    . " WHERE object_id = 999999999 AND object_group = 'com_joomgallery';";
            $db->setQuery($query);
            $db->query();
           
            $query = "UPDATE `#__jcomments`"
                    . " SET object_id = object_id - 900000000, object_group = 'com_joomgallery_category'"
                    . " WHERE object_id >  900000000 AND object_group = 'com_joomgallery';";
            $db->setQuery($query);
            $db->query();
        }
    }

Seems it is correct... All attached plugins already included into development build.

Could you please inform us when you are going to release the next version of JComments? This way we will be able to offer the updates of our extensions on the same day.
Of course! I'll inform you for 1-2 days before...
Logged

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

Karma: 0
Offline Offline

Posts: 5


« Reply #9 on: September 15, 2010, 04:51:47 »

Hi,

thank you very much!
We are looking forward to the new JComments version.

@Stefan: Please read this article for that.

Regards
Chraneco
Logged
neojunior
Newbie
*

Karma: 0
Offline Offline

Posts: 1


« Reply #10 on: October 05, 2010, 03:59:55 »

I tried using Jcomments! but is caused so much trouble i had to remove it.. specifically to the editor.php file, i could no longer edit articles via the back end..   Cry
Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #11 on: October 05, 2010, 13:53:48 »

specifically to the editor.php file, i could no longer edit articles via the back end..   Cry
why? what trouble do you have?
Logged

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

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #12 on: October 22, 2010, 14:45:51 »

@Chraneco: I've implemented such update function:

Code: (php)
    function updateJoomGallery()
    {
        ....
           
            $query = "UPDATE `#__jcomments`"
                    . " SET object_id = object_id - 900000000, object_group = 'com_joomgallery_category'"
                    . " WHERE object_id >  900000000 AND object_group = 'com_joomgallery';";

           ...
        }
    }


Hi,

I have integrated the 3 plugins attached in a previous post. There is a slight mistake either in the plugin name or in the script quoted above. The object_group must match the plugin name (com_joomgalleries != com_joomgallery).

In addition, for these plugins to be actually called, the mod_joomjcom module must be modified like this:

Code: (php)
$view = JRequest::getCmd('view');
switch($view)
{
  case 'detail':
    $id     = JRequest::getInt('id');
    $title  = '';
    $groupname = "com_joomgallery";
    break;
  case 'category':
    $id     = JRequest::getInt('catid');
    $title  = '';
    $groupname = "com_joomgallery_categories";
    break;
  case '':
    $id     = 1;
    $title  = JText::_('JGA_GALLERY');
    $groupname = "com_joomgallery_gallery";
   break;
  default:
    return;
    break;
}

$comments = JPATH_ROOT.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if(file_exists($comments))
{
  require_once($comments);
  echo JComments::showComments($id, $groupname, $title);
}
else
{
  echo 'JComments is not installed';
}

Eric.
Logged
BBC
Full Member
***

Karma: 6
Offline Offline

Posts: 100



« Reply #13 on: October 30, 2010, 17:30:02 »

In Category view i can`t get number of comments. In Gallery view i get Comments: 0.
All latest versions, all done regarding description at Joomgallery site.
Logged
EricL
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #14 on: October 30, 2010, 17:51:38 »

I don't display comments count so I didn't bother to patch this part. A quick look shows that the joomjcom plugin must also be modified in onJoomAfterDisplayCatThumb() to count comments for com_joomgallery_categories, and $id must not be added 900000000.

The count for images comments should work unchanged. I don't know why it would say zero for you....

Eric
Logged
Pages: [1] 2   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: JComments Plugin for JoomGallery
 
Jump to: