romenyrr Posted April 22, 2008 Share Posted April 22, 2008 Greetings All, I'm trying to modify this really SIMPLE calendar and I need some pointers. This little mini calendar displays all the events for that day in links. Now what I want is just for that day to be highlighted (already have a css class for that) so I can click on the day and it displays all the events for that day. Heres the code thats spits out all of the events for that day on the calendar itself; again, i'm trying to have none of the events show up on the mini-calendar itself. All i want is for me to be able to click the day and have it spit out all the events for that day. hope that makes sense lol : IF(isset($events[$i])){ echo "<div align=\"left\"><span class=\"highlighteddayboxes\">\n"; while (list($key, $value) = each ($events[$i])) { echo "<a href=\"javascript:MM_openBrWindow('cal/event.php?id=$value','','width=500,height=200');\">Events</a>\n<br>\n"; } echo "</span></div>\n"; } echo "</td>\n"; Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/ Share on other sites More sharing options...
romenyrr Posted April 22, 2008 Author Share Posted April 22, 2008 The overall Calendar code <? for ($i = 1; $i <= $first_day_of_month-1; $i++) { $days_so_far = $days_so_far + 1; $count_boxes = $count_boxes + 1; echo "<td width=\"100\" height=\"25\" class=\"beforedayboxes\"></td>\n"; } for ($i = 1; $i <= $days_in_month; $i++) { $days_so_far = $days_so_far + 1; $count_boxes = $count_boxes + 1; IF($_GET['month'] == $todays_month+1){ IF($i == $todays_date){ $class = "highlighteddayboxes"; } ELSE { $class = "dayboxes"; } } ELSE { IF($i == 1){ $class = "highlighteddayboxes"; } ELSE { $class = "dayboxes"; } } echo "<td width=\"100\" height=\"25\" class=\"$class\">\n"; $link_month = $_GET['month'] - 1; echo "<div align=\"right\"><span class=\"toprightnumber\">\n$i</a> </span></div>\n"; IF(isset($events[$i])){ echo "<div align=\"left\"><span class=\"$class\">\n"; while (list($key, $value) = each ($events[$i])) { echo "<a href=\"javascript:MM_openBrWindow('cal/event.php?id=$value','','width=500,height=200');\">Events</a>\n<br>\n"; } echo "</span></div>\n"; } echo "</td>\n"; IF(($count_boxes == 7) AND ($days_so_far != (($first_day_of_month-1) + $days_in_month))){ $count_boxes = 0; echo "</TR><TR valign=\"top\">\n"; } } $extra_boxes = 7 - $count_boxes; for ($i = 1; $i <= $extra_boxes; $i++) { echo "<td width=\"100\" height=\"25\" class=\"afterdayboxes\"></td>\n"; } $time_end = getmicrotime(); $time = round($time_end - $time_start, 3); ?> </tr> </table></td> </tr> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/#findComment-523672 Share on other sites More sharing options...
romenyrr Posted April 22, 2008 Author Share Posted April 22, 2008 *bump* Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/#findComment-523965 Share on other sites More sharing options...
romenyrr Posted April 23, 2008 Author Share Posted April 23, 2008 *bump* Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/#findComment-525124 Share on other sites More sharing options...
Spaceman-Spiff Posted April 23, 2008 Share Posted April 23, 2008 So, which part of it doesn't work? What's the output like? Maybe you can try using !empty() instead of isset(). Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/#findComment-525138 Share on other sites More sharing options...
romenyrr Posted April 24, 2008 Author Share Posted April 24, 2008 hmmm, it still displays the events. http://agobor.com/gblive/cal/ ; any other suggestions? i'm still fairly new to php, but i thought it might have to do something with: IF(!empty($events[$i])){ echo "<div align=\"left\"><span class=\"$class\">\n"; while (list($key, $value) = each ($events[$i])) { echo "<a href=\"javascript:MM_openBrWindow('cal/event.php?id=$value','','width=500,height=200');\">Events</a>\n<br>\n"; } echo "</span></div>\n"; The while section Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/#findComment-525629 Share on other sites More sharing options...
Spaceman-Spiff Posted April 24, 2008 Share Posted April 24, 2008 Err, don't make it print the event then... remove the whole while loop. And you can change the div to clickable (javascript onclick), make it to direct the user to a new page, and list the events there. Link to comment https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/#findComment-526488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.