Pm limit per day in lava
Started on the old forum in July 2011 · view the original in the archive · old links redirect here
You have many solution. I'll show you one method.
add a col in _users , pmstoday int(3) in _settings last_cron int(10)
// in inboxproc.php
$info = mysql_fetch_object(mysql_query("SELECT `pmstoday` FROM `ibwf_users` WHERE `id`='$uid'"));
if ($info->pmstoday <= 100) // 100 - max pms in one day
{
// send pm code
mysql_query("UPDATE `ibwf_users` SET `pmstoday`=`pmstoday`+1 WHERE `id`='$uid'");
}
else
{
echo 'Bla bla bla errors.';
}
// index.php maybe core.php (if you have mysql instance declarated)
$sett = mysql_fetch_oject(mysql_query("SELECT `value` FROM `ibwf_settings` WHERE `name`='last_cron'"));
if ($sett->value < time())
{
mysql_query("UPDATE `ibwf_users` SET `pmstoday`='0'");
mysql_query("UPDATE `ibwf_settings` SET `value`='".time()."' WHERE `name`='last_cron'");
}
<?php unlink('World/Europe/Romania.country'); ?>