Jcomments import failed

General Forum
pokerwithjoker
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 23 Nov 2009, 04:20

Jcomments import failed

Post by pokerwithjoker »

Hi Jan,

I am a huge fan of Phoca. Recently I installed Jcomments and while I tried to import I get this message: Data importing failed. Please contact to developer.

I am using:
JComments 2.1.0.0 [07/08/2009]
Phoca 2.6.0 Alpha 2

Thank you.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Jcomments import failed

Post by Jan »

Hi, what you mean with importing. I don't have any experiences with this? As there is a new feature in Phoca Gallery 2.6.0 (displaying JComments comments), from where should be the comments imported (as there were no previous version to import/export them)?

Maybe it is because we still working on this implementation (there were changes between alpha and beta because Phoca Gallery uses category and image commenting)

For Phoca Gallery you need to have JComments Phoca Gallery Plugin files, see:
Phoca Gallery JComments Files
https://www.phoca.cz/download/category/1 ... -component
If you find Phoca extensions useful, please support the project
pokerwithjoker
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 23 Nov 2009, 04:20

Re: Jcomments import failed

Post by pokerwithjoker »

Hi Jan,

Thanks for the reply. I meant in
Jcomments>import comments>PhocaGallery comments>import

then I get an error messenge: Data importing failed. Please contact to developer.

Please advice.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Jcomments import failed

Post by Jan »

Hi, no idea there, maybe you should ask on jcomments forum, maybe this is a problem of not stable plugins which were changed :idea:
If you find Phoca extensions useful, please support the project
arch66
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 24 Mar 2009, 04:00

Re: Jcomments import failed

Post by arch66 »

Hi, had the same problem importing comments from Phoca. Look for the Phoca import function in the admin.jcomments.migration.php in the administrator/components/com_jcomments folder and change the following:

$query = "SELECT c.*"
. "\n, u.id, u.email, u.name, u.username "
. "\nFROM #__phocagallery_comments AS c"
. "\nLEFT JOIN #__users AS u ON c.userid = u.id "
;

$comment->date = $row->date;

Great integration Jan, thanks
arch66
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 24 Mar 2009, 04:00

Re: Jcomments import failed

Post by arch66 »

Jan, now we're talking on Jcomment integration, would it be an idea to turn of the other j-script when external comment system is used? Something like:

// COMMENTS
if ((int)$tmpl['displaycomment'] == 1 && (int)$tmpl['externalcommentsystem'] == 0) {
$document->addScript(JURI::base(true).'/components/com_phocagallery/assets/js/comments.js');
$document->addCustomTag(PhocaGalleryRenderFront::renderCommentJS((int)$tmpl['maxcommentchar']));

$tmpl['alreadycommented'] = PhocaGalleryCommentCategory::checkUserComment( (int)$id, (int)$user->id );
$commentItem = PhocaGalleryCommentCategory::displayComment( (int)$id );

$this->assignRef( 'commentitem', $commentItem);
}


You might have a better solution!
Thanks
pokerwithjoker
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 23 Nov 2009, 04:20

Re: Jcomments import failed

Post by pokerwithjoker »

Hi,

Thank you for the reply.

Just to make it clearer.

Do I change:

$query = "SELECT c.*"

. "\n, u.id, u.email, u.name, u.username "

. "\nFROM #__paxxcomments AS c"

. "\nLEFT JOIN #__users AS u ON c.userid = u.id "

;

to


$query = "SELECT c.*"
. "\n, u.id, u.email, u.name, u.username "
. "\nFROM #__phocagallery_comments AS c"
. "\nLEFT JOIN #__users AS u ON c.userid = u.id "
;


$comment->date = $row->date;
arch66 wrote:Hi, had the same problem importing comments from Phoca. Look for the Phoca import function in the admin.jcomments.migration.php in the administrator/components/com_jcomments folder and change the following:

$query = "SELECT c.*"
. "\n, u.id, u.email, u.name, u.username "
. "\nFROM #__phocagallery_comments AS c"
. "\nLEFT JOIN #__users AS u ON c.userid = u.id "
;

$comment->date = $row->date;

Great integration Jan, thanks
arch66
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 24 Mar 2009, 04:00

Re: Jcomments import failed

Post by arch66 »

Hehehe, not sure where you are! I thought you wanted to import your phoca gallery comments.

Now you're at the pax_comment table! Don't know a thing about that.

To import Phoca comments you have to scroll down to the Phoca import function.

Put a #__ before phocagallery_comments.

Like:

$query = "SELECT c.*"
. "\n, u.id, u.email, u.name, u.username "
. "\nFROM #__phocagallery_comments AS c"
. "\nLEFT JOIN #__users AS u ON c.userid = u.id "
;

Then change this line: $comment->date = strftime( "%Y-%m-%d %H:%M:%S", $row->date);

To: $comment->date = $row->date;

That's all
pokerwithjoker
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 23 Nov 2009, 04:20

Re: Jcomments import failed

Post by pokerwithjoker »

OMG.
It is working perfectly now! Thanks a lot! :D
Post Reply