Log in

View Full Version : need strikes count global


ManuelW
03-15-2014, 02:05 PM
Hey,

i want to hide any login forms on my board (vb 3.8) if the max strike count is reched (5).

For this i need the strike count global on my board. but it is only on the login page. I try'd to write it into a session var, but this only on the login page available.

Can someone help me with this?

regards
Manuel

kh99
03-22-2014, 09:06 PM
Sorry for the late reply, if you're still working on this, I think you could use code like this:

$strikes = $vbulletin->db->query_first("
SELECT COUNT(*) AS strikes, MAX(striketime) AS lasttime
FROM " . TABLE_PREFIX . "strikes
WHERE strikeip = '" . $vbulletin->db->escape_string(IPADDRESS) . "'
");

if ($strikes['strikes'] >= 5 AND $strikes['lasttime'] > TIMENOW - 900)
{
// This ip address currently has 5 strikes (against any username).
// Do something here
}



So you could put that in a plugin, maybe using hook global_start, and set a variable to be checked in a template or something like that.