 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
04-17-2008, 04:36 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Adding Event to PHP Calendar
Hi all,
I am making a calendar with php, so far I have it displaying the months and moving fwd and back in the months etc... I would like to add events to dates and have them show up with some different color and maybe an icon or something. I guess I am looking for some ideas on how to make this work best. I am making this flat file. Thanks! 
|
|
|
|
04-17-2008, 04:40 PM
|
#2 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by buildakicker
Hi all,
I am making a calendar with php, so far I have it displaying the months and moving fwd and back in the months etc... I would like to add events to dates and have them show up with some different color and maybe an icon or something. I guess I am looking for some ideas on how to make this work best. I am making this flat file. Thanks! 
|
Just make a whole text file worth of events, and organize them, and when it comes time to grabbing it by php, just replace it using pcre and having them being placed in by the way of whatever is in the event flat file.. that's about all I can say, I mean I wouldn't recommend anything by flat file, do to security reasons, mysql all the way. :p
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
04-17-2008, 04:49 PM
|
#3 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
I hear that, this is internal only and I don't have a db option, not even mySqlLite. It's a joke.
|
|
|
|
04-17-2008, 09:20 PM
|
#4 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Hi all... working on my calendar here. Coming along nice, but I have question...
Why does this work:
Code:
if($todayis != ($i - $startday + 1)){
echo "<td class='tddate'>". ($i - $startday + 1) . "</td>\n";
}else if($monthis != $cMonth){
echo "<td class='tddate'>". ($i - $startday + 1) . "</td>\n";
}else{
echo "<td class='tdcurrentdate'>". ($i - $startday + 1) . "</td>\n";
}
...but this doesn't
Code:
if($todayis != ($i - $startday + 1) && $monthis != $cMonth){
echo "<td class='tddate'>". ($i - $startday + 1) . "</td>\n";
}else{
echo "<td class='tdcurrentdate'>". ($i - $startday + 1) . "</td>\n";
}
|
|
|
|
|
The Following User Says Thank You to buildakicker For This Useful Post:
|
|
04-17-2008, 09:33 PM
|
#5 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 264
Thanks: 2
|
Because your months are never equal as well as the start date equation output equal.
__________________
"What everyone seems to forget is that while knowledge certainly is something - it's the implementation of knowledge that brings power" - Andres Galindo.
|
|
|
|
04-18-2008, 12:37 AM
|
#6 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Getting further along! I have a function where I would like to get the date from the current TD and then IF there are events, put them into that TD... my language is screwed up somewhere... here is what I have:
Code:
function showEventsCal($eday){
//add event for current day
$date = date("m/d/Y");
$fh = fopen("events.txt", "rb");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
if($eday == $parts[0]){
echo "<div class='calDayEvent'>". $parts[1]."</div>";
}
}
fclose($fh);
}
This shows in the day in the calendar:
Code:
//shows days and make sure it's not today, then give it events if there are some
if($todayis != ($i - $startday + 1)){
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $day -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tddate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
I am trying to compare in my function by giving it $eDay which holds the current date for the day it is displaying... I see this cause it echo's correctly. However, in my function it won't compare it. It does fine displaying the $date for today, but not any of the past or present events... Here is all my code so far:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Event Calendar</title>
<style>
td{
text-align:center;
background:#93AA39;
color:#000000;
border:1px solid #4A551C;
font-weight:bold;
}
table{
border:1px solid #4A551C;
}
.tdnav a{
color:#ffffff;
}
.tdnav a:hover{
color:#000000;
}
.tdnav{
padding:5px;
}
.tdmonth{
padding:5px;
background:#D4DFA7;
font-size:20px;
}
.tdday{
padding:5px;
background:#E6FF80;
font-size:14px;
}
.tddate{
background:#F2FFBF;
padding:25px;
}
.tddate:hover{
background:#CCFF00;
color:#333333;
}
.tdcurrentdate{
background:#CCFF00;
color:#000000;
}
#listevents{
background:#cccccc;
border:1px solid #666666;
padding:10px;
margin-top:10px;
width:50%;
}
#listevents p{
margin-top:2px;
border:1px solid #000000;
padding:10px;
background:#FFFFFF;
}
#addevents{
background:#FFCC00;
color:#000000;
padding:10px;
border:1px solid #999999;
width:50%;
}
.calDayEvent{
background:#ffffff;
padding:2px;
margin:1px;
font-size:11px;
font-weight:normal;
}
</style>
</head>
<body>
<?php
//global variables
$dstamp = date("m/d/Y");
$todayis = date("j");
$monthis = date("m");
function showEvents(){
$fh = fopen("events.txt", "rb");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
print "<p><strong>Date:</strong> " . $parts[0] . "<br /><strong>Info:</strong> " . $parts[1]. "</p>";
}
fclose($fh);
}
function showEventsCal($eday){
//add event for current day
$date = date("m/d/Y");
$fh = fopen("events.txt", "rb");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
if($eday == $parts[0]){
echo "<div class='calDayEvent'>". $parts[1]."</div>";
}
}
fclose($fh);
}
$monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
$cMonth = $_REQUEST["month"];
$cYear = $_REQUEST["year"];
$prev_year = $cYear;
$next_year = $cYear;
$prev_month = $cMonth-1;
$next_month = $cMonth+1;
if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $cYear - 1;
}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $cYear + 1;
}
?>
<div id="calendar_div" name="calendar_div">
<table width="80%">
<tr align="center">
<td bgcolor="#999999" style="color:#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left" class="tdnav"> <a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prev_month . "&year=" . $prev_year; ?>">Previous Month</a></td>
<td width="50%" align="right" class="tdnav"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $next_month . "&year=" . $next_year; ?>">Next Month</a> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr align="center">
<td colspan="7" class="tdmonth"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td>
</tr>
<tr>
<td class="tdday"><strong>Sunday</strong></td>
<td class="tdday"><strong>Monday</strong></td>
<td class="tdday"><strong>Tuesday</strong></td>
<td class="tdday"><strong>Wednesday</strong></td>
<td class="tdday"><strong>Thursday</strong></td>
<td class="tdday"><strong>Friday</strong></td>
<td class="tdday"><strong>Saturday</strong></td>
</tr>
<?php
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
for ($i=0; $i<($maxday+$startday); $i++) {
if(($i % 7) == 0 ) echo "<tr>\n";
if($i < $startday) echo "<td></td>\n";
else{
//#######################################################################
//shows days and make sure it's not today, then give it events if there are some
if($todayis != ($i - $startday + 1)){
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $se(day) -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tddate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
//#######################################################################
//print the day, as long as it's not today, and any events that might be on that day
}else if($monthis != $cMonth){
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $se(day) -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tddate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
//#######################################################################
//print the current day, and if there are event's for this day, show em'!
}else{
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $se(day) -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tdcurrentdate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
}
}
if(($i % 7) == 6 ) echo "</tr>\n";
}
?>
</table>
</td>
</tr>
</table>
<div id="listevents">
<?php
echo showEvents();
?>
</div>
<h3>ADMIN</h3>
<div id="addevents">
<?php
//write to file from form
?>
</div>
</div>
</body>
</html>

