Il y a sans doute un problème dans ton code mais je ne sais pas où : quand j'upload mon fichier
system_blocks il ne me reste plus qu'une page blanche en guise de page d'accueil...
Aucune erreur d'aucune sorte, juste une page blanche.
Voici la fameuse fonction une fois modifiée :
function b_system_online_show()
{
global $xoopsUser, $xoopsModule;
$online_handler =& xoops_gethandler('online');
mt_srand((double)microtime()*1000000);
// set gc probabillity to 10% for now..
if (mt_rand(1, 100) < 11) {
$online_handler->gc(300);
}
if (is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid');
$uname = $xoopsUser->getVar('uname');
} else {
$uid = 0;
$uname = '';
}
if (is_object($xoopsModule)) {
$online_handler->write($uid, $uname, time(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
} else {
$online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']);
}
$onlines =& $online_handler->getAll();
if (false != $onlines) {
$total = count($onlines);
$block = array();
$guests = 0;
$members = '';
for ($i = 0; $i < $total; $i++) {
if ($onlines[$i]['online_uid'] > 0) {
$members .= ' <a href="'.XOOPS_URL.'/userinfo.php?uid='.$onlines[$i]['online_uid'].'">'.$onlines[$i]['online_uname'].'</a>,';
} else {
$guests++;
}
}
$block['online_total'] = sprintf(_ONLINEPHRASE, $total);
if (is_object($xoopsModule)) {
$mytotal = $online_handler->getCount(new Criteria('online_module', $xoopsModule->getVar('mid')));
$block['online_total'] .= ' ('.sprintf(_ONLINEPHRASEX, $mytotal, $xoopsModule->getVar('name')).')';
}
$block['lang_members'] = _MEMBERS;
$block['lang_guests'] = _GUESTS;
$block['online_names'] = $members;
$block['online_members'] = $total - $guests;
$block['online_guests'] = $guests;
$block['lang_more'] = _MORE;
$block['online_module'] = "";
$module_handler =& xoops_gethandler('module');
$installed_mods =& $module_handler->getObjects();
foreach ( $installed_mods as $module ) {
if ($module->getVar('dirname') != 'system') {
$online_module = $online_handler->getCount(new Criteria('online_module', $module->getVar('mid') ));
$name_module = strip_tags( $myts->makeTboxData4Show($module->getVar('name', 'E')) );
if ($online_module != 0) {
if ( strlen( $name_module ) > 14 ) {
$block['online_module'] .= substr( $name_module , 0 , 14) . ". -> " . $online_module . "<br>";
} else {
$block['online_module'] .= $name_module . " > " . $online_module . "<br>";
}
}
}
}
return $block;
} else {
return false;
}
}
Merci de ton aide,
@+