Kritter5x's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
3 (0 per day)
Joined:
15-July 12
Profile Views:
364
Last Active:
User is offline Aug 07 2012 08:06 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Kritter5x has not set their status

Posts I've Made

  1. In Topic: Event Tracking Calendar

    Posted 17 Jul 2012

    Apologies for multi-posting, I can't seem to find an option to edit posts though.

    Just thought i'd leave a small update for this that I managed to wrangle in regarding colouring cells that have an event in them. Here's the code I used for that:

    for ($count=0; $count < (6*7); $count++) {
    	$dayArray = getdate($start);
    	if (($count % 7) == 0) {
    		if ($dayArray["mon"] != $month) {
    			break;
    		} else {
    			echo "</tr><tr>\n";
    		}
    	}
    	if ($count < $firstDayArray["wday"] || $dayArray["mon"] != $month) {
    		echo "<td style=\"background-color: #EEEEEE\">&nbsp;</td>\n";
    	} else {
    		$chkEvent_sql = "SELECT event_name FROM events WHERE event_category='Category 1' AND month(event_date) = '".$month."' AND dayofmonth(event_date) = '".$dayArray["mday"]."' AND year(event_date) = '".$year."' ORDER BY event_date";
    		$chkEvent_res = mysql_query($chkEvent_sql, $mysql) or die(mysql_error($mysql));
    
    		if (mysql_num_rows($chkEvent_res) > 0) {
    			$event_name = "";
    			$event_format1 = "";
    			$event_format2 = "";
    			$event_format3 = "#FFFFFF";
    			
    			if ($ev = mysql_fetch_array($chkEvent_res)) {
    				$event_name .= stripslashes($ev["event_name"])."<br/>";
    				$event_format1 = "<b>";
    				$event_format2 = "</b>";
    				$event_format3 = "#CCCCCC";
    			}
    			mysql_free_result($chkEvent_res);
    		} else {
    			$event_name = "</br>";
    			$event_format1 = "";
    			$event_format2 = "";
    			$event_format3 = "#FFFFFF";
    		}
    
    		echo "<td style=\"background-color: $event_format3\"\"valign=\"top\">".$event_format1."<a href=upcomingevents.php?m=".$month."&d=".$dayArray["mday"]."&y=$year\">".$dayArray["mday"]."</a>".$event_format2."<br/>".$event_name."</td>\n";
    		unset($event_name);
    
    		$start += ADAY;
    	}
    }
    
    


    This formats any cell that has an event in it by using $event_formatX parts to make the date number bold and colours the cell based on the hex value put in there. There may be a better way to do it, but that's what I came up with.

    Now all I need to do is find a way to filter by event category and i'm set.
  2. In Topic: Event Tracking Calendar

    Posted 16 Jul 2012

    Oh and I hope i'm not asking too much, but I was wondering if it would be possible to add some kind of event filtering system to this?

    I have categories for events, and i'd like to be able to filter what's displayed on the calendar based on the category of events. I assume a drop-down box would do the trick, but I couldn't work out how to do it.
  3. In Topic: Event Tracking Calendar

    Posted 15 Jul 2012

    This tutorial is fantastic and easy enough to follow. I managed to edit it to work with my own event editor, which is a huge bonus for me.

    I would like to ask how to do a few things though, if that's possible from anyone?

    Firstly, would it be possible to have a "next" and "previous" month buttons, instead of choosing the month? Ultimately it's not that big of a deal, but it would be a nice little feature to have.

    My other question would be, rather than putting the event name on the day when there's an event, would it be possible to simply color the cell? For what i'm doing, it's likely there'd be a few events posted for a single day and the calendar would likely be in a small area so multiple event titles would stretch it too much.

    Thanks in advance!

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

Kritter5x hasn't added any friends yet.

Comments

Page 1 of 1
  1. Photo

    zegmagnes Icon

    28 Nov 2012 - 19:45
    thiw event calendar that i looking too...
    http://www.dreamincode.net/forums/topic/87835-event-tracking-calendar/
  2. Photo

    zegmagnes Icon

    28 Nov 2012 - 19:43
    hello bro...
    i'm new member here and i can't see ur email.so i will ask from here.
    how to make edit and delete function for event calendar from this script that u have used too? i already try for 2 week and it won't work.. please help me...this is my email zegmagnes@yahoo.com
Page 1 of 1