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=2198But 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?
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( ' ' , '' , $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=5for myAlbum-P
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=1for mydownloads
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=8for smartfaq
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=7for xoopspoll
http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=9Many thanks to photositelinks!
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.