PEAK XOOPS - Integrate non-D3 based module's comment with d3forum in englishin japanese

Integrate non-D3 based module's comment with d3forum

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 .2 | Posted on 2008/7/2 12:24
kololok  二等兵   Posts: 2
Hello,

I am on the half way to change my website's comment system to integrate with d3forum.
Everything goes smooth so far following the instruction and it seems like a good replacement of the default XOOPS comments system.

After the comment transfer to d3forum successfully, I notice there's a little difference in myAlbum's comment page.

For Example, in photos comment as below link, a table of Target, Subject and Summary are displayed with information of the target link.

http://xoops.peak.ne.jp/md/d3forum/index.php?topic_id=2198

But in the same place of my d3forum page, it only displays "target of the comment" link instead of the table.

In moment I find only D3 based module like pico can display the table, but non-D3 based modules just display the link.

How to make non-D3 based module like myAlbum-P display the table of Target, Subject and Summary just like photos comment here?
Votes:2 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2008/7/2 13:01 | Last modified
GIJOE  先任軍曹   Posts: 4110
hi kololok.

A good question!

Quote:

How to make non-D3 based module like myAlbum-P display the table of Target, Subject and Summary just like photos comment here?

This is an issue of "Comment Integration Class".

A sample class for myAlbum-P:

<?php

// a class for d3forum comment integration
class MyalbumD3commentPhotos extends D3commentAbstract {

function fetchSummary( $external_link_id )
{
	$db =& Database::getInstance() ;
	$myts =& MyTextsanitizer::getInstance() ;

	$module_handler =& xoops_gethandler( 'module' ) ;
	$module =& $module_handler->getByDirname( $this->mydirname ) ;

	$lid = intval( $external_link_id ) ;
	$mydirname = $this->mydirname ;
	if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ;

	// query
	$myrow = $db->fetchArray( $db->query( "SELECT l.lid AS id,l.title AS subject,t.description AS body,l.ext FROM ".$db->prefix("myalbum_photos")." l LEFT JOIN ".$db->prefix("myalbum_text")." t ON l.lid=t.lid WHERE l.lid=$lid" ) ) ;

	$body = str_replace( '&nbsp;' , '' , $myts->displayTarea( $myrow['body'] ) ) ;
	$body = function_exists('easiestml') ? easiestml( $body ) : $body ;

	return array(
		'dirname' => $mydirname ,
		'module_name' => $module->getVar( 'name' ) ,
		'subject' => $myts->makeTboxData4Show( $myrow['subject'] ) ,
		'uri' => XOOPS_URL.'/modules/'.$mydirname.'/photo.php?lid='.intval($myrow['id']) ,
		'summary' => '<img src="'.XOOPS_UPLOAD_URL.'/photos/'.intval($myrow['id']).'.'.htmlspecialchars($myrow['ext']).'" width="120" />' ,
	) ;
}

}

?>

- Add the class file into the class folder module.
eg) modules/myalbum/class/MyalbumD3commentPhotos.class.php

- edit the forum "Format for comment-integration"
eg) myalbum::MyalbumD3commentPhotos::


There are many comment-integration-classes for many modules (of course, not D3 modules also)

for piCal
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=5

for myAlbum-P
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=1

for mydownloads
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=8

for smartfaq
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=7

for xoopspoll
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=9

Many thanks to photositelinks!
Votes:9 Average:7.78
Previous post - Next post | Parent - No child | Posted on 2008/7/2 17:53
kololok  二等兵   Posts: 2
I follow your instruction on myAlbum-p and it works like a charm.
I'll keep on converting other non-D3 modules' comments to d3forum because it is very helpful for a large Xoops website to integrate and reorganize its comments.
Thank you for this smart solution.
Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!