Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.