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 ? Link to comment https://forums.phpfreaks.com/topic/97793-wait-for-next-post/ 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. Link to comment https://forums.phpfreaks.com/topic/97793-wait-for-next-post/#findComment-500345 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"); } } Link to comment https://forums.phpfreaks.com/topic/97793-wait-for-next-post/#findComment-500462 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>"; } Link to comment https://forums.phpfreaks.com/topic/97793-wait-for-next-post/#findComment-500513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.