Bon ben j'ai réussi à créer mon plugin xhnewbb...
<?php
function b_BopComments_xhnewbb($maxtopic, $module_mid) {
//----------------------------------------------
// if you want to show Private forum's Comments.
// please $private_bb = true;
// if you not want to show praivate forum's Comments.
// please $private_bb = false;
$private_xhnewbb = TRUE;
//----------------------------------------------
// View mode (thread or flat) get from user details
$userSetting = TRUE;
//----------------------------------------------
global $xoopsUser;
$comment = array();
$xoopsDB =& Database::getInstance();
if ( $private_xhnewbb == TRUE && $xoopsUser ) {
$uid = $xoopsUser->uid();
$pu_SQL = "SELECT forum_id FROM ".
$xoopsDB->prefix("xhnewbb_forum_access").
" WHERE user_id=".$uid;
if ( !$pu_query = $xoopsDB->query($pu_SQL) ) echo "Error! (xhnewbb)";
while ($pu_result= $xoopsDB->fetchArray($pu_query)) {
$forum[] = $pu_result['forum_id'];
}
}
if ( !count($forum)==0 ) {
$SQL = "SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies, t.forum_id, f.forum_name, p.post_time, p.uid FROM (".
$xoopsDB->prefix("xhnewbb_topics")." t LEFT JOIN ".
$xoopsDB->prefix("xhnewbb_forums")." f ON t.forum_id=f.forum_id) LEFT JOIN ".
$xoopsDB->prefix("xhnewbb_posts")." p ON t.topic_last_post_id=p.post_id ".
"WHERE (f.forum_type <> 1) OR (f.forum_id IN (".implode(", ", $forum).") AND t.forum_id IN (".implode(", ", $forum).") AND f.forum_type=1) ".
"ORDER BY t.topic_time DESC";
} else {
$SQL = "SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies, t.forum_id, f.forum_name, p.post_time, p.uid FROM (".
$xoopsDB->prefix("xhnewbb_topics")." t LEFT JOIN ".
$xoopsDB->prefix("xhnewbb_forums")." f ON t.forum_id=f.forum_id) LEFT JOIN ".
$xoopsDB->prefix("xhnewbb_posts")." p ON t.topic_last_post_id=p.post_id ".
"WHERE (f.forum_type <> 1) ".
"ORDER BY t.topic_time DESC";
}
if ( !$query = $xoopsDB->query($SQL, $maxtopic, 0) ) echo "Error! (xhnewbb)";
while ( $result = $xoopsDB->fetchArray($query) ) {
$key = BopComments_KeyCheck($comment, $result['post_time']);
$comment[$key]['moduleimg'] = XOOPS_URL."/modules/BopComments/plugin/image/newbb.gif";
$comment[$key]['modulelink'] = XOOPS_URL."/modules/xhnewbb/index.php";
$comment[$key]['placelink'] = XOOPS_URL."/modules/xhnewbb/viewforum.php?forum=".$result['forum_id'];
$comment[$key]['place'] = $result['forum_name'];
$comment[$key]['topiclink'] = XOOPS_URL."/modules/xhnewbb/viewtopic.php?forum=".$result['forum_id']."&topic_id=".$result['topic_id'];
$comment[$key]['topic'] = $result['topic_title'];
$comment[$key]['user'] = $result['uid'];
$comment[$key]['read'] = $result['topic_views'];
$comment[$key]['reply'] = $result['topic_replies'];
$comment[$key]['date'] = $result['post_time'];
}
return $comment;
}
?>
Le hic, c'est que tout les titres des modules sont décalés vers le bas...
???