Irish_Sniper Posted May 17, 2007 Share Posted May 17, 2007 I am using a wonderful calendar script from http://n0id.hexium.net/. Its for a website i'm making for my local swimming pool. What I want to be able to do is set for example Mondays timetable and have it repeat for a variable number of weeks, I have must of this done, but I am not sure if I am adding the days right and I am getting an ifinate loop. Heres the related snippet of code <? $noofweeks=$_POST['noofweeks']; $counter=1; $time=explode(":",$_POST['time']); $timestamp=mktime($time[0],$time[1],0,$_POST[month], $_POST[day], $_POST[year]); $event_text=nl2br($_POST[text]); if ($_POST[updating] == 1) { $total=mysql_num_rows(mysql_query("SELECT * FROM $calendar_table WHERE timestamp = '$timestamp'")); if ($total > 0) { mysql_query("UPDATE $calendar_table SET text = '$event_text' WHERE timestamp = '$timestamp'"); _e('Calendar event successfully updated!',''); } else { while ($counter < $noofweeks) { mysql_query("INSERT INTO $calendar_table VALUES('$timestamp','note','$event_text')"); $timestamp=mktime($time[0],$time[1],0,$_POST[month], $_POST[day] +7, $_POST[year]); $counter+1; } _e('Calendar event successfully added!' ,''); } } else { while ($counter < $noofweeks) { mysql_query("INSERT INTO $calendar_table VALUES('$timestamp','note','$event_text')"); $timestamp=mktime($time[0],$time[1],0,$_POST[month], $_POST[day] +7, $_POST[year]); $counter+1; } _e('Calendar event successfully added!' ,''); } Thanks in advance for any help you can give or if you would like more information, Donncha, Link to comment https://forums.phpfreaks.com/topic/51889-wordpress-plugin-modding-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.