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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: yvComment importation of comments
Pages: [1]   Go Down
  Print  
Author Topic: yvComment importation of comments  (Read 10538 times)
0 Members and 1 Guest are viewing this topic.
YvonSteel
Guest
« on: January 05, 2009, 15:42:10 »

I'm sorry for my last post, I was not in the good forum  Sad

I began to do an implementation of the importation of comments made by yvComments (http://yurivolkov.com/Joomla/yvComment/index_en.html) and I would like to have your advice. I changed only the admin.jcomments.migration.php file.

function updateCount modified :

Code:
function UpdateCount()

{
$db = & JCommentsFactory::getDBO();
if ($this->table != "#__yvcomment") {

$db->setQuery('SELECT COUNT(*) FROM ' . $this->table );

} else {
$db->setQuery('SELECT count( #__content.id ) FROM #__content, #__sections WHERE #__sections.alias=\'comments\' AND #__content.sectionid=#__sections.id');
}

$this->count = $db->loadResult();
}


Add

Code:
case 'yvcomment':
$cnt = JCommentsMigrationTool::importYvComment();

break;
in the doImport function

add this function next to the others

Code:
function importYvComment() {


$db = & JCommentsFactory::getDBO();

$db->setQuery("DELETE FROM #__jcomments WHERE source = 'yvcomment'");

$db->query();


$db->setQuery("SELECT #__content.id, #__content.fulltext, #__content.created_by, #__content.created_by_alias, #__content.parentid, #__content.created FROM #__content, #__sections WHERE #__sections.alias='comments' AND #__content.sectionid=#__sections.id");
$rows = $db->loadObjectList();

foreach( $rows as $row) {

$comment = new JCommentsDB( $db );

$comment->object_id = $row->parentid;
$comment->source = 'yvcomment';
$comment->userid = $row->created_by;
$comment->parent = 0;
$comment->name = JCommentsMigrationTool::processName( $row->created_by_alias );

$comment->username = JCommentsMigrationTool::processName( ($row->username != '' ? $row->username : $row->created_by_alias) );
$comment->published = 1;

$comment->date = $row->created;
$comment->object_group = "com_content";


$comment->comment = JCommentsMigrationTool::processComment( $row->fulltext);
$comment->lang = JCommentsInput::getParam($_POST, $comment->source . '_lang', '');

$user = null;

$query = "SELECT * FROM #__users WHERE email='$row->email' AND name='$row->name'";

$db->setQuery( $query );



if (JCOMMENTS_JVERSION == '1.5') {

$config = &JFactory::getConfig();



if($config->getValue('config.legacy')) {

$db->loadObject( $user );

} else {

$user = $db->loadObject();

}

} else {

$db->loadObject( $user );

}



if ( $user != null ) {

$comment->userid = $user->id;

}



$comment->store();

}

$db->setQuery("SELECT COUNT(*) FROM `#__jcomments` WHERE `source`= 'yvcomment'");

return $db->loadResult();

}


and finally add this to showImport in the class HTML_JCommentsMigrationTool

Code:
$CommentSystems[] = new JOtherCommentSystem(

'yvcomment'

, 'yvComment'

, 'Yuri Volkov'

, ''

, ''

, 'http://yurivolkov.com/'

, '#__yvcomment'

);

Logged
lambas
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #1 on: September 24, 2009, 20:44:07 »

any news on this 1??

i love this component but now i have to find a way to transfer my yv comments  Cry
Logged
smart
Administrator
Hero Member
*****

Karma: 146
Offline Offline

Gender: Male
Posts: 2579



WWW
« Reply #2 on: September 24, 2009, 21:04:18 »

Sorry I forgot about this. I'll see this code in few days and try to include this functional to the next release. If you could help me with testing of this function - please write me PM.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
smart
Administrator
Hero Member
*****

Karma: 146
Offline Offline

Gender: Male
Posts: 2579



WWW
« Reply #3 on: September 26, 2009, 02:18:23 »

This feature implemented. If somebody can help me with test - please, write me PM
Logged

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

Karma: 0
Offline Offline

Posts: 8


« Reply #4 on: September 26, 2009, 12:20:15 »

hello my friend !!
i dont have any coding knowledge but i will be happy to help if i can ... to test or something  Smiley Smiley

Ill be free all the afternoon today Smiley
Logged
smart
Administrator
Hero Member
*****

Karma: 146
Offline Offline

Gender: Male
Posts: 2579



WWW
« Reply #5 on: September 26, 2009, 13:03:46 »

Ill be free all the afternoon today Smiley
check PM for link to test version...
Logged

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

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #6 on: December 07, 2009, 20:59:10 »

I've cheked YvonSteel hack but it doesn't work... It does not sees the yvcomments component comments. I'm not a programmer but I've chiecked both comments in the article table and in their own table. In both cases it does not read the comments. If there is a already done script please send it to me so I can test it. Thx in advance.
Logged
smart
Administrator
Hero Member
*****

Karma: 146
Offline Offline

Gender: Male
Posts: 2579



WWW
« Reply #7 on: December 07, 2009, 21:23:42 »

schrill, check PM... and report me about import results, please...
Logged

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

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #8 on: December 13, 2009, 18:22:34 »

Hello,

I have the same pb, I need ti import my comments from yvcomment, how can I do??
Logged
genuk
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #9 on: February 08, 2010, 21:36:30 »

Hi...can I also test the implementation?

Seem that is not already implemented in the JComments 2.1.0.0 ?

Thank in advance

Eugen
Logged
teejay
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #10 on: February 10, 2010, 23:23:32 »

hi,
can i help?

i need also the migration script... can i test it also?


thank you.
Logged
scept1c
Newbie
*

Karma: -1
Offline Offline

Gender: Male
Posts: 12



« Reply #11 on: February 19, 2010, 14:17:29 »

will the results be posted here?
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: yvComment importation of comments
 
Jump to: