<?php require_once(XOOPS_TRUST_PATH.'/modules/d3forum/include/comment_functions.php'); $dirname = "d3forum"; $forum_id = "2"; $post_title = get_the_title(); $params = array("dirname" => $dirname, "forum_id" => $forum_id, "itemname" => "p", "subject" => $post_title); ?> <div id="comments"> <?php d3forum_display_comment( $dirname , $forum_id , $params ) ; ?> </div>
$number = $commentHandler->getCount($criteria); }
require_once(XOOPS_TRUST_PATH.'/modules/d3forum/include/comment_functions_2.php'); $number = d3forum_display_comment_topicscount ( $GLOBALS['dirname'] , $GLOBALS['forum_id'] , $GLOBALS['params'] ) ;
$comments_popup_link .= comments_number($zero, $one, $more, $number, false);
$dirname = "d3forum"; $forum_id = "2"; $params = array("dirname" => $dirname, "forum_id" => $forum_id, "link_id" => $wp_post_id);
<?php comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS); ?>
(2007-07-04追記)
(2007-06-13追記)
<?php
function d3forum_display_comment_topicscount_2( $mydirname , $forum_id , $params , $mode = 'post' )
{
global $xoopsUser , $xoopsConfig ;
$mydirpath = XOOPS_ROOT_PATH.'/modules/'.$mydirname ;
$mytrustdirpath = dirname( dirname( __FILE__ ) ) ;
$db =& Database::getInstance() ;
// external_link_id
if( ! empty( $params['link_id'] ) ) {
$external_link_id = $params['link_id'] ;
} else if( ! empty( $params['itemname'] ) ) {
$external_link_id = @$_GET[ $params['itemname'] ] ;
} else {
echo "set valid link_id or itemname in the template" ;
return ;
}
if( empty( $external_link_id ) ) return ;
// check the d3forum exists and is active
$module_hanlder =& xoops_gethandler( 'module' ) ;
$module =& $module_hanlder->getByDirname( $mydirname ) ;
if( ! is_object( $module ) || ! $module->getVar('isactive') ) {
return ;
}
// check permission of "module_read"
$moduleperm_handler =& xoops_gethandler( 'groupperm' ) ;
$groups = is_object( $xoopsUser ) ? $xoopsUser->getGroups() : array( XOOPS_GROUP_ANONYMOUS ) ;
if( ! $moduleperm_handler->checkRight( 'module_read' , $module->getVar( 'mid' ) , $groups ) ) {
return ;
}
$select = $mode == 'topic' ? 'COUNT(t.topic_id)' : 'SUM(t.topic_posts_count)' ;
$sql = "SELECT $select FROM ".$db->prefix($mydirname."_topics")." t WHERE t.forum_id=$forum_id AND ! t.topic_invisible AND topic_external_link_id='".addslashes($external_link_id)."'" ;
if( ! $trs = $db->query( $sql ) ) die( 'd3forum_comment_error in '.__LINE__ ) ;
list( $count ) = $db->fetchRow( $trs ) ;
// echo intval( $count ) ;
return intval( $count ) ;
}
?>以上で、何とか動いています。
| Page Info | |
|---|---|
| Page Name : | サイト更新記録/2007-06-09 |
| Page aliases : | None |
| Page owner : | gokuraku |
| Can Read | |
| Groups : | All visitors |
| Users : | All visitors |
| Can Edit | |
| Groups : | No one |
| Users : | No one |
新しくコメントをつける
コメント一覧