balkan7 Posted March 25, 2008 Share Posted March 25, 2008 hi can someone example me how to create code for users can send post whit time, like after 30 min can send new post before cannot send ? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted March 25, 2008 Share Posted March 25, 2008 Whenever they post log the time in a datetime field. Then whenever they post again check if it's been 30 minutes since the time in the database, which would be the time of their last post. Quote Link to comment Share on other sites More sharing options...
balkan7 Posted March 25, 2008 Author Share Posted March 25, 2008 ok i got this one how to check date now? $result = dbquery("SELECT * FROM ".$db_prefix."zelbi WHERE korisnik='".$userdata['user_name']."'"); $find = numrows($result); if ($find != 0){ while ($row = dbarray($result)){ $date = date("d-m-Y", $row['date']); $now = date("d-m-Y"); } } Quote Link to comment Share on other sites More sharing options...
balkan7 Posted March 25, 2008 Author Share Posted March 25, 2008 i find solution but now need write minuts for next avilable post. code: for inseting time in db i used $date = time() + 1800; $result = dbquery("SELECT * FROM ".$db_prefix."zelbi WHERE korisnik='".$userdata['user_name']."' ORDER BY id DESC LIMIT 0,1"); $find = dbrows($result); if ($find != 0){ $row = dbarray($result); $check_date = date("d-m-Y H:i:s", $row['date']); $now = date("d-m-Y H:i:s"); if ($now < $check_date){ $expire = $check_date - $now; echo "<div align='center'>".$locale['040'].$expire."</div>"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.