Pm limit per day in lava

Started on the old forum in July 2011 · view the original in the archive · old links redirect here

1 reply · 442 views · started 15 years ago · 1 min read

2 participants
i0nutzxp Developer · 150 posts #2

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'); ?>

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close