Styles2304 Posted June 7, 2009 Share Posted June 7, 2009 The coding: if ($EventData[$i][$EventSelect]['TBD']) { $EventEOD .=<<<EOD <div class="$Class"> <div class="roundcorner_small_tl"><img src="images/calendar/round_corner_small.png" alt=""></div> <div class="roundcorner_small_tr"><img src="images/calendar/round_corner_small.png" alt=""></div> <div class="roundcorner_small_bl"><img src="images/calendar/round_corner_small.png" alt=""></div> <div class="roundcorner_small_br"><img src="images/calendar/round_corner_small.png" alt=""></div> <font class="event"><a href="index.htm" onclick="return hs.htmlExpand(this)" class="tbd">$DisplayTitle</a> <div class="highslide-maincontent"> <font class="$Class" style="font-weight: bold; font-size: 14px;"> $Title <br> </font> $Date <br> <br> $Description </div> </font><br> </div> EOD; The Explanation If an event is entered into the database with no designated time, it is marked as TBD which then wraps the event text in a div as opposed to just plain text - it's a blatant rip off of the google calendar and how a scheduled event looks if it's an "all day event". The Problem: If I have more than 2 TBD events on the same day, only two of the div'd events will display. The third will simply not process as weird as it sounds. I thought, initially, that it was hidden somewhere given the delicate nature of divs but if I view the source, it is no where to be found. Any ideas? Note: here's the problem page: omega.clanhqhosting.net/~jami/calendar.php There is actually a "Testing 1" on the 7th that should be displayed right along with "Special Olympics" and "Testing 3". Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/ Share on other sites More sharing options...
Andy-H Posted June 7, 2009 Share Posted June 7, 2009 if ($EventData[$i][$EventSelect]['TBD']) { is $i generated by a for loop??? Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-850765 Share on other sites More sharing options...
Philip Posted June 7, 2009 Share Posted June 7, 2009 You're going to have to show more, including the loop as Andy-H asked about. Everything in the HEREDOC looks correct to me, so it's probably a problem with your loop. Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-850770 Share on other sites More sharing options...
Styles2304 Posted June 7, 2009 Author Share Posted June 7, 2009 //Calendar Build Begins Here $EventEOD =''; $EventEOD .=<<<EOD <div class="c2"> <table width="784px" cellspacing="0" cellpadding="0" border="0"> <tr> EOD; for ($i = 1; $i < $numDays + 1; $i++, $counter++) { $timeStamp = strtotime("$year-$month-$i"); if ($i == 1) { //Figures out when the first day of the month is $firstDay = date("w",$timeStamp); //Checks day of the week for first day. for($j = 0; $j < $firstDay; $j ++, $counter++) { $EventEOD .=<<<EOD <td width="110px" height="103px" valign="top" align="center"> </td> EOD; } } if(($counter % 7 == 0) && ($counter != 0)) { $rowcount++; $EventEOD .=<<<EOD </tr> <tr> EOD; } if (($i == date("j")) && ($month == date("m")) && ($year == date("Y"))) { $EventEOD .=<<<EOD <td width="110px" height="103px" valign="top" align="center"> <div class="date_header_today"> <div class="roundcorner_small_tl_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> <div class="roundcorner_small_tr_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> <font class="days_today">$i</font> </div> EOD; } else { $EventEOD .=<<<EOD <td width="110px" height="103px" valign="top" align="center"> <div class="date_header"> <div class="roundcorner_small_tl_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> <div class="roundcorner_small_tr_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> <font class="days">$i</font> </div> EOD; } if ($EventData[$i]) { $EventEOD .=<<<EOD <div class="date"> <div class="roundcorner_small_bl_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> <div class="roundcorner_small_br_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> EOD; for ($EventCount = 0; ($EventCount <= count($EventData[$i]['EventCount']) - 1) && $EventCount < 4; $EventCount++) { $EventSelect = $EventData[$i]['EventCount'][$EventCount]; $Class = $EventData[$i][$EventSelect]['Class']; $DisplayTitle = $EventData[$i][$EventSelect]['DisplayTitle']; $Title = $EventData[$i][$EventSelect]['Title']; $Date = date('l\, F jS', mktime(0, 0, 0, $EventData[$i][$EventSelect]['EMonth'], $EventData[$i][$EventSelect]['EDay'], $EventData[$i][$EventSelect]['EYear'])); $Time = $EventData[$i][$EventSelect]['FullTime']; $Description = $EventData[$i][$EventSelect]['Description']; if ($EventData[$i][$EventSelect]['TBD']) { $EventEOD .=<<<EOD <div class="$Class"> <div class="roundcorner_small_tl"><img src="images/calendar/round_corner_small.png" alt=""></div> <div class="roundcorner_small_tr"><img src="images/calendar/round_corner_small.png" alt=""></div> <div class="roundcorner_small_bl"><img src="images/calendar/round_corner_small.png" alt=""></div> <div class="roundcorner_small_br"><img src="images/calendar/round_corner_small.png" alt=""></div> <font class="event"><a href="index.htm" onclick="return hs.htmlExpand(this)" class="tbd">$DisplayTitle</a> <div class="highslide-maincontent"> <font class="$Class" style="font-weight: bold; font-size: 14px;"> $Title <br> </font> $Date <br> <br> $Description </div> </font><br> </div> EOD; } else { $EventEOD .=<<<EOD  <font class="event"><a href="index.htm" onclick="return hs.htmlExpand(this)" class="$Class">$DisplayTitle</a> <div class="highslide-maincontent"> <font class="$Class" style="font-weight: bold; font-size: 14px;"> $Title <br> </font> $Date <br> $Time <br> <br> $Description </div> </font><br> EOD; } } $EventEOD .=<<<EOD </div></td> EOD; } else { $EventEOD .=<<<EOD <div class="date"> <div class="roundcorner_small_bl_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> <div class="roundcorner_small_br_2"><img src="images/calendar/round_corner_small_blue.png" alt=""></div> </div></td> EOD; } } $EventEOD .=<<<EOD </tr> </table> </div> </div> </div> EOD; That should pretty much cover anything. Also, I did a dump of $EventData just to make sure that all of the data was being retrieved from the database and it was. Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-850783 Share on other sites More sharing options...
Andy-H Posted June 7, 2009 Share Posted June 7, 2009 for ($EventCount = 0; ($EventCount <= count($EventData[$i]['EventCount']) - 1) && $EventCount < 4; $EventCount++) { $EventSelect = $EventData[$i]['EventCount'][$EventCount]; //blah blah... if ($EventData[$i][$EventSelect]['TBD']) { if ( isSet ($EventSelect['TBD']) ) { //??? } Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-850786 Share on other sites More sharing options...
Ken2k7 Posted June 7, 2009 Share Posted June 7, 2009 for ($EventCount = 0; ($EventCount <= count($EventData[$i]['EventCount']) - 1) && $EventCount < 4; $EventCount++) { What's the point of the && $EventCount < 4? Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-850810 Share on other sites More sharing options...
Styles2304 Posted June 7, 2009 Author Share Posted June 7, 2009 for ($EventCount = 0; ($EventCount <= count($EventData[$i]['EventCount']) - 1) && $EventCount < 4; $EventCount++) { $EventSelect = $EventData[$i]['EventCount'][$EventCount]; //blah blah... if ($EventData[$i][$EventSelect]['TBD']) { if ( isSet ($EventSelect['TBD']) ) { //??? } This didn't change anything, for ($EventCount = 0; ($EventCount <= count($EventData[$i]['EventCount']) - 1) && $EventCount < 4; $EventCount++) { What's the point of the && $EventCount < 4? It limits the amount of events displayed in each cell. Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-850939 Share on other sites More sharing options...
Ken2k7 Posted June 7, 2009 Share Posted June 7, 2009 Okay, well if you take out that condition, does everything you want displayed get displayed? Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-851040 Share on other sites More sharing options...
Styles2304 Posted June 7, 2009 Author Share Posted June 7, 2009 No, it doesn't. Sort of a relief since that means I wrote at least that part of the code accurately. It seems to only have a problem when it's the TBD events like I said earlier. If they're regularly scheduled events, they work and display fine. Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-851074 Share on other sites More sharing options...
Styles2304 Posted June 7, 2009 Author Share Posted June 7, 2009 I take that back . . . it seems to be acting funky period. However, none of these problems surfaced until the TBD chunk of the code was added and without it, things function as intended. Link to comment https://forums.phpfreaks.com/topic/161229-solved-php-heredoc-appear-to-not-process-all-divs/#findComment-851077 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.