Topic: Never more than 1 user in 'online' table - what did I mess up now?
I've made lots of changes to use PunBB registration for my entire site. Everything works fine, but in the list 'registered users online' there's never more than one name.
In a clean test install when I log in on a second laptop the second name shows up at 'online'. When I check in MySQL both logged in users are in the 'online' table.
I can't get that to work in my customized site.
Which code should I check? What code puts the entries in the 'online' table? Is there code that makes sure names are added to that table and don't replace the name that's already there?
edit:
In login.php I only see the online table mentioned here:
// Remove this users guest entry from the online list
$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
$expire = ($save_pass == '1') ? time() + 31536000 : 0;
pun_setcookie($user_id, $form_password_hash, $expire);
redirect(htmlspecialchars($_POST['redirect_url']), $lang_login['Login redirect']);
}
else if ($action == 'out')
{
if ($pun_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $pun_user['id'])
{
header('Location: index.php');
exit;
}
// Remove user from "users online" list.
$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id']) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
It's all about 'removing' from the online table, not 'adding'! WTF?
edit2:
Could my problem have something to do with this at the top of my index.php page?
define('PUN_QUIET_VISIT', 1);
define('PUN_ALLOW_INDEX', 1);
I thought I needed those lines for files outside regular PunBB, but removing them doesn't seem to have any effect either way...