Jump to content

Styles2304

Members
  • Posts

    208
  • Joined

  • Last visited

    Never

About Styles2304

  • Birthday 03/29/1986

Contact Methods

  • AIM
    Styles2304
  • Website URL
    http://www.newcovenant-th.org/

Profile Information

  • Gender
    Male

Styles2304's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. 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.
  2. 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.
  3. This didn't change anything, It limits the amount of events displayed in each cell.
  4. //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">&#160;</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 &#160;<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.
  5. 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".
  6. I had a calendar full of echos that got rather sloppy so I upgraded to a heredoc to improve readability and upgradability. However, when i did that, the code fell apart. I've done some debugging and have narrowed it down to this chunk right here: 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"> <font class="days_today">$i</font> </div> EOD; } else { $EventEOD .=<<<EOD <td width="110px" height="103px" valign="top" align="center"> <div class="date_header_today"> <font class="days">$i</font> </div> EOD; } If I remove the if statement and choose one chunk of code or the other to execute, the calendar works fine. It's all in the if statement but i don't see anything wrong. Any ideas?
  7. Yes it is, look closely. Right after "checked", I close the php tag and then close the input tag. I'm trying to trigger the function right there . . . that's what I'm asking for help with. The function is defined in a seperate file and loaded in the head but I don't know how to trigger it.
  8. I'm populating a form and, in the process, trying to show/hide certain divs based on whether or not certain radio buttons are marked as checked. Am I missing something that is causing the toggleDisplay code being called by the PHP to not execute? <input type="radio" name="Mil_Status" value="ETS" onclick="toggleDisplay('show', 'Mil_FromTo', 'main'); toggleDisplay('hide', 'Mil_Serving', 'main'); toggleDisplay('hide', 'Mil_Discharge', 'main');" <?php if ($Mil_Status == 'ETS') { echo 'Checked'; ?>> <?php echo "<script type='text/javascript'>toggleDisplay('show', 'Mil_FromTo', 'main'); toggleDisplay('hide', 'Mil_Serving', 'main'); toggleDisplay('hide', 'Mil_Discharge', 'main');</script>"; } ?> ETS or Retired <br>
  9. . . . No. `black_arku` is the database reference `BonusInfo` is the table. If you notice in the create, there are 3 fields: IndexNo, Bonus, and History. Anyone else have any ideas?
  10. Here's the code I ran to setup my DB table: BonusInfo CREATE TABLE `black_arku`.`BonusInfo` (`IndexNo` SMALLINT NOT NULL ,`Bonus` TEXT NOT NULL ,`History` TEXT NOT NULL ,INDEX ( `IndexNo` )); And then here is the insert statement I'm trying to execute but I'm getting a syntax error: INSERT INTO `black_arku` . `BonusInfo` VALUES (1, '0', '0'); Is there something I'm missing?
  11. Ok, not exactly sure why but for some reason, the query statement isn't being filled out. The error is caused by the fact that I'm trying to pass a query that is basically empty. So, here's the error: Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 with query UPDATE `About Us` SET Now here's the code immediately arround it. I'm kind of at a loss, it seems to me that things are setup most likely sloppy but in a way that should work. <?php $BlockCount = 1; $BlockName = 'Block'; $query = "UPDATE `" . $_SESSION['Title'] . "` SET "; while ($BlockCount <= $_NumberOfBlocks) { $BlockName = 'Block'; $BlockName = $BlockName . $BlockCount; $FontColor = $_POST[$BlockName . 'FontColor']; $IncludeInNav = $_POST[$BlockName . 'IncludeInNav']; $DisplayNav = $_POST[$BlockName . 'DisplayNav']; $BlockTitle = $_POST[$BlockName . 'BlockTitle']; $BlockContent = $_POST[$BlockName . 'BlockContent']; if ($BlockCount == $NumberOfBlocks) { $query .= "`" . $BlockName . "FontColor` = '" . $FontColor . "', " . "`" . $BlockName . "IncludeInNav` = " . $IncludeInNav . ", " . "`" . $BlockName . "DisplayNav` = " . $DisplayNav . ", " . "`" . $BlockName . "BlockTitle` = '" . $BlockTitle . "', " . "`" . $BlockName . "BlockContent` = '" . $BlockContent . "';"; $BlockCount ++; } else { $query .= "`" . $BlockName . "FontColor` = '" . $FontColor . "', " . "`" . $BlockName . "IncludeInNav` = " . $IncludeInNav . ", " . "`" . $BlockName . "DisplayNav` = " . $DisplayNav . ", " . "`" . $BlockName . "BlockTitle` = '" . $BlockTitle . "', " . "`" . $BlockName . "BlockContent` = '" . $BlockContent . "', "; $BlockCount ++; } } mysql_query($query,$link) or die("Error ". mysql_error(). " with query ". $query); } ?>
  12. Yeah . . . still doesn't work but I figure screw it. I'm just gonna use the database the way it's meant to be used and forget the work with arrays. Thank for everyones help so far though.
  13. Well, tried to edit again to avoid double posting but too late I guess. It appears that it IS anything with quotes. If I drop in "test" in any of the fields, it jacks up the whole unserialize process. So, I believe that should be sufficient data for someone to tell me how I'm screwing up?
  14. Ok . . . I found the problem so NOW I just need help fixing it hahaha. The problem is the unserialize. The data is being stored just fine in the data base and when I retrieve it plain, it is being retrieved just fine. However, it is only being retrieved in its serialized form: <?php while ($row = mysql_fetch_array($result)) { $IndexNo = $row['IndexNo']; $EditTitle = $row['Title']; $Data = $row['Data']; } echo 'Plain Data: ' . $Data . '<br>'; echo 'Unserialized Data: ' . unserialize($Data) . '<P>'; ?> The 'Plain Data" like I said, echos back the still serialized data from the database. However, the 'Unserialized Data' echos back nothing. Any idea why the html is causing it to not be able to unserialize the data? EDIT: Even More info . . . a table code works just fine until I try to define any characteristics of the table like width. What the f is going on here? How does adding, what appears to be, quotes jack up the whole process?
×
×
  • 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.