Quote:
AsakuraStar wrote:
NewBB 2 v2.02
thought so, just wanted to make sure.
this is not complete but this is what i got so far
things in red is what i added and things in green are what needs to be finished still
xoops_version.php
$modversion['config'][] = array(
'name' => 'wol_mod_col',
'title' => '_MI_WOL_MOD_COL',
'description' => '_MI_WOL_MOD_COL_DESC',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => '#006600');
[color=CC0000]
$modversion['config'][] = array(
'name' => 'wol_thirdgroup_col',
'title' => '_MI_WOL_THIRDGROUP_COL',
'description' => '_MI_WOL_THIRDGROUP_COL_DESC',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => '#CC0000');
$modversion['config'][] = array(
'name' => 'wol_fourthgroup_col',
'title' => '_MI_WOL_FOURTHGROUP_COL',
'description' => '_MI_WOL_FOURTHGROUP_COL_DESC',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => '#0099FF');[/color]
language/english/main.php
[color=CC0000]define('_MD_THIRDGROUP','ThirdGroup');
define('_MD_FOURTHGROUP','FourthGroup');[/color]
language/english/modinfo.php
[color=CC0000]define("_MI_WOL_THIRDGROUP_COL","ThirdGroup Highlight Color");
define("_MI_WOL_THIRDGROUP_COL_DESC","Highlight Color of the ThirdGroup Shown in the ...");
define("_MI_WOL_FOURTHGROUP_COL","FourthGroup Highlight Color");
define("_MI_WOL_FOURTHGROUP_COL_DESC","Highlight Color of the FourthGroup Shown in the...");[/color]
index.php
if ($xoopsModuleConfig['wol_enabled']){
$online_handler =& xoops_getmodulehandler('online', 'newbb');
$online_handler->init();
$xoopsTpl->assign('online', $online_handler->show_online());
$xoopsTpl->assign('color_admin', $xoopsModuleConfig['wol_admin_col']);
$xoopsTpl->assign('color_mod', $xoopsModuleConfig['wol_mod_col']);
[color=CC0000]$xoopsTpl->assign('color_thirdgroup', $xoopsModuleConfig['wol_thirdgroup_col']);
$xoopsTpl->assign('color_fourthgroup', $xoopsModuleConfig['wol_fourthgroup_col']); [/color]
}
viewforum.php
if ($xoopsModuleConfig['wol_enabled']){
$online_handler =& xoops_getmodulehandler('online', 'newbb');
$online_handler->init($forum);
$xoopsTpl->assign('online', $online_handler->show_online());
$xoopsTpl->assign('color_admin', $xoopsModuleConfig['wol_admin_col']);
$xoopsTpl->assign('color_mod', $xoopsModuleConfig['wol_mod_col']);
[color=CC0000]$xoopsTpl->assign('color_thirdgroup', $xoopsModuleConfig['wol_thirdgroup_col']);
$xoopsTpl->assign('color_fourthgroup', $xoopsModuleConfig['wol_fourthgroup_col']);
[/color]
}
viewtopic.php
if ($xoopsModuleConfig['wol_enabled']){
$online_handler =& xoops_getmodulehandler('online', 'newbb');
$online_handler->init($viewtopic_forum, $forumtopic);
$xoopsTpl->assign('online', $online_handler->show_online());
$xoopsTpl->assign('color_admin', $xoopsModuleConfig['wol_admin_col']);
$xoopsTpl->assign('color_mod', $xoopsModuleConfig['wol_mod_col']);
[color=CC0000]$xoopsTpl->assign('color_thirdgroup', $xoopsModuleConfig['wol_thirdgroup_col']);
$xoopsTpl->assign('color_fourthgroup', $xoopsModuleConfig['wol_fourthgroup_col']); [/color]
}
templates/newbb_online.html
[ <span style="color:<{$color_admin}>"><{$smarty.const._MD_ADMINISTRATOR}>span> ] [ <span style="color:<{$color_mod}>"><{$smarty.const._MD_MODERATOR}>span> ][color=CC0000][ <span style="color:<{$color_thirdgroup}>"><{$smarty.const._MD_THIRDGROUP}>span> ] [ <span style="color:<{$color_fourthgroup}>"><{$smarty.const._MD_FOURTHGROUP}>span> ] [/color]
class/online.php (unfinished)
function &show_online()
{
global $xoopsModuleConfig, $forumImage;
if ($this->forumtopic)
$num_total = $this->getCount(new Criteria('online_topic', $this->forumtopic));
elseif ($this->forum)
$num_total = $this->getCount(new Criteria('online_forum', $this->forum));
else
$num_total = $this->getCount();
if ($this->forumtopic) {
$criteria = new CriteriaCompo(new Criteria('online_topic', $this->forumtopic));
$criteria->add(new Criteria('online_uid', '0', '<>'));
} elseif ($this->forum) {
$criteria = new CriteriaCompo(new Criteria('online_forum', $this->forum));
$criteria->add(new Criteria('online_uid', '0', '<>'));
} else {
$criteria = new Criteria('online_uid', '0', '<>');
}
$users = &$this->getAll($criteria);
$num_user = count($users);
$num_anonymous = $num_total - $num_user;
$online = array();
$online['image'] = newbb_displayImage($forumImage['whosonline']);
$online['num_total'] = $num_total;
$online['num_user'] = $num_user;
$online['num_anonymous'] = $num_anonymous;
for ($i = 0; $i < $num_user; $i++) {
$online['users'][$i]['link']= XOOPS_URL . "/userinfo.php?uid=" . $users[$i]['online_uid'];
$online['users'][$i]['uname']= $users[$i]['online_uname'];
if(newbb_isAdministrator($users[$i]['online_uid'])){
$online['users'][$i]['color']= $xoopsModuleConfig['wol_admin_col'];
}
elseif(newbb_isModerator($this->forum_object, $users[$i]['online_uid'])){
$online['users'][$i]['color']= $xoopsModuleConfig['wol_mod_col'];
}
[color=009900] /*
elseif(some function for the third group){
$online['users'][$i]['color']= $xoopsModuleConfig['wol_thirdgroup_col'];
}
elseif(some function for the 4th group){
$online['users'][$i]['color']= $xoopsModuleConfig['wol_fourthgroup_col'];
}
*/[/color]
else{
$online['users'][$i]['color']= "";
}
}
return $online;
}