|
|
|
|
04-21-2008, 06:44 PM
|
#7 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Function not taking $var
Hi all,
Back at the calendar now... monday! Web 2.0 Expo coming up in San Fran anyone going? Twitter me: buildakicker
Anyhow... I am trying to pass a string variable $eDay into a simple function:
PHP Code:
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $day -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tdcurrentdate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
ShowEventsCal() looks like this:
PHP Code:
function showEventsCal($eday){
//add event for current day
$date = date("m/d/Y");
$fh = fopen("events.txt", "rb");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
if($eday == $parts[0]){
echo "<div class='calDayEvent'>". $parts[1]."</div>";
}
}
fclose($fh);
}
What am I doing wrong with this Variable? I can put in the date like: '04/21/2008' and it works fine...

|
|
|
|
04-21-2008, 08:10 PM
|
#8 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Ok, so I figured it out... I'm finding that asking questions here sometimes helps me figure out the issue!
04/21/2008 and 4/21/2008 are way different right.
It works now that I use use the month, without the leading 0.
So here is my Flat File Event Calendar almost complete:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Event Calendar</title>
<style>
td{
text-align:center;
background:#93AA39;
color:#000000;
border:1px solid #4A551C;
font-weight:bold;
}
table{
border:1px solid #4A551C;
}
.tdnav a{
color:#ffffff;
}
.tdnav a:hover{
color:#000000;
}
.tdnav{
padding:5px;
}
.tdmonth{
padding:5px;
background:#D4DFA7;
font-size:20px;
}
.tdday{
padding:5px;
background:#E6FF80;
font-size:14px;
}
.tddate{
background:#F2FFBF;
padding:25px;
}
.tddate:hover{
background:#CCFF00;
color:#333333;
}
.tdcurrentdate{
background:#CCFF00;
color:#000000;
}
#listevents{
background:#cccccc;
border:1px solid #666666;
padding:10px;
margin-top:10px;
width:50%;
}
#listevents p{
margin-top:2px;
border:1px solid #000000;
padding:10px;
background:#FFFFFF;
}
#addevents{
background:#FFCC00;
color:#000000;
padding:10px;
border:1px solid #999999;
width:50%;
}
.calDayEvent{
background:#ffffff;
padding:2px;
margin:1px;
font-size:11px;
font-weight:normal;
}
</style>
</head>
<body>
<?php
//global variables
$dstamp = date("m/d/Y");
$todayis = date("j");
$monthis = date("m");
function showEvents(){
$fh = fopen("events.txt", "rb");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
print "<p><strong>Date:</strong> " . $parts[0] . "<br /><strong>Info:</strong> " . $parts[1]. "</p>";
}
fclose($fh);
}
function showEventsCal($eday){
//add event for current day
$date = date("m/d/Y");
$fh = fopen("events.txt", "rb");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
if($eday == $parts[0]){
echo "<div class='calDayEvent'>". $parts[1]."</div>";
}
}
fclose($fh);
}
$monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
$cMonth = $_REQUEST["month"];
$cYear = $_REQUEST["year"];
$prev_year = $cYear;
$next_year = $cYear;
$prev_month = $cMonth-1;
$next_month = $cMonth+1;
if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $cYear - 1;
}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $cYear + 1;
}
?>
<div id="calendar_div" name="calendar_div">
<table width="80%">
<tr align="center">
<td bgcolor="#999999" style="color:#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left" class="tdnav"> <a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prev_month . "&year=" . $prev_year; ?>">Previous Month</a></td>
<td width="50%" align="right" class="tdnav"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $next_month . "&year=" . $next_year; ?>">Next Month</a> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr align="center">
<td colspan="7" class="tdmonth"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td>
</tr>
<tr>
<td class="tdday"><strong>Sunday</strong></td>
<td class="tdday"><strong>Monday</strong></td>
<td class="tdday"><strong>Tuesday</strong></td>
<td class="tdday"><strong>Wednesday</strong></td>
<td class="tdday"><strong>Thursday</strong></td>
<td class="tdday"><strong>Friday</strong></td>
<td class="tdday"><strong>Saturday</strong></td>
</tr>
<?php
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
for ($i=0; $i<($maxday+$startday); $i++) {
if(($i % 7) == 0 ) echo "<tr>\n";
if($i < $startday) echo "<td></td>\n";
else{
//#######################################################################
//shows days and make sure it's not today, then give it events if there are some
if($todayis != ($i - $startday + 1)){
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $se(day) -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tddate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
//#######################################################################
//print the day, as long as it's not today, and any events that might be on that day
}else if($monthis != $cMonth){
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $se(day) -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tddate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
//#######################################################################
//print the current day, and if there are event's for this day, show em'!
}else{
//get the day according to the forumla
$day = $i - $startday + 1;
//getMonth - > $se(day) -> getYear compare to showEventsOther
$eDay = $thismonth['mon']."/".$day."/".$thismonth['year'];
echo "<td class='tdcurrentdate'>". ($i - $startday + 1);
showEventsCal($eDay);
echo "</td>\n";
}
}
if(($i % 7) == 6 ) echo "</tr>\n";
}
?>
</table>
</td>
</tr>
</table>
<div id="listevents">
<?php
echo showEvents();
?>
</div>
<h3>ADMIN</h3>
<div id="addevents">
<?php
//write to file from form
?>
</div>
</div>
</body>
</html>
Here is the events.txt:
HTML Code:
3/11/2008|description0
4/01/2008|description1
4/06/2008|description2
4/11/2008|description3
4/17/2008|description4
4/17/2008|description4-1
4/21/2008|description 21
5/15/2008|description5
Hopefully this will help some other folks out...
|
|
|
|
04-30-2008, 05:33 PM
|
#9 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
I have worked more on my calendar. It's coming along well. Right now I am struggling with how to get events to show up in a lightbox when clicked on within the calendar. I am doing that click event here:
Code:
function showEventsCal($eday){
//add event for current day
$fh = fopen("events.txt", "r+");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
if($eday == $parts[0]){
echo "<div class='calDayEvent'><a href='#'>". $parts[1]."</a></div>";
}
}
fclose($fh);
}
I would like to display $parts[0] $parts[1] and $parts[2] in a popup window or lightbox. However, I am not sure how to pass this info to a popup window. Would I have to use javascript? How would I pass the variables to the window in php to js?
Thanks!
|
|
|
|
05-07-2008, 03:38 PM
|
#10 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Hi all, calendar is almost ready to "release" if I dare say that. I have a questions about EXPLODE. I have dates stored in a text file like this 05/07/2008. This gets fed into $parts[1] so parts1 has 05/07/2008 in it. How can I EXPLODE parts1 and get just the 05 out of it?
|
|
|
|
05-07-2008, 04:07 PM
|
#11 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
You CAN!
Code:
function exDate(){
$fh = fopen("events.txt", "r+");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
$d = explode('/', $parts[1]);
//if the month = $month then show all for that month, else don't show them.
echo $d[0];
}
fclose($fh);
}
|
|
|
|
05-07-2008, 04:41 PM
|
#12 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
You could always shorten that up a bit too,
PHP Code:
echo $szDay = reset(explode('/', $parts[1]));
...not that it makes a huge difference, just saying. 
-m
|
|
|
|
05-07-2008, 05:05 PM
|
#13 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Quote:
Originally Posted by delayedinsanity
You could always shorten that up a bit too,
PHP Code:
echo $szDay = reset(explode('/', $parts[1]));
...not that it makes a huge difference, just saying. 
-m
|
Thanks for the reply! That's a lot less data to process... NANO Seconds Count!
|
|
|
|
05-07-2008, 05:27 PM
|
#14 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Just to note, I left the variable in there in case you needed to return the value or use it later on. If you don't, and you want to save another extra nanosecond, just remove the "$szDay =" part... this produces an E_STRICT error on my test machine, telling me that I'm passing variables by reference, but eh, I've seen it done before, so it shouldn't be the end of the world.
-m
|
|
|
|
|
The Following User Says Thank You to delayedinsanity For This Useful Post:
|
|
05-07-2008, 06:15 PM
|
#15 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
I'd use the $var, but right again. Is there a function in PHP to read just info from ONE line? I am trying to read the data from $parts[1] of a "4 part" line of text. I am exploding $parts[1] and trying to compare the first number in there with a number coming into my function.
Code:
function showEventsList($m){
$fh = fopen("events.txt", "r+");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
//$mon has the current months two digits ie... 05
$mon = explode('/', $parts[1]);
//do they output correcty?
//echo $m;
//echo "<br>";
//echo $mon[0];
if(!$m = $mon[0]){
//No Events for this month...
print "<p>No Events For This Month.</p>";
}else{
//events listed for current month decided by $mon[0]
print "<p id='".$parts[0]."'><strong>Date:<a name='".$parts[1]."'></a></strong> " . $parts[1] . "<br /><strong>Title:</strong> " . $parts[2] . "<br /><strong>Description: </strong>" . $parts[3] . "</p>";
}
}
fclose($fh);
}
|
|
|
|
05-07-2008, 07:32 PM
|
#16 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Sorry, what is it you want to do?
a) Get only one specific line from the file (ie, line 3 of 20), not all of them
b) Get only the first line from the file in question
b) Get only the first part of each line, but read them all in
c) something else?
-m
|
|
|
|
05-07-2008, 08:15 PM
|
#17 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
Quote:
|
b) Get only the first part of each line, but read them all in
|
...sort of. My text file looks like this:
Code:
uid|date|title|description
Code:
1|05/07/2008|My Event Post|Describing it all here in a few lines
I am trying to get only the 05 events to show during May(05), 04 events to show in April(04)... depending on which month it is those event show.
So what I was thinking was I could easily use:
Code:
//this is the date "field"
$mon = explode('/', $parts[1]);
//this shows just the month in that field
$mon[0]
Then I would get the current month passed into my function as $m, and do a simple if this then like so:
Code:
if($m = $mon[0]){
print "<p id='".$parts[0]."'><strong>Date:<a name='".$parts[1]."'></a></strong> " . $parts[1] . "<br /><strong>Title:</strong> " . $parts[2] . "<br /><strong>Description: </strong>" . $parts[3] . "</p>";
}
...but I am missing something and I cannot wrap my brain around it. Here is the full function as of right now:
Code:
function showEventsList($m){
$fh = fopen("events.txt", "r+");
while (!feof($fh) ) {
$txtline = fgets($fh);
$parts = explode('|', $txtline);
//$mon has the current months two digits ie... 05
$mon = explode('/', $parts[1]);
if($m = $mon[0]){
print "<p id='".$parts[0]."'><strong>Date:<a name='".$parts[1]."'></a></strong> " . $parts[1] . "<br /><strong>Title:</strong> " . $parts[2] . "<br /><strong>Description: </strong>" . $parts[3] . "</p>";
}
}
fclose($fh);
}
$m does get the correct number, as I have echoed it, and $mon[0] is displaying correctly also... where is my logic wrong?
Thanks! 
|
|
|
|
05-07-2008, 08:34 PM
|
#18 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
It's like I am not only printing the 05 dates, but also the 04 dates, so I need to limit which things are being printed... but the if isn't doing that... so do I do a while loop?
|
|
|
|
05-07-2008, 09:04 PM
|
#19 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 119
Thanks: 21
|
DUH!!!! Stupid. Gotta look for stuff like
sorry to trouble you with that question...
|
|
|
|
10-18-2012, 02:40 PM
|
#20 (permalink)
|
|
The Addict
Join Date: Oct 2012
Posts: 244
Thanks: 0
|
Some conservatives have Coach Factory Outlet pushed that critique further, saying that Mr. Obama’s policies are too costly, often assist the wrong people Louis Vuitton Belts and could have the paradoxical effect of driving up college costs. The dispute turns not just on different Coach Factory Outlet assessments of how policies play out, but on differing philosophical views about the role of government. During Gucci Belts his time in office, Mr. Obama has sharply increased aid to low- and middle-income students, notably through the Pell Grant Coach Factory Outlet program, which grew from $14.6 billion given to 6 million students in 2008, to nearly $40 billion for Coach Factory Outlet almost 10 million students this year. His administration also made it easier to request aid, shortening the Coach Factory Online complex federal application and allowing people to transfer their financial information electronically from the Internal Coach Outlet Online Revenue Service database. But while many education experts laud his efforts, analysts of varying political Coach Outlet Online stripes have also questioned how much impact some of the president’s policies will have, noting that the prices Coach Online Outlet charged by colleges, and student borrowing, continue to climb.But behind the headlines about soaring costs, the Coach Factory Outlet Online reality is more complex and wildly uneven, because a growing number of students receive Coach Outlet Online financial aid, and only relatively high-income families pay those fast-rising sticker prices. Adjusted for Coach Factory Online inflation, the College Board calculates, the average net price changed little over the last decade at private Coach Factory Outlet schools, and rose only modestly at public ones.Defending federal spending, Arne Duncan, the secretary of Hermes Belts education, said that for more than 30 years, college prices had risen even when federal aid had not, leading him to believe Coach Factory Online there was zero correlation.
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|