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!