Page 1 of 1

[SOLVED] Integration Phoca Gallery 2.2.4 with JComments

Posted: 19 Jun 2009, 02:30
by era
1. For normal integration give the user the ability to choice of comment system ( We have democracy in Russia now :D ):
In Phoca config file -
config.xml,
if Phoca Gallery installed - /administrator/components/com_phocagallery/config.xml
Change:

Code: Select all

		<param name="display_comment" type="list" default="0" label="Display Comment" description="Display Comment DESC">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
to:

Code: Select all

		<param name="display_comment" type="list" default="0" label="Display Comment" description="Display Comment DESC">
			<option value="0">No</option>
			<option value="1">Yes, built-in Phoca</option>
			<option value="2">Yes, use JComments (if installed)</option>
		</param>

2. In category template file -
category/tmpl/default.php
in "com_phocagallery_v2.2.4.zip" - front/views/category/tmpl/default.php
if Phoca Gallery installed - /components/com_phocagallery/views/category/tmpl/default.php
Change:

Code: Select all

		if ((int)$this->tmpl['displaycomment'] == 1) {
			echo $pane->startPanel( JHTML::_( 'image.site', 'components/com_phocagallery/assets/images/icon-comment.'.$this->tmpl['formaticon'],'', '', '', '', '') . '&nbsp;'.JText::_('Comments'), 'comments' );
			echo $this->loadTemplate('comments');
			echo $pane->endPanel();
		}
To:

Code: Select all

		if ((int)$this->tmpl['displaycomment'] == 1) {
			echo $pane->startPanel( JHTML::_( 'image.site', 'components/com_phocagallery/assets/images/icon-comment.'.$this->tmpl['formaticon'],'', '', '', '', '') . '&nbsp;'.JText::_('Comments'), 'comments' );
			echo $this->loadTemplate('comments');
			echo $pane->endPanel();
		} elseif ((int)$this->tmpl['displaycomment'] == 2) {
			echo $pane->startPanel( JHTML::_( 'image.site', 'components/com_phocagallery/assets/images/icon-comment.'.$this->tmpl['formaticon'],'', '', '', '', '') . '&nbsp;'.JText::_('Comments'), 'comments_jc' );
			echo '<div id="phocagallery-comments">';
			echo '<div style="font-size:1px;height:1px;margin:0px;padding:0px;">&nbsp;</div>';//because of IE bug
			$comments = JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
			if (is_file($comments)) {
				require_once($comments);
				echo JComments::showComments($this->category->id, 'com_phocagallery', $this->category->title);
			}
			echo '</div>';
			echo $pane->endPanel();
		}

3. If your version of JComments lower then 2.1.0 (2.1.0 currently RC version, current public version 2.0.0.x) - copy attachment to this message plugin (unzip first) to directory "/components/com_jcomments/plugins".
This plugin built-in to JComments 2.1.0.x

4. In Phoca Gallary params select "Yes, use JComments (if installed)" for "Display Comment"

5. Test and write this.


With Best Regards, joomlatune.com/joomlatune.ru

P.S> Tested on Joomla 1.5.10 / Phoca Gallery 2.2.4 / JComments 2.0.0.x - JComments 2.1.0 RC

Re: [SOLVED] Integration Phoca Gallery 2.2.4 with JComments

Posted: 19 Jun 2009, 09:22
by caro84g
Hi everyone,

On the Dutch Joomladays I went to a presentation about template overrides. Jan follows the MVC principle as far as I can see, so instead of editing the phocagallery component, you can create a template override. The advantage of this is that when you update phoca gallery you don't lose your changes.

In this example:
2. In category template file -
category/tmpl/default.php
in "com_phocagallery_v2.2.4.zip" - front/views/category/tmpl/default.php
if Phoca Gallery installed - /components/com_phocagallery/views/category/tmpl/default.php
Change:
--- code etc ---
You could apply the changes to a template override:
copy the file 'default.php' from /components/com_phocagallery/views/category/tmpl/ to /templates/your_template/html/phocagallery/category/ and make the changes there.
Sildes in English of the Dutch Joomladays presentation about template overrides: http://www.slideshare.net/hans2103/joom ... -overrides

Regards, Carolien

Re: [SOLVED] Integration Phoca Gallery 2.2.4 with JComments

Posted: 08 Aug 2009, 12:23
by pixelsurfer
Fatal error: Call to a member function load() on a non-object in /var/www/vhosts/*********.at/htdocs/libraries/joomla/user/user.php on line 597

Re: [SOLVED] Integration Phoca Gallery 2.2.4 with JComments

Posted: 20 Aug 2009, 04:18
by Randal
Yes, this solution doesn't work with Joomla 1.5.14 and Phoca 2.5.6
I have the same problem as pixelsurfer After login... (Community Builder)

Re: [SOLVED] Integration Phoca Gallery 2.2.4 with JComments

Posted: 28 Aug 2009, 16:43
by DaSilva
Is there a current solution for Joomla 1.5.14 with Phoca Gallery 2.5.7 and JComments 2.1.0.0?
Thanks!

Re: [SOLVED] Integration Phoca Gallery 2.2.4 with JComments

Posted: 11 Oct 2009, 20:43
by Jan
Great, thank you for this info as this can be helpful for others.

Jan