You are very welcome!
In fact, it helped me to reduce the code of my version (with its easy and safely to use test mode) for more than 70 lines... Now my version has only 155 lines at the moment (but haven't fully tested it yet...)
But now to something different which should also affect the original version of this MOD:
trigger_error does not work properly for me in
Code: Select all
// Save the user from pointing to a file that does not exist
and
Code: Select all
// Save the user from setting the timer too low
Obviously I do not get my stylesheet (no .css file gets "parsed" in my Firefox 3), and there are other displaying errors (like not parsed language variables), too.
It's not dangerous but it looks quite ugly.
Therefore I changed trigger_error(...) to
and
Code: Select all
exit('$dead_man_days must be 7 or more');
Do you have the same problem with using trigger_error in deadman.php?
Regards
Wolfgang
BTW: I had to purge the cache again after installing the new version. (At the moment I'm doing all testing regarding this MOD with phpMyAdmin opened and looking carefully at phpbb_config.)
Martin wrote:This way we won't have to do any additional database queries at all!
I think we still will need
one additional query when deadman.php gets started for the
very first time? From my code:
Code: Select all
// Initialize database
if (!isset($config['dead_man_status']))
{
$sql = 'SELECT user_lastvisit
FROM ' . USERS_TABLE . '
WHERE user_id = ' . DEAD_MAN_USER;
$result = $db->sql_query($sql);
$letzter_login = $db->sql_fetchfield('user_lastvisit');
$db->sql_freeresult($result);
(DEAD_MAN_TEST) ? set_config('dead_man_status', 'test', true) : set_config('dead_man_status', 'not_alerted', true);
set_config('dead_man_last_visit', $letzter_login, true);
}
BTW: I'm not sure about the lines
Code: Select all
$result = $db->sql_query($sql);
$letzter_login = $db->sql_fetchfield('user_lastvisit');
$db->sql_freeresult($result);
They are working well but when I get $letzter_login from $db->sql_fetchfield('user_lastvisit'), do I really need line 1 and 3, too?